O GCC 5.1.0 não é compilado após o guia LFS - passar 2; ligando erros?

0

Estou tentando seguir o guia do LFS para compilar o GCC 5.1 com binutils 5.25 e glibc 2.21 e o processo falha ao atingir a etapa "gcc pass 2", me dando o erro:

ld: /tools/lib/../lib64/libstdc++.a(new_opv.o): relocation R_X86_64_32 against '_ZTISt9bad_alloc' can not be used when making a shared object; recompile with -fPIC
/tools/lib/../lib64/libstdc++.a: error adding symbols: Bad value

Eu tentei dar a opção -fPIC , mas isso não ajuda.

Minhas opções de configuração são as seguintes:

CC=$LFS_TGT-gcc
CXX=$LFS_TGT-g++
AR=$LFS_TGT-ar
RANLIB=$LFS_TGT-ranlib
../gcc-5.1.0/configure \
--prefix=/tools \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--enable-languages=c,c++ \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-bootstrap \
--disable-libgomp

A mensagem de erro inteira é:

libtool: link: x86_64-peal-linux-gnu-g++  -fPIC -DPIC -shared -nostdlib /home/system/peal/system/system/toolchain/tools/lib/../lib64/crti.o /home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/crtbeginS.o  .libs/findcomp.o .libs/libcc1.o .libs/names.o .libs/callbacks.o .libs/connection.o .libs/marshall.o   -L/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0 -L/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc -L/home/system/peal/system/system/toolchain/tools/lib/../lib64 -L/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/../../../../x86_64-peal-linux-gnu/lib -L/home/system/peal/system/system/toolchain/tools/lib /tools/lib/../lib64/libstdc++.a -lm -lc -lgcc /home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/crtendS.o /home/system/peal/system/system/toolchain/tools/lib/../lib64/crtn.o  -static-libstdc++ -static-libgcc ../libiberty/pic/libiberty.a   -Wl,-soname -Wl,libcc1.so.0 -Wl,-retain-symbols-file -Wl,../../gcc-5.1.0/libcc1/libcc1.sym -o .libs/libcc1.so.0.0.0
/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/../../../../x86_64-peal-linux-gnu/bin/ld: /tools/lib/../lib64/libstdc++.a(new_opv.o): relocation R_X86_64_32 against '_ZTISt9bad_alloc' can not be used when making a shared object; recompile with -fPIC
/tools/lib/../lib64/libstdc++.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:409: recipe for target 'libcc1.la' failed
make[3]: *** [libcc1.la] Error 1
make[3]: Leaving directory '/home/system/peal/system/system/toolchain/sources/gcc-build/libcc1'
Makefile:291: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/system/peal/system/system/toolchain/sources/gcc-build/libcc1'
Makefile:10639: recipe for target 'all-libcc1' failed
make[1]: *** [all-libcc1] Error 2
make[1]: Leaving directory '/home/system/peal/system/system/toolchain/sources/gcc-build'
Makefile:880: recipe for target 'all' failed
make: *** [all] Error 2

Caso isso ajude, as variáveis LFS* são estas:

LFS=/home/system/peal/system/system/toolchain
LFS_TGT=x86_64-peal-linux-gnu

Meu servidor de compilação é baseado no Ubuntu 16.04 (gcc 5.3) atualizado diariamente.

Aqui estão mais alguns detalhes sobre o conjunto de ferramentas:

me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ gcc --version
gcc (GCC) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ g++ --version
g++ (GCC) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ ld --version
GNU ld (GNU Binutils) 2.25.90.20151209
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ ldd --version
ldd (GNU libc) 2.21
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which ld
/tools/bin/ld
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which ldd
/tools/bin/ldd
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which gcc
/tools/bin/gcc
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which g++
/tools/bin/g++

Alguma idéia?

Obrigado!

    
por emmerich 05.04.2016 / 14:37

1 resposta

1

Eu encontrei o (s) problema (s):

  • como Munir, eu tinha sh apontando para dash em vez de bash ;
  • depois disso, gcc falhou ao compilar devido ao cabeçalho rpc/xdr.h ausente; isso foi corrigido reconstruindo o glibc adicionando o sinalizador: --enable-obsolete-rpc ;

Tudo está bem agora.

    
por 07.04.2016 / 08:27