try to compile cross compilers for sparc,alpha and powerpc + glibc 2.22

Dennis Luehring dl.soluz@gmx.net
Fri Aug 28 18:52:00 GMT 2015


my cross compile suite build test results

--------------------------------------------------------------------------------

aarch64-linux: cross combile suite builds complete

--------------------------------------------------------------------------------

alpha-linux: cross combile suite builds complete

--------------------------------------------------------------------------------

sparc-linux: glibc compile error

sparc-linux-gcc sem_getvalue.c -c -std=gnu99 -fgnu89-inline  -O2 -Wall 
-Werror -Wno-error=undef -Wundef -Wwrite-strings -fmerge-all-constants 
-frounding-math -g -Wstrict-prototypes -mlong-double-128  -fPIC   
-ftls-model=initial-exec -I../include 
-I/home/bert/Downloads/build-glibc/nptl 
-I/home/bert/Downloads/build-glibc 
-I../sysdeps/unix/sysv/linux/sparc/sparc32/fpu 
-I../sysdeps/sparc/sparc32/fpu 
-I../sysdeps/unix/sysv/linux/sparc/sparc32 
-I../sysdeps/ieee754/ldbl-64-128  -I../sysdeps/ieee754/ldbl-opt 
-I../sysdeps/unix/sysv/linux/sparc  -I../sysdeps/sparc/nptl 
-I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux 
-I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu 
-I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix 
-I../sysdeps/posix  -I../sysdeps/sparc/sparc32 -I../sysdeps/wordsize-32  
-I../sysdeps/ieee754/ldbl-128 -I../sysdeps/ieee754/dbl-64  
-I../sysdeps/ieee754/flt-32 -I../sysdeps/sparc/sparc32/soft-fp  
-I../sysdeps/sparc/fpu -I../sysdeps/sparc  -I../sysdeps/ieee754  
-I../sysdeps/generic -I.. -I../libio -I. -nostdinc -isystem 
/opt/cross/lib/gcc/sparc-linux/4.9.2/include -isystem 
/opt/cross/lib/gcc/sparc-linux/4.9.2/include-fixed -isystem 
/opt/cross/sparc-linux/include  -D_LIBC_REENTRANT -include 
/home/bert/Downloads/build-glibc/libc-modules.h -DMODULE_NAME=libpthread 
-include ../include/libc-symbols.h  -DPIC -DSHARED     -o 
/home/bert/Downloads/build-glibc/nptl/sem_getvalue.os -MD -MP -MF 
/home/bert/Downloads/build-glibc/nptl/sem_getvalue.os.dt -MT 
/home/bert/Downloads/build-glibc/nptl/sem_getvalue.os
../sysdeps/sparc/sparc32/sem_open.c: In function ‘sem_open’:
../sysdeps/sparc/sparc32/sem_open.c:202:28: error: ‘FUTEX_SHARED’ 
undeclared (first use in this function)
        sem.newsem.private = FUTEX_SHARED;
                             ^
../sysdeps/sparc/sparc32/sem_open.c:202:28: note: each undeclared 
identifier is reported only once for each function it appears in
/home/bert/Downloads/build-glibc/sysd-rules:1571: recipe for target 
'/home/bert/Downloads/build-glibc/nptl/sem_open.os' failed
make[2]: *** [/home/bert/Downloads/build-glibc/nptl/sem_open.os] Error 1
make[2]: *** Waiting for unfinished jobs....

--------------------------------------------------------------------------------

powerpc-linux: build-glibc

