You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/9/14 20:31
Nintendoid!
Joined 2006/3/15
Ecuador
228 Posts
PVBCC 3rdCoderLong Time User (12 Years)
Hi guys, KR155E asked me to help compiling my engine and I run into problems getting it to work with gccvb's pre compiled version which has two bugs:

1) Incorrect return call after a recursive function call.
2) Incorrect return call (I may be wrong about this, long time since I fixed it) to support variadic function calls.

Attached you will find the files with the fixes to M.K.'s gcc 4.4.2 patch which I grabbed from (http://www.planetvb.com/modules/newbb ... =ASC&type=&mode=0&start=0) and a make.sh script which automates the compilation and replaces a .asm file (lib1funcs.asm) with other fixes before gcc's compilation, which I don't really know how to include into the patch file.

There are two new library requirements besides those of bison, flex, etc.:

· gmp (dev library)
· mpfr (dev library)

Uncompress the file in your system, and download in the folder the corresponding versions of:

· gcc
· binutils
· newlib

from gnu's repository according to the versions in the .patch files.

Execute the make.sh from you cygwin command line window, and after the compilation is complete, don't forget to replace the crt0.o file.

After this I've been able to successfully compile my engine and the demos in VBDE.

Regards.

Attach file:


zip gccvb4.zip Size: 198.05 KB; Hits: 149
Top

#2
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/9/15 1:44
Nintendoid!
Joined 2007/12/14
166 Posts
CoderLong Time User (11 Years) App Coder
Was about to ask why you're using M.K.'s patches instead of my gccvb4 package with additional fixes, but then I went to the thread where I linked to them and... the links are dead. Oops. :P

So... I took your changes and integrated them into my gccvb4 build package. Also modified the make script so that the GNU packages are downloaded with curl. Keeps the attachment size down and saves folks from having it all in one lump, in case they just want the patches.

I can build this successfully on my Mac OS X setup, but couldn't get it to build in Cygwin or MinGW. I've been able to in the past, so it's possible my Windows environment is busted, but maybe somebody else will have better luck.

Attach file:


gz gccvb-4.4.2_src-20130914.tar.gz Size: 197.78 KB; Hits: 169
Top

#3
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/9/17 8:54
PVB Elite
Joined 2003/7/26
USA
1455 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
I successfully built native Win32 gcc/binutils using Jorge's patches under Mingw (specifically, the version distributed by the RubyInstaller folks for compiling native Ruby gems). The files are still completely untested, at this point. They may not work, or they may only work on my system (due to missing files, etc.). Since it's too big to attach to a post:

https://dl.dropboxusercontent.com/u/5754740/gccvb.7z

@blitter:

I am going to try again using your files (and possibly with an "official" install of MSYS/Mingw), but it would be nice to know the following before I do:

1. What do your files add that would make this worthwhile?
2. (With all due respect) are you sure that your changes are not responsible for the problems you observed in the generated function call code?
Top

#4
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/9/17 9:47
Nintendoid!
Joined 2007/12/14
166 Posts
CoderLong Time User (11 Years) App Coder
Quote:

RunnerPack wrote:
@blitter:

I am going to try again using your files (and possibly with an "official" install of MSYS/Mingw), but it would be nice to know the following before I do:

1. What do your files add that would make this worthwhile?
2. (With all due respect) are you sure that your changes are not responsible for the problems you observed in the generated function call code?


1) One patch defines ep as r30, so you can use it in inline asm. (See http://www.planetvb.com/modules/newbb ... t_id=13493#forumpost13493) Another patch redefines the frame pointer to be r25 instead of r29-- this allows the bitstring instructions to operate correctly. The last of my patches redefines the v810 reloc_howto_structs to what I think they're supposed to be, referencing elf32-v850.c from ftp://ftp.netbsd.org/pub/NetBSD/NetB ... gdb/dist/bfd/elf32-v850.c (The last of these three patches I'm not sure makes a difference-- I can build my smaller projects fine and the jal bug still exists in my larger project)

2) You're not the only one who questions me sometimes ;) I'm inclined to think not, since what sounds like the same issue with jal was reported by M.K. some time ago: http://www.planetvb.com/modules/newbb ... t_id=10832#forumpost10832 Regardless of what causes it, I just want it fixed in GCC4! :)
Top

