You are not logged in.

#1 2005-03-07 08:57:06

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Cross compiler in Arch.

I was fooling around trying to build a gcc cross compiler on arch. Using gcc-3.4.3..it kept failing to build. Without fail it borked on a couple of libs..signal.h and something else..can't recall just now..

Has anyone messed around with a X-compile on arch, or with gcc-3.4.3 in general?

I am thinking of trying an older version of gcc, and seeing how that would do. Then maybe I can use that for the bootstrap compiler and use the bootstrap compiler to build the cross-compiler.

*shrug* Anyone messed with this kind of stuff?

I was using the clean source from gnu.org for the binutils, gcc, and glibc sources.
I found an interesting doc on it.. https://www6.software.ibm.com/developer … ss-ltr.pdf
I was also trying to follow http://billgatliff.com/~bgat/twiki/bin/view/Crossgcc which apparently is almost gospel by now, but the versions listed are rather old, and there are some issues that are talked of in the wiki but not addressed (issues with glibc-2.3)..

oh, and someone in irc pointed me to linux from scratch, for boostrapping a toolchain, but that method relies heavily on having the libs, and other things, for the target architecture already available (from the cd). I am trying to do it without these..

Basically, as an exercise in "seeing if I can", I was trying to build a cross compiler for i386-pc-linux-gnu from inside the i686-pc-linux-gnu ArchLinux system. An exercise in targeting a different architecture. I figured I would start with i386 because it is classically the "best supported" toolchain wise.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#2 2005-03-08 10:54:01

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: Cross compiler in Arch.

Acutally it's pretty easy to create an i386 "cross-compiler" on an i686 system.  I used the following gcc config for a i386 uClibc system:

  ../gcc-$pkgver/configure --prefix=/usr 
     --enable-languages=c --enable-threads=posix --enable-__cxa_atexit 
     --disable-shared --disable-nls    i386-pc-linux-gnu

I'm sure you'll still need to set -march=i386.

Offline

#3 2005-03-08 20:14:28

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Cross compiler in Arch.

looks like you are just using the pkgbuild. I am trying to use the source from gnu.org, clean.
Also, you are not building a bootstrap compiler, you are using the libs pre-existing on the system, not compiling new target libs..

I will give the pkgbuild a try. Maybe the patches to the gcc source are required for a successful compile.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#4 2005-03-09 05:11:26

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: Cross compiler in Arch.

Well, I only meant to show that putting the i386-pc-linux-gnu on the end gets you a 386 gcc with proper -march.

Do you want to build a static gcc? 
For gcc 3.4.3 you can do it with:

make BOOT_LDFLAGS="-static" bootstrap

The --enable/disable-static affects whether libgcc/etc is static or shared, not gcc itself.

I mostly used the LFS method to build a uclibc based system.

Offline

#5 2005-03-09 06:00:05

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Cross compiler in Arch.

hmmm...so you put it at the end without any flags?
I have been using the --target and --prefix flags to get it put in a certain place, but none of the dox I have read mentioned that part at the end...
hmmm


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#6 2005-03-09 12:05:47

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: Cross compiler in Arch.

It is strange.  The target/host/build stuff never did what I expected and seemed only useful for real cross compiling (eg i686 to ARM).  Strangely a lot of configure scripts *know* their building with a cross-compiler but fail when they can't execute "foreign" test binaries.  Talk about stupid... "I'm failing cause I can't run this uclibc-based binary on a glibc system, duh!".

I think what the last arg gets you is the arg value in certain paths:

/usr/bin/i686-pc-linux-gnu-gcc-3.4.3
/usr/include/c++/3.4.3/i686-pc-linux-gnu/*
/usr/lib/gcc/i686-pc-linux-gnu/*
...blah...blah...

Offline

#7 2005-03-09 23:20:40

DanEE
Member
From: Fribourg, Switzerland
Registered: 2003-07-10
Posts: 43

Re: Cross compiler in Arch.

I compiled once quite a long time ago (one year or more I think the most actual gcc was 3.3 back then) a gcc build for the GameBoy Advanced (ARM-cpu... as far as I know) according to this tutorial:

http://linux.gbadev.org/gcc-gba/

It was using a quite outdated gcc version (3.0.4) but as far as I can remember it all compiled well and I had a working GameBoy-Compiler with which I could create some simple programs for an GBA-emulator.

It isn't really the thing you were looking for, but maybe it helps anyway

Offline

#8 2005-03-26 16:05:11

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: Cross compiler in Arch.

I made a tigcc (http://tigcc.ticalc.org) package, and it works fine. I just used its built in install scripts, but if you pick them apart, you should be able to find out how it's done.


The suggestion box only accepts patches.

Offline

#9 2007-05-05 13:44:12

belhifet
Member
Registered: 2007-04-17
Posts: 39

Re: Cross compiler in Arch.

Bump!

cactus, where you able to do it with https://www6.software.ibm.com/developer … ss-ltr.pdf ?

Anyway, anyone has done a crossdev script for Arch or anything like that?
Anyone that has done his own cross compiler?

I need some help here, I'm trying to cross compile on my x86 Arch for my ppc32.

Offline

#10 2007-05-05 14:29:26

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Cross compiler in Arch.

CLFS is around exactly for that purpose...

http://trac.cross-lfs.org/


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#11 2007-05-05 18:05:44

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Cross compiler in Arch.

@belhifet
It has been a long time since I messed with cross compile stuff. I lost my "exotic" hardware. heh heh heh.

@B
cool link B.

Someday I want to pick up an ultrasparc, and this will be very useful to try putting arch on it.
Thanks!


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#12 2007-05-21 15:19:59

shinlun
Member
From: Taipei, Taiwan
Registered: 2007-05-16
Posts: 61

Re: Cross compiler in Arch.

Actually building cross compiler is not that FUN tongue You might be interested in following links:
http://kegel.com/crosstool/
http://kegel.com/crosstool/crosstool-0.43/buildlogs/

Offline

#13 2007-05-21 22:20:22

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Cross compiler in Arch.


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

Board footer

Powered by FluxBB