powerpc-linux-gcc   -shared -static-libgcc -Wl,-O1 -mhard-float 
-Wl,-z,defs -Wl,-dynamic-linker=/opt/cross/powerpc-linux/lib/ld.so.1 
-B/home/bert/Downloads/build-glibc/csu/ 
-Wl,--version-script=/home/bert/Downloads/build-glibc/libresolv.map 
-Wl,-soname=libresolv.so.2 -Wl,-z,combreloc -Wl,-z,relro 
-Wl,--hash-style=both  -L/home/bert/Downloads/build-glibc 
-L/home/bert/Downloads/build-glibc/math 
-L/home/bert/Downloads/build-glibc/elf 
-L/home/bert/Downloads/build-glibc/dlfcn 
-L/home/bert/Downloads/build-glibc/nss 
-L/home/bert/Downloads/build-glibc/nis 
-L/home/bert/Downloads/build-glibc/rt 
-L/home/bert/Downloads/build-glibc/resolv 
-L/home/bert/Downloads/build-glibc/crypt 
-L/home/bert/Downloads/build-glibc/mathvec 
-L/home/bert/Downloads/build-glibc/nptl 
-Wl,-rpath-link=/home/bert/Downloads/build-glibc:/home/bert/Downloads/build-glibc/math:/home/bert/Downloads/build-glibc/elf:/home/bert/Downloads/build-glibc/dlfcn:/home/bert/Downloads/build-glibc/nss:/home/bert/Downloads/build-glibc/nis:/home/bert/Downloads/build-glibc/rt:/home/bert/Downloads/build-glibc/resolv:/home/bert/Downloads/build-glibc/crypt:/home/bert/Downloads/build-glibc/mathvec:/home/bert/Downloads/build-glibc/nptl 
-o /home/bert/Downloads/build-glibc/resolv/libresolv.so -T 
/home/bert/Downloads/build-glibc/shlib.lds 
/home/bert/Downloads/build-glibc/csu/abi-note.o -Wl,--whole-archive 
/home/bert/Downloads/build-glibc/resolv/libresolv_pic.a 
-Wl,--no-whole-archive  -Wl,--start-group 
/home/bert/Downloads/build-glibc/libc.so 
/home/bert/Downloads/build-glibc/libc_nonshared.a -Wl,--as-needed 
/home/bert/Downloads/build-glibc/elf/ld.so -Wl,--no-as-needed 
-Wl,--end-group
/home/bert/Downloads/build-glibc/resolv/libresolv_pic.a(ns_print.os): In 
function `__GI_ns_sprintrrf':
/home/bert/Downloads/glibc-2.22/resolv/ns_print.c:99: undefined 
reference to `__stack_chk_guard'
/home/bert/Downloads/build-glibc/resolv/libresolv_pic.a(gethnamaddr.os): 
In function `getanswer':
/home/bert/Downloads/glibc-2.22/resolv/gethnamaddr.c:185: undefined 
reference to `__stack_chk_guard'
/home/bert/Downloads/build-glibc/resolv/libresolv_pic.a(gethnamaddr.os): 
In function `__GI_res_gethostbyname2':
/home/bert/Downloads/glibc-2.22/resolv/gethnamaddr.c:510: undefined 
reference to `__stack_chk_guard'
/home/bert/Downloads/build-glibc/resolv/libresolv_pic.a(gethnamaddr.os): 
In function `res_gethostbyaddr':
/home/bert/Downloads/glibc-2.22/resolv/gethnamaddr.c:644: undefined 
reference to `__stack_chk_guard'
/home/bert/Downloads/build-glibc/resolv/libresolv_pic.a(res_debug.os): 
In function `__GI___p_cdnname':
/home/bert/Downloads/glibc-2.22/resolv/res_debug.c:287: undefined 
reference to `__stack_chk_guard'
/home/bert/Downloads/build-glibc/resolv/libresolv_pic.a(res_debug.os):/home/bert/Downloads/glibc-2.22/resolv/res_debug.c:334: 
more undefined references to `__stack_chk_guard' follow
collect2: error: ld returned 1 exit status
../Makerules:517: recipe for target 
'/home/bert/Downloads/build-glibc/resolv/libresolv.so' failed
make[2]: *** [/home/bert/Downloads/build-glibc/resolv/libresolv.so] Error 1
make[2]: *** Waiting for unfinished jobs....

--------------------------------------------------------------------------------


Am 28.08.2015 um 19:21 schrieb Mike Frysinger:
> On 28 Aug 2015 15:17, Dennis Luehring wrote:
> > based on the briliant tutorial by Jeff Preshing
> > http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
> >
> > and his all-in-one-wonder shellscript:
> > https://gist.github.com/preshing/41d5c7248dea16238b60
> > (the questions uses this script+line numbers as orientation)
>
> i'd strongly suggest using a project like crosstool:
> 	http://crosstool-ng.org/
> it takes care of many many problems that people are likely to run into.
> building things by hand nowadays is really only for people who want to
> learn and fix things themselves.
>
> > while compiling glibc with sparc-linux-gcc the make process throws this
> > error
> >
> > ../sysdeps/unix/sysv/linux/sparc/sys/trap.h:5:23: fatal error:
> > asm/traps.h: No such file or directory
> >
> > i've checked my /opt/cross/sparc-linux/include/asm/ and there is no traps.h
>
> sounds like your kernel and/or install is broken.  newer versions def
> install that header, and my cross-compiles continue to work.  i have
> linux-4.1 and glibc-2.22.
>
> > then i've checked the kernel Kbuilds for the headers_install and found
> > that the traps.h export is only in the v2.6.x branch
>
> you're looking in the wrong place.  the kernel split apart internal and
> external headers into uapi/ subdirs.  it's clearly listed in the uapi
> dir: include/uapi/asm/Kbuild.
> -mike



More information about the Libc-help mailing list