Am I missing something or should this:
export PATH=$PATH:$PREFIX/bin
be changed to
export PATH=$PREFIX/$TARGET/bin:$PATH
I'm pretty sure if the newly compiled binutils is to override the system version it needs to be before the rest of the current path and furthermore point to version of the files without the prefix...
GCC Cross-Compiler
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: GCC Cross-Compiler
No, you shouldn't. Configure looks for both a host and target toolchain, so it wants specifically a i686-pc-cygwin-as, and a i586-elf-as when it looks for the GNU assembler. if you add prefix/bin, it can find i586-elf-as. if you add prefix/target/bin, there's only as, and it comes later in the path than the host assembler which also uses that name, so you will start to miss out on one. And worse: you will break everything that expects gcc/as/ld without prefix to be the host toolchain.
Also, that tutorial exists practically unchanged for over 5 years now, do you honestly believe it was broken all that time?
Also, that tutorial exists practically unchanged for over 5 years now, do you honestly believe it was broken all that time?
Re: GCC Cross-Compiler
No I know it works because I've done it many times, the tutorial just doesn't explain what you just did...
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: GCC Cross-Compiler
Not in that wording, but you did draw a contradictory conclusion:the tutorial just doesn't explain what you just did...
You wrote:(...) if the newly compiled binutils is to override the system version (...)
The section from which I got that last quote (briefly) explains why the tutorial does it that way, but you can't really expect a tutorial to cover for each possible deviation why they do not do it that other way: that's most often a reader's exercise or author's taste, if not both.The wiki wrote:(...) so that gcc invokes your system compiler, and $TARGET-gcc invokes your cross-compiler. (...)
Re: GCC Cross-Compiler
I agree, consider this part of my "reader's exercise" to acquire further information.Combuster wrote:that's most often a reader's exercise