[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patches] cross compiling eglibc



On Tue, Sep 4, 2012 at 11:55 PM, Joseph S. Myers
<joseph@xxxxxxxxxxxxxxxx> wrote:
> On Tue, 4 Sep 2012, Christer Solskogen wrote:
>
>> By static GCC do you mean GCC configured something like this:
>> --enable-languages=c --disable-multilib --disable-nls
>> --without-headers --with-newlib --disable-shared --disable-threads
>> --disable-libssp --disable-libgomp --disable-libmudflap
>> --disable-decimal-float --disable-libquadmath. At least, that is what
>> I figured out is I what I need in order to create a simple GCC as
>> possible.
>
> Yes.
>

Almost :-) GCC 4.8 added something called libatomic. I had to add
--disable-libatomic to GCC's configure line.
The master branch of glibc borkes on this:
make[2]: Entering directory `/storage/home/solskogen/src/lib/libc/resolv'
sparc-centix-linux-gnu-gcc   -shared -static-libgcc -Wl,-O1
-Wl,-z,defs -Wl,-dynamic-linker=/lib/ld-linux.so.2
-B/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/csu/
-Wl,--version-script=/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/libresolv.map
-Wl,-soname=libresolv.so.2 -Wl,-z,combreloc -Wl,-z,relro
-Wl,--hash-style=both
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/math
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/elf
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/dlfcn
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/nss
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/nis
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/rt
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/crypt
-L/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/nptl
-Wl,-rpath-link=/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/math:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/elf:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/dlfcn:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/nss:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/nis:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/rt:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/crypt:/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/nptl
-o /home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv/libresolv.so
-T /home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/shlib.lds
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/csu/abi-note.o
-Wl,--whole-archive
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv/libresolv_pic.a
-Wl,--no-whole-archive
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/elf/interp.os
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/libc.so
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/libc_nonshared.a
-Wl,--as-needed
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/elf/ld.so
-Wl,--no-as-needed
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv/libresolv_pic.a(gethnamaddr.os):
In function `getanswer':
gethnamaddr.c:(.text+0x8b8): undefined reference to `__stack_chk_guard'
gethnamaddr.c:(.text+0x8c0): undefined reference to `__stack_chk_guard'
gethnamaddr.c:(.text+0x8c8): undefined reference to `__stack_chk_guard'
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv/libresolv_pic.a(gethnamaddr.os):
In function `__GI_res_gethostbyname2':
gethnamaddr.c:(.text+0x11fc): undefined reference to `__stack_chk_guard'
gethnamaddr.c:(.text+0x1204): undefined reference to `__stack_chk_guard'
/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv/libresolv_pic.a(gethnamaddr.os):gethnamaddr.c:(.text+0x120c):
more undefined references to `__stack_chk_guard' follow
collect2: error: ld returned 1 exit status
make[2]: *** [/home/solskogen/obj/_build/libc.sparc-centix-linux-gnu/resolv/libresolv.so]
Error 1
make[2]: Leaving directory `/storage/home/solskogen/src/lib/libc/resolv'
make[1]: *** [resolv/others] Error 2
make[1]: Leaving directory `/storage/home/solskogen/src/lib/libc'
make: *** [all] Error 2

The procedure was: binutils->gcc->linux headers->glibc
glibc was configured like this: --prefix=/usr
--with-headers=${TARGET_ROOT}/usr/include --enable-kernel=2.6.32
--host=${TARGET} --build=$(${SRCDIR}/lib/libc/scripts/config.guess)

But this discussion should probably move to glibc's mailinglist.
-- 
chs,
_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches