🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42259

gcc cross build

#42259
From: James E. Hopper
Date: Fri, 05 Jan 1996 00:00
58 lines
2437 bytes
Hi!

I have build a cross gcc to run on the sun which generates
code for a unix system on the 68k macintosh (Machten).  I built both
gcc and binutils, and i can compie c code into mac executables which 
run on my 68k mac under machten (not native mac os).

so far all is great, now i want to use these cross tools to generate 
gcc tools which are targetted for mac as well as running on the
mac (still under machten).  i set up the source directories as useaul

gcc-2.7.2
 
do patches etc...

then do
cd gcc-2.7.2
configure --host=m68k-mac-machten --target=m68k-mac-machten 
  --build=sparc-sun-solaris2.4
make CFLAGS="-O2" LANGUAGES=c

which compiles fine for a while. but when it gets to compiling the files
required by genattr (an application which must run on build machine)

makefile tries to send gcc -b options for both the target and the build
machine ie...

gcc -b m68k-mac-machten -b sparc-sun-solaris2.4 -c  -DIN_GCC  -O   -D____ 
 -I. -I. -I./config ./genattr.c

which confuses the compiler and i get the following error:
gcc: installation problem, cannot exec `cpp': No such file or directory

if i hand do the compie to

gcc -b sparc-sun-solaris2.4 -c  -DIN_GCC  -O   -D____ -I. -I. 
-I./config ./genattr.c

so that i have only the correct -b option everything compiles fine.

so first question:  how to i get make to pass only one -b option?

if i then hand compile the parts of genattr as above and then restart
make i get another error:

gcc -b m68k-mac-machten -b sparc-sun-solaris2.4  -DIN_GCC  -O   -o genattr \
 genattr.o l-rtl.o ` case "obstack.o" in ?*) echo l-obstack.o ;; esac ` ` case "
gcc -b m68k-mac-machten -b sparc-sun-solaris2.4"@"" in "cc"@?*) echo l- ;; esac 
` ` case "" in ?*) echo l- ;; esac ` 
ld: cannot open crt0.o: No such file or directory

the sparc machine does not have crt0.o it has crt1.o but not 0. so it appears
make is trying to use 68k parameters for link when it should be doing a
sparc link.

Can anyone tell me how to properly set things up for a cross compile?

thanks jim
Technical Details
Message-ID: <hopper-0501961235180001@hopperj1.dayton.saic.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,46f95fa1baeebf,start
X-Google-Attributes: gid11318c,public
From: hopper@dayton.saic.com (James E. Hopper)
Subject: gcc cross build
Date: 1996/01/05
Message-ID: <hopper-0501961235180001@hopperj1.dayton.saic.com>
X-Deja-AN: 134205300
organization: SAIC
newsgroups: gnu.gcc.help