You are not logged in.

#1 2015-06-07 04:44:29

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Unable to build glibc

Glibc consistently fails at this point:

checking for .preinit_array/.init_array/.fini_array support... no
configure: error: Need linker with .init_array/.fini_array support.

Both ABS and AUR (git) versions fail in the same place.

I have tried to compile both native (64bit) and lib32 packages.

I have tried this with both ABS and AUR (git) versions of binutils.

I have tried with and without LTO (someone was getting that error related to LTO, but not my case).

I have tried to use the standard linker, ld.bfd but my system seems fixated on ld.gold (even when lto is disabled). My choice of linker is not recognized, and I cannot fathom why ld.gold seems to be default; it would seem I have no say in the matter. In either case, ld.gold should not cause these problems.

I even tried commenting out the error thrown by this section of the configure script (in case the test itself is broken) but the next test also failed:

checking for .preinit_array/.init_array/.fini_array support... no
checking whether to use .ctors/.dtors header and trailer... configure: error: missing __attribute__ ((constructor)) support??

What in the world?

Last edited by quequotion (2015-06-07 05:00:10)

Offline

#2 2015-06-07 05:57:11

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Unable to build glibc

Builds fine here. Can you show us the whole configuration log?

--edit:

Are you using any custom {C, CPP, CXX, MAKE}FLAGS?

Last edited by mauritiusdadd (2015-06-07 05:59:12)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2015-06-07 06:21:58

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: Unable to build glibc

mauritiusdadd wrote:

Builds fine here. Can you show us the whole configuration log?

Have at it! This log is from a lib32-glibc attempt. There's something seriously weird going on here: "Configured with" shows a configure script and options that are from another package, my custom version for mmug, which are in a completely different directory than this and are not involved in this compilation attempt by any action on my part.

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ /var/tmp/yaourt-tmp-quequotion/abs-lib32-glibc/src/glibc-2.21/configure --prefix=/usr --libdir=/usr/lib32 --libexecdir=/usr/lib32 --with-headers=/usr/include --with-bugurl=https://bugs.archlinux.org/ --enable-add-ons --enable-obsolete-rpc --enable-kernel=2.6.32 --enable-bind-now --disable-profile --enable-stackguard-randomization --enable-lock-elision --enable-multi-arch --disable-werror i686-unknown-linux-gnu

## --------- ##
## Platform. ##
## --------- ##

hostname = Shiroko
uname -m = x86_64
uname -r = 3.19.2-1-ck
uname -s = Linux
uname -v = #1 SMP PREEMPT Sun Mar 22 18:29:25 JST 2015

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/lib/hardening-wrapper/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /usr/lib/jvm/default/bin
PATH: /usr/bin/site_perl
PATH: /usr/bin/vendor_perl
PATH: /usr/bin/core_perl


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2365: checking build system type
configure:2379: result: i686-unknown-linux-gnu
configure:2399: checking host system type
configure:2412: result: i686-unknown-linux-gnu
configure:2441: checking for i686-unknown-linux-gnu-gcc
configure:2468: result: gcc -m32
configure:2737: checking for C compiler version
configure:2746: gcc -m32 --version >&5
gcc (GCC) 6.0.138346.359bd42 20150510 (experimental)
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.

configure:2757: $? = 0
configure:2746: gcc -m32 -v >&5
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/6.0.138346.359bd42/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/quequotion/Sources/AUR/COLLECTIONS/mmug-qq/gcc-multilib-trunk-git/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,lto,objc,obj-c++ --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-linker-build-id --enable-checking=release --enable-install-libiberty --enable-cloog-backend=isl --enable-gnu-unique-object --enable-__cxa_atexit --with-system-zlib --with-linker-hash-style=gnu --disable-libunwind-exceptions --disable-libstdcxx-pch --disable-libssp --enable-multilib --disable-werror --enable-lto --enable-plugin --with-plugin-ld=/usr/bin/ld.gold
Thread model: posix
gcc version 6.0.138346.359bd42 20150510 (experimental) (GCC) 
configure:2757: $? = 0
configure:2746: gcc -m32 -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2757: $? = 1
configure:2746: gcc -m32 -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2757: $? = 1
configure:2762: checking for suffix of object files
configure:2784: gcc -m32 -c -pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs  -O3 conftest.c >&5
configure:2788: $? = 0
configure:2809: result: o
configure:2813: checking whether we are using the GNU C compiler
configure:2832: gcc -m32 -c -pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs  -O3 conftest.c >&5
configure:2832: $? = 0
configure:2841: result: yes
configure:2850: checking whether gcc -m32 accepts -g
configure:2870: gcc -m32 -c -g  -O3 conftest.c >&5
configure:2870: $? = 0
configure:2911: result: yes
configure:3101: checking for C++ compiler version
configure:3110: g++ -m32 --version >&5
g++ (GCC) 6.0.138346.359bd42 20150510 (experimental)
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.

