This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i686 to c3-2 crosstool build fails on setjmp


Simon Poole wrote:
I'm currently toying with taking advantage of the GCC -march=c3-2 option to correctly target one of our builds for the VIA C3-2.

Building crosstool-0.28-rc37 fails during the main Glibc build at setjmp.S.

I'm building with the following parameters on an i686-pc-linux-gnu build box:

BINUTILS_DIR=binutils-2.15
GCC_DIR=gcc-3.4.2
GLIBC_DIR=glibc-2.3.3
LINUX_DIR=linux-2.4.25
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.3
GCC_LANGUAGES="c,c++"
TARGET_CFLAGS="-O"
TARGET=i686-c3_2-linux-gnu
GCC_EXTRA_CONFIG=--with-arch=c3-2 --enable-cxx-flags=-march=c3-2

The failure looks like this:

../sysdeps/i386/elf/setjmp.S: Assembler messages:
../sysdeps/i386/elf/setjmp.S:63: Error: junk at end of line, first unrecognized character is `1'

That looks a lot like you've run into a preprocessor symbol clash. Line 63 of setjmp.S (in my copy, anyway) is

        .section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits
and you can easily imagine __i686 being defined to 1!

Any advice on what steps to take?
* Have I done something wrong with my build setup?
* Should I be digging for a bug in GCC/glibc/binutils?
* Should I be using different package versions?
* Should I just forget about trying to cross-compile from i686 to c3-2?

#2: dig for a bug, but a minor one: probably just an unhappy choice of symbol names that is easily fixed.

What I do in these cases is copy the crucial lines from the build
log into a three line shell script (export PATH=...; cd ...; the-gcc-command-that-failed ...)
and verify that running that script reproduces the problem quickly and exactly.
Then I do something like -save-temps, and compare the preprocessed
sources (setjmp.s) with the original source (setjmp.S).

Here's a patch I apply to fix a similar problem with sparc;
this has been fixed in glibc mainline now, I think, but similar
problems might lurk.
http://kegel.com/crosstool/crosstool-0.28-rc36/patches/glibc-2.3.2/glibc-2.3.2-sparc32-sysdep.patch

See similar situation
http://sources.redhat.com/ml/crossgcc/2004-06/msg00049.html
though that fellow didn't seem to follow through.

- Dan

--
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]