Original Post

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/viewtopic.php?topic_id=3883&viewmode=flat&order=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.

Attachments:
9 Replies

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. 😛

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.

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?

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/viewtopic.php?post_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/NetBSD-release-6/src/external/gpl3/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/viewtopic.php?post_id=10832#forumpost10832 Regardless of what causes it, I just want it fixed in GCC4! 🙂

That’s good enough for me. If it works, I’ll just update the existing file, so the above link will still work.

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. 😛

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

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?

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. 🙁

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).

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.

 

Write a reply

You must be logged in to reply to this topic.