configure:3121: $? = 0
configure:3110: g++ -m32 -v >&5
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/6.0.138346.359bd42/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/quequotion/Sources/AUR/COLLECTIONS/mmug-qq/gcc-multilib-trunk-git/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,lto,objc,obj-c++ --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-linker-build-id --enable-checking=release --enable-install-libiberty --enable-cloog-backend=isl --enable-gnu-unique-object --enable-__cxa_atexit --with-system-zlib --with-linker-hash-style=gnu --disable-libunwind-exceptions --disable-libstdcxx-pch --disable-libssp --enable-multilib --disable-werror --enable-lto --enable-plugin --with-plugin-ld=/usr/bin/ld.gold
Thread model: posix
gcc version 6.0.138346.359bd42 20150510 (experimental) (GCC) 
configure:3121: $? = 0
configure:3110: g++ -m32 -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3121: $? = 1
configure:3110: g++ -m32 -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:3121: $? = 1
configure:3125: checking whether we are using the GNU C++ compiler
configure:3144: g++ -m32 -c -pipe -march=native -O3 -fstack-protector-strong -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w      -O3 conftest.cpp >&5
configure:3144: $? = 0
configure:3153: result: yes
configure:3162: checking whether g++ -m32 accepts -g
configure:3182: g++ -m32 -c -g  -O3 conftest.cpp >&5
configure:3182: $? = 0
configure:3223: result: yes
configure:3249: checking for i686-unknown-linux-gnu-readelf
configure:3279: result: no
configure:3289: checking for readelf
configure:3305: found /usr/bin/readelf
configure:3316: result: readelf
configure:3780: checking for sysdeps preconfigure fragments
configure:3787: result: 
configure:3861: running configure fragment for add-on libidn
configure:3961: checking for assembler and linker STT_GNU_IFUNC support

