Hi, I'm wrangling my own build system, and I noticed from the devkitppc makefiles that it uses g++ to link instead of ld.
As far as I can tell, this has something to do with wanting to pass the MACHDEP options to the linker aswell... and since some of them are compiler options, I guess g++ will invoke the linker, and forward only the relevant options (while not complaining that compile options were given to ld)?
Something like that?
Anyway, what I'm wondering is, which options are required for each step?
The options given to both the compiler and linker (ie, g++ used to link) are:
-g -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float
I presume -DGEKKO -mcpu=750 -meabi -mhard-float are only needed while compiling, surely they don't need to be supplied while linking?
That leaves me wondering about -g -mrvl, which of these are needed by the compile step, and by the link step?
Obviously I need -g while compiling, do I also need it when linking? And what is -mrvl? I can't find any information about it... I'm suspecting that's the magic option that is wanted by the link step... is it needed during the compile step?
TL;DR: of those options, can you separate into options that should be given while compiling, and which should be given while linking?
devkitPPC uses g++ to link?
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: devkitPPC uses g++ to link?
The semi automatic makefiles check for compiling .cpp files & then use g++ to link otherwise gcc is used to link. It's done this way because there are various options passed to ld which are determined at compile time for the toolchain. IIRC gcc/g++ also have code for detecting the paths the tools are being run from and adjusting if necessary.TurkeyMan wrote:Hi, I'm wrangling my own build system, and I noticed from the devkitppc makefiles that it uses g++ to link instead of ld.
That depends on whether or not the toolchain has libraries specifically optimised for those options and possibly some link time optimisationsI presume -DGEKKO -mcpu=750 -meabi -mhard-float are only needed while compiling, surely they don't need to be supplied while linking?
both - -mrvl changes parts of the headers used to compile and also changes the path of the libraries used to link. The g option is supplied at both compile and link stages to get full debug information in the final elf.That leaves me wondering about -g -mrvl, which of these are needed by the compile step, and by the link step?
It's a bit more complicated than it appears at first sight, sorry.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests