Building Cross-Compiler: BFD Default Target?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Building Cross-Compiler: BFD Default Target?

Post by pcmattman »

Hi everyone,

I'm following the OS_Specific_Toolchain tutorial on the wiki and I've run into some trouble while compiling GCC:

Code: Select all

/usr/mattise/cross/i586-pc-mattise/bin/ar  rc ./libgcc.a libgcc/./_muldi3.o libg
cc/./_negdi2.o libgcc/./_lshrdi3.o libgcc/./_ashldi3.o libgcc/./_ashrdi3.o libgc
c/./_cmpdi2.o libgcc/./_ucmpdi2.o libgcc/./_clear_cache.o libgcc/./_enable_execu
te_stack.o libgcc/./_trampoline.o libgcc/./__main.o libgcc/./_absvsi2.o libgcc/.
/_absvdi2.o libgcc/./_addvsi3.o libgcc/./_addvdi3.o libgcc/./_subvsi3.o libgcc/.
/_subvdi3.o libgcc/./_mulvsi3.o libgcc/./_mulvdi3.o libgcc/./_negvsi2.o libgcc/.
/_negvdi2.o libgcc/./_ctors.o libgcc/./_ffssi2.o libgcc/./_ffsdi2.o libgcc/./_cl
z.o libgcc/./_clzsi2.o libgcc/./_clzdi2.o libgcc/./_ctzsi2.o libgcc/./_ctzdi2.o
libgcc/./_popcount_tab.o libgcc/./_popcountsi2.o libgcc/./_popcountdi2.o libgcc/
./_paritysi2.o libgcc/./_paritydi2.o libgcc/./_powisf2.o libgcc/./_powidf2.o lib
gcc/./_powixf2.o libgcc/./_powitf2.o libgcc/./_mulsc3.o libgcc/./_muldc3.o libgc
c/./_mulxc3.o libgcc/./_multc3.o libgcc/./_divsc3.o libgcc/./_divdc3.o libgcc/./
_divxc3.o libgcc/./_divtc3.o libgcc/./_fixunssfsi.o libgcc/./_fixunsdfsi.o libgc
c/./_fixunsxfsi.o libgcc/./_fixsfdi.o libgcc/./_fixunssfdi.o libgcc/./_floatdisf
.o libgcc/./_floatundisf.o libgcc/./_fixdfdi.o libgcc/./_fixunsdfdi.o libgcc/./_
floatdidf.o libgcc/./_floatundidf.o libgcc/./_fixxfdi.o libgcc/./_fixunsxfdi.o l
ibgcc/./_floatdixf.o libgcc/./_floatundixf.o libgcc/./_fixtfdi.o libgcc/./_fixun
stfdi.o libgcc/./_floatditf.o libgcc/./_floatunditf.o libgcc/./_eprintf.o libgcc
/./__gcc_bcmp.o libgcc/./_divdi3.o libgcc/./_moddi3.o libgcc/./_udivdi3.o libgcc
/./_umoddi3.o libgcc/./_udiv_w_sdiv.o libgcc/./_udivmoddi4.o libgcc/./unwind-dw2
$
./unwind-c.o
/usr/mattise/cross/i586-pc-mattise/bin/ar: can't set BFD default target to `i586
-pc-mattise': Invalid bfd target
I've set up the bfd/config.bfd file properly, I think:

Code: Select all

 i[3-7]86-*-mattise*)
   targ_defvec=bfd_elf32_i386_vec
   targ_selvecs=i386coff_vec
   ;;
Any clues as to why this is happening? Thanks in advance!
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Porting binutils/gcc seem to be a bit troublesome eh? :)

Your edit of bfd/config.bfd looks a little weird...

Try targ_selfvecs=i386mattise_vec

There are also other changes required to both binutils and GCC when building your own custom target.. at this point, I can only assume you set them up correctly.

Good luck :)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Actually, I think I put the definition before the targmatch.h section, which meant that the target wasn't being put into BFD's target list - I'm compiling again now to find out if moving it to the proper location has fixed this.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Sorry about the double post everyone :(...

I've actually gotten past that stage and am now attempting to compile GCC, but I'm running into strife (no surprises there, I guess):

Code: Select all

Configuring in ./libiberty
configure: loading cache ./config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure:   former value:  -g -O2
configure:   current value: -g -O2
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
This happens after I run configure and during "make all-gcc". Any ideas?
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

Post by binutils »

Code: Select all

Configuring in ./libiberty
configure: loading cache ./config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure:   former value:  -g -O2
configure:   current value: -g -O2
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
the above says the answer, make clean or make distclean && (some configure) && make all-gcc

HTH
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Thanks, I was at school yesterday when I noticed the folder I was in - making GCC in build-binutils isn't a great idea ;). Now it all works, thanks for the help guys!
Post Reply