Relocation section '.rel.plt' at offset 0xf8 contains 1 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
0804a000  0000002a R_386_IRELATIVE  
configure:3992: result: yes
configure:3995: checking whether .text pseudo-op must be used
configure:4005: gcc -m32  -c conftest.s 1>&5
configure:4008: $? = 0
configure:4019: result: yes
configure:4038: checking sysdep dirs
configure:4258: result: sysdeps/generic
configure:4335: checking for a BSD-compatible install
configure:4403: result: /usr/bin/install -c
configure:4418: checking whether ln -s works
configure:4422: result: yes
configure:4446: checking whether as is GNU as
configure:4460: result: yes
configure:4465: checking whether /usr/lib/hardening-wrapper/bin/ld is GNU ld
configure:4479: result: yes
configure:4489: checking for as
configure:4516: result: as
configure:4531: checking version of as
configure:4541: result: 2.25.51.20150606, ok
configure:4552: checking for /usr/lib/hardening-wrapper/bin/ld
configure:4579: result: /usr/lib/hardening-wrapper/bin/ld
configure:4594: checking version of /usr/lib/hardening-wrapper/bin/ld
configure:4604: result: 2.25.51.20150606, ok
configure:4618: checking for gnumake
configure:4648: result: no
configure:4618: checking for gmake
configure:4648: result: no
configure:4618: checking for make
configure:4634: found /usr/bin/make
configure:4645: result: make
configure:4660: checking version of make
configure:4670: result: 4.1, ok
configure:4682: checking for gnumsgfmt
configure:4712: result: no
configure:4682: checking for gmsgfmt
configure:4712: result: no
configure:4682: checking for msgfmt
configure:4698: found /usr/bin/msgfmt
configure:4709: result: msgfmt
configure:4724: checking version of msgfmt
configure:4734: result: 0.19.4, ok
configure:4745: checking for makeinfo
configure:4761: found /usr/bin/makeinfo
configure:4772: result: makeinfo
configure:4787: checking version of makeinfo
configure:4797: result: 5.2, ok
configure:4808: checking for sed
configure:4824: found /usr/bin/sed
configure:4835: result: sed
configure:4850: checking version of sed
configure:4860: result: 4.2.2, ok
configure:4871: checking for gawk
configure:4887: found /usr/bin/gawk
configure:4898: result: gawk
configure:4913: checking version of gawk
configure:4923: result: 4.1.3, ok
configure:4931: checking if gcc -m32 is sufficient to build libc
configure:4951: gcc -m32 -c -pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs  -O3 conftest.c >&5
configure:4951: $? = 0
configure:4958: result: yes
configure:4967: checking for i686-unknown-linux-gnu-nm
configure:4997: result: no
configure:5007: checking for nm
configure:5023: found /usr/bin/nm
configure:5034: result: nm
configure:5170: checking LD_LIBRARY_PATH variable
configure:5180: result: ok
configure:5189: checking whether GCC supports -static-libgcc
configure:5200: result: -static-libgcc
configure:5206: checking for bash
configure:5224: found /usr/bin/bash
configure:5237: result: /usr/bin/bash
configure:5248: checking for perl
configure:5266: found /usr/bin/perl
configure:5279: result: /usr/bin/perl
configure:5293: checking for install-info
configure:5312: found /usr/bin/install-info
configure:5325: result: /usr/bin/install-info
configure:5337: checking for bison
configure:5353: found /usr/bin/bison
configure:5364: result: bison
configure:5379: checking version of bison
configure:5389: result: 3.0.4, ok
configure:5397: checking for libc-friendly stddef.h
configure:5421: gcc -m32 -c -pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs  -O3 conftest.c >&5
configure:5421: $? = 0
configure:5428: result: yes
configure:5435: checking whether we need to use -P to assemble .S files
configure:5445: gcc -m32  -O3  -c conftest.S 1>&5
configure:5448: $? = 0
configure:5456: result: no
configure:5463: checking for .set assembler directive
/tmp/ccJ7afrP.o:conftest1.c:function _start: error: undefined reference to '__stack_chk_fail'
collect2: error: ld returned 1 exit status
configure:5489: result: no
configure:5496: checking for assembler gnu_unique_object symbol type
configure:5513: result: yes
configure:5520: checking for .previous assembler directive
configure:5530: gcc -m32 -c  conftest.s 1>&5
configure:5533: $? = 0
configure:5541: result: yes
configure:5575: checking for .protected and .hidden assembler directive
configure:5587: gcc -m32 -c  conftest.s 1>&5
configure:5590: $? = 0
configure:5598: result: yes
configure:5602: checking whether __attribute__((visibility())) is supported
configure:5613: gcc -m32 -Werror -S conftest.c -o conftest.s 1>&5
configure:5616: $? = 0
configure:5627: result: yes
configure:5635: checking for broken __attribute__((visibility()))
configure:5647: gcc -m32 -Werror -S conftest.c -o conftest.s 1>&5
configure:5650: $? = 0
configure:5659: result: no
configure:5666: checking for broken __attribute__((alias()))
configure:5681: gcc -m32 -Werror -S conftest.c -o conftest.s 1>&5
configure:5684: $? = 0
configure:5694: result: no
configure:5701: checking whether to put _rtld_local into .sdata section
configure:5715: result: no
configure:5723: checking for .preinit_array/.init_array/.fini_array support
configure:5739: gcc -m32 -pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs  -O3 -Wl,-O4,--sort-common,--as-needed,-z,relro    -o conftest
		       conftest.c -static -nostartfiles -nostdlib
		       1>&5
/tmp/ccBhbsPI.o:conftest.c:function foo: error: undefined reference to '__stack_chk_fail'
/tmp/ccBhbsPI.o:conftest.c:function _start: error: undefined reference to '__stack_chk_fail'
/tmp/ccBhbsPI.o:conftest.c:function __start: error: undefined reference to '__stack_chk_fail'
collect2: error: ld returned 1 exit status
configure:5742: $? = 1
configure:5755: result: no
configure:5761: checking whether to use .ctors/.dtors header and trailer
configure:5778: gcc -m32 -pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs  -O3 -Wl,-O4,--sort-common,--as-needed,-z,relro    -o conftest
		       conftest.c -static -nostartfiles -nostdlib
		       1>&5
conftest.c:4:2: error: invalid preprocessing directive #__attribute__
 #__attribute__ ((constructor)) void ctor (void) { asm (""); }
  ^
conftest.c:5:2: error: invalid preprocessing directive #__attribute__
 #__attribute__ ((destructor))  void dtor (void) { asm (""); }
  ^
