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

Re: eglibc-2.11.3 cross-compile error



On Tue, Feb 14, 2012 at 12:50:52AM +0000, Edoardo Rossi wrote:
> Hi,
> 
> I'm trying to cross-compile eglibc-2.11.3 for PowerPC by using
> "powerpc-linux-gnu-gcc (Debian 4.4.5-8) 4.4.5". The reason I need to
> recompile the library is because I need to run the library on LInux 2.6.16
> hence to change the "--enable-linux" configuration option to that version.
> Unfortunately I encountered two problems:

You should be able to recompile it from the source package, using
dpkg-buildpackage -B -apowerpc. I will take care of all the needed
rules.

> 1) There should be a directory called "manual" which doesn't exists in the
> original eglibc-2.11.3 tarball

This directory has been removed as it contains non-free data according
to the Debian Free Software Guidelines.

> 2) The cross compile process stops with the following error:
> 
> make  subdir=sunrpc -C sunrpc ..=../ others
> make[2]: Entering directory `/usr/src/glibc/eglibc-2.11.3/sunrpc'
> powerpc-linux-gnu-gcc -nostdlib -nostartfiles -o
> /usr/src/glibc/build/sunrpc/rpcgen
>  -Wl,-dynamic-linker=/usr/local/lib/glibc-testing/lib/ld.so.1
> -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
> /usr/src/glibc/build/csu/crt1.o /usr/src/glibc/build/csu/crti.o
> `powerpc-linux-gnu-gcc --print-file-name=crtbegin.o`
> /usr/src/glibc/build/sunrpc/rpc_main.o
> /usr/src/glibc/build/sunrpc/rpc_hout.o
> /usr/src/glibc/build/sunrpc/rpc_cout.o
> /usr/src/glibc/build/sunrpc/rpc_parse.o
> /usr/src/glibc/build/sunrpc/rpc_scan.o
> /usr/src/glibc/build/sunrpc/rpc_util.o
> /usr/src/glibc/build/sunrpc/rpc_svcout.o
> /usr/src/glibc/build/sunrpc/rpc_clntout.o
> /usr/src/glibc/build/sunrpc/rpc_tblout.o
> /usr/src/glibc/build/sunrpc/rpc_sample.o
>  -Wl,-rpath-link=/usr/src/glibc/build:/usr/src/glibc/build/math:/usr/src/glibc/build/elf:/usr/src/glibc/build/dlfcn:/usr/src/glibc/build/nss:/usr/src/glibc/build/nis:/usr/src/glibc/build/rt:/usr/src/glibc/build/resolv:/usr/src/glibc/build/crypt:/usr/src/glibc/build/nptl
> /usr/src/glibc/build/libc.so.6 /usr/src/glibc/build/libc_nonshared.a -lgcc
> -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `powerpc-linux-gnu-gcc
> --print-file-name=crtend.o` /usr/src/glibc/build/csu/crtn.o
> CPP='powerpc-linux-gnu-gcc -E -x c-header'
>  /usr/src/glibc/build/elf/ld.so.1 --library-path
> /usr/src/glibc/build:/usr/src/glibc/build/math:/usr/src/glibc/build/elf:/usr/src/glibc/build/dlfcn:/usr/src/glibc/build/nss:/usr/src/glibc/build/nis:/usr/src/glibc/build/rt:/usr/src/glibc/build/resolv:/usr/src/glibc/build/crypt:/usr/src/glibc/build/nptl
> /usr/src/glibc/build/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x
> -o /usr/src/glibc/build/sunrpc/xbootparam_prot.T
> /usr/src/glibc/build/elf/ld.so.1: 1: Syntax error: "(" unexpected
> make[2]: *** [/usr/src/glibc/build/sunrpc/xbootparam_prot.stmp] Error 2
> make[2]: Leaving directory `/usr/src/glibc/eglibc-2.11.3/sunrpc'
> make[1]: *** [sunrpc/others] Error 2
> make[1]: Leaving directory `/usr/src/glibc/eglibc-2.11.3'
> make: *** [all] Error 2

It looks like the glibc configure script hasn't detected you are doing a
cross-compilation. As a result, it tries to run elf/ld.so.1 which is a
powerpc binary, and can't work.

> --disable-profile --without-gd --without-cvs --with-tls
> --enable-kernel=2.6.16 --build=powerpc-unknown-linux-gnu --target=${MACH}
> 

You should use --host instead of --build to select the system you are
targeting. You can also specify --build but it should be detected
automatically. --target is not needed here.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: