http://bugzilla.novell.com/show_bug.cgi?id=936463
http://bugzilla.novell.com/show_bug.cgi?id=936463#c17
--- Comment #17 from Richard Biener
Do I understand correctly, that we need a multi-stage cross build for the standard cross platform:
1) Native compiler. 2) Cross binutils. 3) Cross compiler stage 1. It can compile and link with -nostd*. 4) Cross glibc. 5) Cross compiler final. It can compile and link against glibc (either with -isystem or even without, depending on configuration).
As far as I understand, we are now trying to provide stage 1 compilers. It should already be able to link, otherwise cross-glibc could not be built.
Note that for glibc you need two stages as well - the first stage using 3) which cannot link yet just "compiles" the glibc headers (thus, runs the configury). With those headers you can build the "true" stage1 GCC including target libraries. Usually other libcs do not have to jump through this extra hoop.
Here is my question:
Could stage 1 compiler work without libgcc.a, or it will need an intermediate libgcc.a? If stage 1 is intended to work without libgcc.a, what about e. g. __divmodhi4 and similar, reference to which could be generated by compiler?
Usually you can't link with the stage1 GCC if that couldn't build target libraries because target headers were not available.
Note that AVR (maybe except 32-bit AVR) is a bit special case.
It is a very small platform (8-bit), and it cannot host glibc, so there will not be cross-avr-glibc-devel. There will be no shared libraries as output.
But there is a project called avr-libc in CrossToolchain:avr, which just needs to be modified to work with gcc5 (and create some compatibility wrapers like "avr-gcc").
Maybe AVR will be needed two stage build, but maybe not.AVR libgcc.a needs to contain just a few functions that compiler generates, e. g. __divmodhi4.
I'm not sure either. Note that if you already have a avr-libc then you don't need to "bootstrap" but can just build-require it.
My tests:
- As it is, linking code compiled (with some effort) with gcc5+avr-libc fails on missing symbol __divmodhi4 (not sure whether it was referenced in the code or avr-libc code).
- I successfully built AVR libgcc.a somehow yesterday just by "make all-target" and got this problem away, but I am failing today:
In file included from /usr/include/bits/time.h:88:0, from /usr/include/time.h:41, from /usr/include/pthread.h:24, from ./gthr-default.h:35, from ../../../../libgcc/gthr.h:148, from ../../../../libgcc/unwind-dw2.c:37: /usr/include/bits/timex.h:50:3: error: width of '<anonymous>' exceeds its type int :32; int :32; int :32; int :32; ... ../../../../libgcc/static-object.mk:17: recipe for target 'unwind-dw2.o' failed
I am not sure, whether it is a problem that should go away with fix in the comment 1. (avr-libc has no pthread.h, so it can never compile there).
It depends on how you configure GCC. With the gcc_iceream "hack" we use the host libc headers(!) to configure the target libraries. That mostly works for all SUSE host/target combinations but very likely fails for avr (watch for the --with-build-sysroot=/ configure option to GCC). -- You are receiving this mail because: You are on the CC list for the bug.