configure:5781: $? = 1
configure:5801: error: missing __attribute__ ((constructor)) support??

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value='gcc -m32'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=' -O3'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='-pipe -march=native -O3 -fstack-protector-strong -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w    '
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value='g++ -m32'
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-Wl,-O4,--sort-common,--as-needed,-z,relro   '
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=i686-unknown-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=i686-unknown-linux-gnu
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=i686-unknown-linux-gnu
ac_cv_host=i686-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_BASH_SHELL=/usr/bin/bash
ac_cv_path_INSTALL_INFO=/usr/bin/install-info
ac_cv_path_PERL=/usr/bin/perl
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AS=as
ac_cv_prog_AWK=gawk
ac_cv_prog_BISON=bison
ac_cv_prog_CC='gcc -m32'
ac_cv_prog_LD=/usr/lib/hardening-wrapper/bin/ld
ac_cv_prog_MAKE=make
ac_cv_prog_MAKEINFO=makeinfo
ac_cv_prog_MSGFMT=msgfmt
ac_cv_prog_SED=sed
ac_cv_prog_ac_ct_NM=nm
ac_cv_prog_ac_ct_READELF=readelf
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
libc_cv_asm_previous_directive=yes
libc_cv_asm_protected_directive=yes
libc_cv_asm_set_directive=no
libc_cv_asm_unique_object=yes
libc_cv_broken_alias_attribute=no
libc_cv_broken_visibility_attribute=no
libc_cv_compiler_ok=yes
libc_cv_ctors_header=yes
libc_cv_dot_text=.text
libc_cv_friendly_stddef=yes
libc_cv_gcc_static_libgcc=-static-libgcc
libc_cv_have_sdata_section=no
libc_cv_initfini_array=no
libc_cv_ld_gnu_indirect_function=yes
libc_cv_need_minus_P=no
libc_cv_nss_crypt=no
libc_cv_prog_as_gnu=yes
libc_cv_prog_ld_gnu=yes
libc_cv_visibility_attribute=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='ar'
AS='as'
ASFLAGS_config=''
AUTOCONF='no'
AWK='gawk'
BASH_SHELL='/usr/bin/bash'
BISON='bison'
BUILD_CC=''
CC='gcc -m32'
CFLAGS='-pipe -march=native -O3  -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w     -mno-tls-direct-seg-refs'
CPP='gcc -m32 -E'
CPPFLAGS=' -O3'
CPPUNDEFS=''
CXX='g++ -m32'
CXXFLAGS='-pipe -march=native -O3 -fstack-protector-strong -fstack-protector-all --param=ssp-buffer-size=4 -Wno-error -w    '
CXX_SYSINCLUDES=' -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/6.0.138346.359bd42/../../../../include/c++/6.0.138346.359bd42 -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/6.0.138346.359bd42/../../../../include/c++/6.0.138346.359bd42/x86_64-unknown-linux-gnu/32 -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/6.0.138346.359bd42/../../../../include/c++/6.0.138346.359bd42/backward'
DEFINES=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_INFO='/usr/bin/install-info'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD='/usr/lib/hardening-wrapper/bin/ld'
LDFLAGS='-Wl,-O4,--sort-common,--as-needed,-z,relro   '
LIBGD=''
LIBOBJS=''
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
MAKE='make'
MAKEINFO='makeinfo'
MSGFMT='msgfmt'
NM='nm'
OBJCOPY='objcopy'
OBJDUMP='objdump'
OBJEXT='o'
PACKAGE_BUGREPORT='http://sourceware.org/bugzilla/'
PACKAGE_NAME='GNU C Library'
PACKAGE_STRING='GNU C Library (see version.h)'
PACKAGE_TARNAME='glibc'
PACKAGE_URL='http://www.gnu.org/software/glibc/'
PACKAGE_VERSION='(see version.h)'
PATH_SEPARATOR=':'
PERL='/usr/bin/perl'
PKGVERSION='(GNU libc) '
PKGVERSION_TEXI='(GNU libc) '
READELF='readelf'
RELEASE=''
REPORT_BUGS_TEXI='@uref{https://bugs.archlinux.org/}'
REPORT_BUGS_TO='<https://bugs.archlinux.org/>'
SED='sed'
SHELL='/bin/sh'
SYSINCLUDES='-nostdinc -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/6.0.138346.359bd42/include -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/6.0.138346.359bd42/include-fixed -isystem /usr/include'
VERSION=''
ac_ct_CC=''
ac_ct_CXX=''
add_on_subdirs=' libidn'
add_ons='libidn'
all_warnings=''
base_machine='i386'
bindir='${exec_prefix}/bin'
bindnow='yes'
build='i686-unknown-linux-gnu'
build_alias='i686-unknown-linux-gnu'
build_cpu='i686'
build_nscd='default'
build_os='linux-gnu'
build_pt_chown='no'
build_vendor='unknown'
cross_compiling='no'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
enable_lock_elision='yes'
enable_werror='no'
exceptions=''
exec_prefix='NONE'
fno_unit_at_a_time=''
force_install='yes'
gnu89_inline=''
hardcoded_path_in_tests='no'
have_libaudit=''
have_libcap=''
have_selinux=''
host='i686-unknown-linux-gnu'
host_alias='i686-unknown-linux-gnu'
host_cpu='i686'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
ldd_rewrite_script=''
libc_cv_Bgroup=''
libc_cv_cc_loop_to_function=''
libc_cv_cc_nofma=''
libc_cv_cc_submachine=''
libc_cv_cc_with_libunwind=''
libc_cv_forced_unwind=''
libc_cv_fpie=''
libc_cv_gcc_static_libgcc='-static-libgcc'
libc_cv_gcc_unwind_find_fde=''
libc_cv_hashstyle=''
libc_cv_localedir=''
libc_cv_localstatedir=''
libc_cv_nss_crypt='no'
libc_cv_output_format=''
libc_cv_pic_default=''
libc_cv_rootsbindir=''
libc_cv_rtlddir=''
libc_cv_slibdir=''
libc_cv_ssp=''
libc_cv_sysconfdir=''
libc_cv_z_combreloc=''
libc_cv_z_execstack=''
libc_extra_cflags=''
libc_extra_cppflags=''
libdir='/usr/lib32'
libexecdir='/usr/lib32'
link_obsolete_rpc='yes'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mach_interface_list=''
mandir='${datarootdir}/man'
multi_arch='yes'
old_glibc_headers=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
profile='no'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
shared='yes'
sharedstatedir='${prefix}/com'
sizeof_long_double=''
static=''
static_nss='no'
subdirs='  '
submachine=''
sysconfdir='${prefix}/etc'
sysdeps_add_ons=''
sysheaders='/usr/include'
sysnames=' sysdeps/unix/sysv/linux/i386/i686 sysdeps/i386/i686/nptl sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux/x86 sysdeps/i386/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/i386 sysdeps/unix sysdeps/posix sysdeps/i386/i686/fpu/multiarch sysdeps/i386/i686/fpu sysdeps/i386/i686/multiarch sysdeps/i386/i686 sysdeps/i386/i486 sysdeps/i386/fpu sysdeps/x86/fpu sysdeps/i386 sysdeps/x86 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic'
target_alias='i686-unknown-linux-gnu'
use_default_link='default'
use_ldconfig=''
use_nscd='yes'
with_fp='yes'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "GNU C Library"
#define PACKAGE_TARNAME "glibc"
#define PACKAGE_VERSION "(see version.h)"
#define PACKAGE_STRING "GNU C Library (see version.h)"
#define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
#define PACKAGE_URL "http://www.gnu.org/software/glibc/"
#define PKGVERSION "(GNU libc) "
#define REPORT_BUGS_TO "<https://bugs.archlinux.org/>"
#define ENABLE_STACKGUARD_RANDOMIZE 1
#define ENABLE_LOCK_ELISION 1
#define LINK_OBSOLETE_RPC 1
#define HAVE_LIBIDN 1
#define USE_MULTIARCH 1
#define HAVE_ASM_UNIQUE_OBJECT 1
#define HAVE_ASM_PREVIOUS_DIRECTIVE 1