#5
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/9/17 19:19
PVB Elite
Joined 2003/7/26
USA
1455 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
That's good enough for me. If it works, I'll just update the existing file, so the above link will still work.
Top

#6
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/9/21 4:37
Nintendoid!
Joined 2006/3/15
Ecuador
228 Posts
PVBCC 3rdCoderLong Time User (12 Years)
Quote:

blitter wrote:
Was about to ask why you're using M.K.'s patches instead of my gccvb4 package with additional fixes, but then I went to the thread where I linked to them and... the links are dead. Oops. :P

So... I took your changes and integrated them into my gccvb4 build package. Also modified the make script so that the GNU packages are downloaded with curl. Keeps the attachment size down and saves folks from having it all in one lump, in case they just want the patches.

I can build this successfully on my Mac OS X setup, but couldn't get it to build in Cygwin or MinGW. I've been able to in the past, so it's possible my Windows environment is busted, but maybe somebody else will have better luck.


Didn't know about your fixes, and I'm not really sure what I did back then to fix those errors, I'm not really versed in assembly code, so I suppose that I studied the compiler's files until I got with the problem and the solution for variadic calls and recursion. Indeed if you can check the part for variadic calls it would be great, it's not really working by itself, apart from the fixes to the compiler's files (which I honestly don't remember what for was each line), I have to insert the following assembly code after my variadic calls:

// variadic function prototype
void Container_propagateEvent(Container this, int (*event)(Container this, va_list args), ...);

// variadic call
Container_propagateEvent((Container)this->stage, Container_onKeyPressed, pressedKey));
// fix sp's displacement
asm("addi 20, sp, sp");


I was able to compile GCCVB 4.2 after almost a week of try and error, but it's possible, I'm using the latest version of Cygwin (haven't ever used MinGC), and GCC 4.7.3. Oh, and Windows XP :P.

Jorge
Top

#7
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/10/1 10:42
Administrator
Joined 2000/1/8
Germany
2497 Posts
Highscore Top10Highscore Top ScoreCoder#1 PosterHOTY09 1stLong Time User (15 Years) App Coder90+ Game Ratings
The pre-compiled gccvb posted by RunnerPack does not work for me when dropped into VBDE (gave an error like "application could not be started (0xc000007b)" - some 32/64 bit issues I assume). We couldn't get this fixed.

Is anyone able to build Windows binaries with Jorge's fixes?
Top

#8
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2013/10/6 0:17
Administrator
Joined 2000/1/8
Germany
2497 Posts
Highscore Top10Highscore Top ScoreCoder#1 PosterHOTY09 1stLong Time User (15 Years) App Coder90+ Game Ratings
I just successfully built Jorge's gccvb version using MinGW (official), but it behaves just like Runnerpack's version ("0xc000007b"). Weird.

I couldn't build blitter's version because of an error with building binutils. :-(
Top

#9
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2014/8/31 19:22
Virtual Freak
Joined 2014/8/31
USA
75 Posts
Long Time User (4 Years)
I can verify that I do NOT have an issue building binaries with RunnerPack's MinGW binaries (you are a life saver, btw). They can build the first of the 6 simple C demos per the development wiki page just fine.

Were the issues with the other MinGW builds for GCCVB ever resolved? I'm thrilled that the GCC version is no longer limited to 2.95. Knowing how slow MSYS builds are, I can only imagine your pain (I didn't even know native MinGW GCC builds were possible, actually).
Top

#10
Re: Compiling gccvb 4.4.2 under Cygwin
Posted on: 2015/1/27 19:00
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (6 Years) PVBCC 2013 3rd
Just wanted say using the script blitter attached to this post I was finally able to get a native compile on linux. Also a pleasant surprise was that the -O option to optimise the gcc compile actually works so I don't have to keep compiling with the 2.95 version to get my optimised code.
Thanks blitter!
Just an Fyi if somebody else tries it. Make sure your using textinfo (makeinfo) version less than 5.0. You'll get errors when building the doc files otherwise.
Top

 Top   Previous Topic   Next Topic


Register To Post