configure: exit 1

Are you using any custom {C, CPP, CXX, MAKE}FLAGS?

Only -O3 and -fstack-protector-all; both are problem-free 99.9% of the time.

I did a test build with -O2 and without -fstack-protector-all, which fails in a different place:

/var/tmp/yaourt-tmp-quequotion/abs-lib32-glibc/src/glibc-build/elf/librtld.os:rtld.c:function lookup_doit: error: undefined reference to '__stack_chk_fail_local'
/var/tmp/yaourt-tmp-quequotion/abs-lib32-glibc/src/glibc-build/elf/librtld.os:rtld.c:function process_dl_debug: error: undefined reference to '__stack_chk_fail_local'
/var/tmp/yaourt-tmp-quequotion/abs-lib32-glibc/src/glibc-build/elf/librtld.os:rtld.c:function print_statistics: error: undefined reference to '__stack_chk_fail_local'
/var/tmp/yaourt-tmp-quequotion/abs-lib32-glibc/src/glibc-build/elf/librtld.os:rtld.c:function dl_main: error: undefined reference to '__stack_chk_fail_local'

These errors could not be resolved by:
-fno-stack-protector (in CFLAGS, no change; build failed wtith the same stack-protector related errors)
-lssp (in LDFLAGS, causes build to fail; apparently makes the linker unusable)

Last edited by quequotion (2015-06-07 07:12:58)

Offline

#4 2015-06-07 06:29:01

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Unable to build glibc

Can you try to build it with makepkg instead of yaourt and see if it works?


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#5 2015-06-07 06:38:11

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: Unable to build glibc

mauritiusdadd wrote:

Can you try to build it with makepkg instead of yaourt and see if it works?

I did; there was no difference.* Yaourt is not configured to alter makepkg's options.

*The log posted above is from a makepkg build; the files happen to be in yaourt's tmp dir.

Last edited by quequotion (2015-06-07 06:42:29)

Offline

#6 2015-06-07 06:43:33

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Unable to build glibc

Have you done a web search for the errors you are seeing? I get several hits for all of them.

Offline

#7 2015-06-07 06:48:45

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: Unable to build glibc

2ManyDogs wrote:

Have you done a web search for the errors you are seeing?

And tried most of the proposed solutions, so I am asking here.

In particular, the error message I got is attributed to LTO, but I get the error with or without LTO.

Last edited by quequotion (2015-06-07 06:50:59)

Offline

#8 2015-06-07 06:56:54

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Unable to build glibc

quequotion wrote:

I did a test build with -O2 and without -fstack-protector-all

Arch uses -fstack-protector-strong by default, try to use it instead of -fstack-protector-all

--edit[0]:

Also do a clean rebuild passing the option --cleanbuild to makepkg

--edit[1]:

Confirmed, using -fstack-protector-all, leads to the error in your original post.

checking for .preinit_array/.init_array/.fini_array support... no
configure: error: Need linker with .init_array/.fini_array support.

Last edited by mauritiusdadd (2015-06-07 07:01:14)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#9 2015-06-07 07:27:46

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: Unable to build glibc

mauritiusdadd wrote:

Arch uses -fstack-protector-strong by default, try to use it instead of -fstack-protector-all

That is what i did. The above errors were output.

Also do a clean rebuild passing the option --cleanbuild to makepkg

I usually delete src/ and pkg/ before every build; Maybe I forgot after changing to -fno-stack -protector... I've been rebuilding this package continuously all day... ::EDIT:: Nope, not getting that sloppy yet. The "undefined refrence" errors to stack protector functions are still a problem.

Is there a way I can find out why specifying "-lssp" in LDFLAGS kills the linker? (the proposed to solution for this problem) When used during a build, I don't get any output from ld or gcc; configure just says it can't find a compatible linker and dies.

Confirmed, using -fstack-protector-all, leads to the error in your original post.

Ok, so the error can be reproduced. That's good news. Now to figure out why the solution doesn't work for me...

Last edited by quequotion (2015-06-07 07:45:40)

Offline

#10 2015-06-07 08:03:51

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Unable to build glibc

quequotion wrote:
mauritiusdadd wrote:

Arch uses -fstack-protector-strong by default, try to use it instead of -fstack-protector-all

That is what i did. The above errors were output.


I'm sorry, I misread it.

quequotion wrote:

Is there a way I can find out why specifying "-lssp" in LDFLAGS kills the linker? (the proposed to solution for this problem) When used during a build, I don't get any output from ld or gcc; configure just says it can't find a compatible linker and dies.

The option -lssp should be passed to the compiler through CFLAGS and/or CPPFLAGS and/or CXXFLAGS and not to the linker. However that will be only a workaround and not a solution.

--edit[0]:

Moreover, libssp.so was once provided by the package gcc-libs but it seems now it is no more there nor in any other packages. Yet, glibc builds fine for me so it seem that libssp.so is not needed anymore...

quequotion wrote:

Now to figure out why the solution doesn't work for me...

Does the configuration log still say that the configuration was done using your custom version for mmug? Because it seems you are using an experimental version of gcc

configure:2746: gcc -m32 --version >&5
gcc (GCC) 6.0.138346.359bd42 20150510 (experimental)

--edit[1]:

I also noticed you are still using 3.19.2-1-ck kernel while current version is 4.0.5-1-ck: is your system fully updated?

--edit[2]:

Here there is the culprit:

quequotion wrote:
PATH: /usr/lib/hardening-wrapper/bin

Building lib32-glibc in a clean chroot with hardening-wrapper installed fails with an error similar to your:

gcc -m32 -Wl,-O1,--sort-common,--as-needed,-z,relro  -nostdlib -nostartfiles -r -o /build/lib32-glibc/src/glibc-build/elf/librtld.os '-Wl,-(' /build/lib32-glibc/src/glibc-build/elf/dl-allobjs.os /build/lib32-glibc/src/glibc-build/elf/rtld-libc.a -lgcc '-Wl,-)' \
	  -Wl,-Map,/build/lib32-glibc/src/glibc-build/elf/librtld.os.map
gcc -m32 -Wl,-O1,--sort-common,--as-needed,-z,relro  -nostdlib -nostartfiles -shared -o /build/lib32-glibc/src/glibc-build/elf/ld.so.new		\
	  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs -Wl,-z,now	\
	  /build/lib32-glibc/src/glibc-build/elf/librtld.os -Wl,--version-script=/build/lib32-glibc/src/glibc-build/ld.map		\
	  -Wl,-soname=ld-linux.so.2			\
	  -Wl,-defsym=_begin=0
/build/lib32-glibc/src/glibc-build/elf/librtld.os: In function `lookup_doit':
rtld.c:(.text+0x125): undefined reference to `__stack_chk_fail_local'
/build/lib32-glibc/src/glibc-build/elf/librtld.os: In function `process_dl_debug':
rtld.c:(.text+0x596): undefined reference to `__stack_chk_fail_local'
/build/lib32-glibc/src/glibc-build/elf/librtld.os: In function `print_statistics':
rtld.c:(.text+0xb8b): undefined reference to `__stack_chk_fail_local'
/build/lib32-glibc/src/glibc-build/elf/librtld.os: In function `.L238':
rtld.c:(.text+0x2d2e): undefined reference to `__stack_chk_fail_local'
/build/lib32-glibc/src/glibc-build/elf/librtld.os: In function `.L1137':
rtld.c:(.text+0x4324): undefined reference to `__stack_chk_fail_local'
/build/lib32-glibc/src/glibc-build/elf/librtld.os:dl-load.c:(.text+0x45ad): more undefined references to `__stack_chk_fail_local' follow
/usr/bin/ld: /build/lib32-glibc/src/glibc-build/elf/ld.so.new: hidden symbol `__stack_chk_fail_local' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:347: recipe for target '/build/lib32-glibc/src/glibc-build/elf/ld.so' failed
make[2]: *** [/build/lib32-glibc/src/glibc-build/elf/ld.so] Error 1
make[2]: Leaving directory '/build/lib32-glibc/src/glibc-2.21/elf'
Makefile:213: recipe for target 'elf/subdir_lib' failed
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory '/build/lib32-glibc/src/glibc-2.21'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Last edited by mauritiusdadd (2015-06-07 09:14:28)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#11 2015-06-07 10:37:16

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: Unable to build glibc

mauritiusdadd wrote:

The option -lssp should be passed to the compiler through CFLAGS and/or CPPFLAGS and/or CXXFLAGS and not to the linker. However that will be only a workaround and not a solution.

--edit[0]:

Moreover, libssp.so was once provided by the package gcc-libs but it seems now it is no more there nor in any other packages. Yet, glibc builds fine for me so it seem that libssp.so is not needed anymore...

The later is what I thought, that it shouldn't be necessary in any case (especially for just the one package), but I will try putting this flag in C{,PP,XX}FLAGS as well...

Does the configuration log still say that the configuration was done using your custom version for mmug? Because it seems you are using an experimental version of gcc

The mmug version is indeed experimental (git) but the version I have (most recetnly) been trying to build is from ABS. I cannot account for why there would be references to the other package in this one... that's insane....

I also noticed you are still using 3.19.2-1-ck kernel while current version is 4.0.5-1-ck: is your system fully updated?

This has come up during a full upgrade (yaourt -Syub). For now I've installed the binary packages to be able to continue upgrading, but that is not a solution. I need to patch lib32-glibc (for mmug), and I was hoping to try out the "--enable-kernel=" option.

Building lib32-glibc in a clean chroot with hardening-wrapper installed fails

Ah hah! Is there a way to temporarily disable the hardening-wrappers? I could purge the whole package, rebuild glibc, and reinstall it (I'd rather keep the added security); but I have a feeling this could happen again and possibly to other packages.

Last edited by quequotion (2015-06-07 11:41:05)

Offline

#12 2015-06-07 14:44:20

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Unable to build glibc

quequotion wrote:

Ah hah! Is there a way to temporarily disable the hardening-wrappers? I could purge the whole package, rebuild glibc, and reinstall it (I'd rather keep the added security); but I have a feeling this could happen again and possibly to other packages.

Since the compilers provided by hardening-wrappers are wrappers, the will override the options you set in makepkg.conf or in the environment variables. In order to change the options globally, you have to edit the file /etc/hardening-wrapper.conf. In particular the stack protector option is controlled by the variable HARDENING_STACK_PROTECTOR:

  • HARDENING_STACK_PROTECTOR=0 means it will use the compiler default option or the option already passed to the compiler.

  • HARDENING_STACK_PROTECTOR=1 means -fstack-protector

  • HARDENING_STACK_PROTECTOR=2 means -fstack-protector-strong

  • HARDENING_STACK_PROTECTOR=3 means -fstack-protector-all

But if you want override the options only for one package, you can use a command like the following:

HARDENING_STACK_PROTECTOR=0 makepkg

About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#13 2015-07-20 09:25:14

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: Unable to build glibc

mauritiusdadd wrote:
  • HARDENING_STACK_PROTECTOR=0 means it will use the compiler default option or the option already passed to the compiler.

  • HARDENING_STACK_PROTECTOR=1 means -fstack-protector

  • HARDENING_STACK_PROTECTOR=2 means -fstack-protector-strong

  • HARDENING_STACK_PROTECTOR=3 means -fstack-protector-all

I believe both arch and hardenning wrapper default to -fstack-protector-strong. If you have default settings in your makepkg.conf, it doesn't make sense that you should have a conflict there--unless gcc doesn't like having more than one of these options specified. I had both -fstack-protector-strong and -fstack-protector-all in makepkg  for ages with no problems, and later switched to just -fstack-protector-all when I understood the redundancy.

In any case, in the course of attempting to fix this bug and many others, I spent three weeks putting arch back together and then one day it just wouldn't boot anymore. I probably could have scrounged some fix together, but I gave in, backed up my data, and formatted.

Offline

#14 2015-07-20 12:01:12

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Unable to build glibc

I think the actual problem here is not the conflict between the two options, but the fact that glibc does not build with any of the stack protector option (there is also an old bug report that has been reopened https://sourceware.org/bugzilla/show_bug.cgi?id=7065). Even if -fstack-protector-strong is set by default in makepkg.conf, that option is passed trough the environment variables CFLAGS and CPPFLAGS but you still have to specify in the Makefile if and how to use that variables. This give you the ability to decide which file can be compiled with custom options and which should be compiled with the default ones. However the gcc wrapper provided by hardening-wrapper will force every file to be compiled with the stack protector option you specified in the configuration file.

For example let's assume that CFLAGS="-fstack-protector-strong". Using the default /usr/bin/gcc compiler,

gcc $CFLAGS -lm file1.c
gcc -lm file2.c

the above code is expanded by the shell to

/usr/bin/gcc -fstack-protector-strong -lm file1.c
/usr/bin/gcc -lm file2.c

and the result is that only file1.c is compiled with -fstack-protector-strong. Now if we use the hardening wrapper, gcc is replaced by /usr/lib/hardening-wrapper/bin/gcc which in turn invokes the compiler with the options specified in /etc/hardeing-wrapper.conf, so the above commands become (assuming the default configuration is used)

/usr/bin/gcc -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-protector-strong -lm file1.c
/usr/bin/gcc -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -lm file2.c

and the effect is that both files are compiled with -fstack-protector-strong (that is the purpose of the wrapper).

--edit: typo

Last edited by mauritiusdadd (2015-07-20 12:52:35)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#15 2015-07-20 12:18:41

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: Unable to build glibc

Look at the glibc PKGBUILD.  It explicitly disables stack protection for part of the build.

Offline

#16 2015-07-20 12:40:22

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Unable to build glibc

Allan wrote:

Look at the glibc PKGBUILD.  It explicitly disables stack protection for part of the build.

True, but it affects only the CFLAGS and CPPFLAGS

  # remove hardening options for building libraries
  CFLAGS=${CFLAGS/-fstack-protector-strong/}
  CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}

Doesn't the wrapper still pull in that option as it is enabled in the configuration file?

--edit[0]: yes, it seems it does it: after adding the option --verbose to CFLAGS, the output shows

GNU C99 (GCC) version 5.1.0 (x86_64-unknown-linux-gnu)
	compiled by GNU C version 5.1.0, GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8d7c555763674119bcd948241af5f2ed
COMPILER_PATH=/usr/lib/hardening-wrapper/bin/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/32/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/../../../../lib32/:/lib/../lib32/:/usr/lib/../lib32/:/usr/lib/hardening-wrapper/bin/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-B' '/usr/lib/hardening-wrapper/bin' '-D' '_FORTIFY_SOURCE=2' '-fstack-protector-strong' '-m32' '-std=gnu99' '-fgnu89-inline' '--param' 'ssp-buffer-size=4' '-v' '-O2' '-Wall' '-Winline' '-Wundef' '-Wwrite-strings' '-fmerge-all-constants' '-frounding-math' '-march=native' '-mno-tls-direct-seg-refs' '-mtune=generic' '-pipe' '-Wstrict-prototypes' '-fPIC' '-c' '-o' '/mnt/CACHE/ABS/multilib/lib32-glibc/src/glibc-build/string/rtld-cacheinfo.os'

So the option  -fstack-protector-strong is still there.

--edit[1]: just for the record, this issue appears to affect only the multilib version and the x86_64 version builds just fine even using the hardening wrapper

Last edited by mauritiusdadd (2015-07-20 13:17:45)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

Board footer

Powered by FluxBB