title: Debugging glibc build process
body: <p>I am am trying to install glibc on Clear Linux, and am having difficulty debugging (or even which of the many makefiles to debug).
  My previous attempts are in these two threads:
  <a href="https://stackoverflow.com/questions/51062293/how-do-i-build-into-a-specified-directory-using-the-prefix-option-of-configure/51062660#51062660">How do I build into a specified directory using the &quot;prefix&quot; option of configure?</a>
  <a href="https://stackoverflow.com/questions/51071158/errors-building-glbic-what-is-wrong-with-the-make-confgure-files">Errors building glibc: what is wrong with the make/confgure files?</a></p>
  
  <p>So now my problem is that when I run make, the build stops with:</p>
  
  <pre><code>  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/x86_64  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/x86_64/64  -I../sysdeps/x86_64/fpu/multiarch  -I../sysdeps/x86_64/fpu  -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu  -I../sysdeps/x86_64/multiarch  -I../sysdeps/x86_64  -I../sysdeps/x86  -I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64/wordsize-64  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.   -D_LIBC_REENTRANT -include /home/james/Downloads/glibc-build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -I../soft-fp -o /home/james/Downloads/glibc-build/math/s_modfl.o -MD -MP -MF /home/james/Downloads/glibc-build/math/s_modfl.o.dt -MT /home/james/Downloads/glibc-build/math/s_modfl.o
  cc1: error: -fassociative-math disabled; other options take precedence [-Werror]
  cc1: all warnings being treated as errors
  make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:791: /home/james/Downloads/glibc-build/math/s_modfl.o] Error 1
  make[2]: Leaving directory '/home/james/Downloads/glibc/math'
  make[1]: *** [Makefile:215: math/subdir_lib] Error 2
  make[1]: Leaving directory '/home/james/Downloads/glibc'
  make: *** [Makefile:9: all] Error 2
  </code></pre>
  
  <p>I suspect a clue might be in this thread, but it's a little over my head.
  <a href="https://stackoverflow.com/questions/30321011/associative-math-with-gcc">associative-math with GCC</a> </p>
  
  <p>I'm also guessing that the later errors from the makefiles are the result of whatever went wrong with associative math.</p>
  
  <p><strong>Edit</strong>
  As requested, I ran </p>
  
  <pre><code>james@clr ~/Downloads/glibc-build $ make -j
  </code></pre>
  
  <p>and this was the end of the output</p>
  
  <pre><code> -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64/wordsize-64  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.   -D_LIBC_REENTRANT -include /home/james/Downloads/glibc-build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h  -DPIC -DSHARED     -DTOP_NAMESPACE=glibc -I../soft-fp -DASSEMBLER  -g -Werror=undef -Wa,--noexecstack   -o /home/james/Downloads/glibc-build/math/s_signbit.os -MD -MP -MF /home/james/Downloads/glibc-build/math/s_signbit.os.dt -MT /home/james/Downloads/glibc-build/math/s_signbit.os
  cc1: all warnings being treated as errors
  make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:791: /home/james/Downloads/glibc-build/math/s_modfl.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:825: /home/james/Downloads/glibc-build/math/s_modf.o] Error 1
  cc1: all warnings being treated as errors
  make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:893: /home/james/Downloads/glibc-build/math/s_modff.o] Error 1
  cc1: all warnings being treated as errors
  make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:757: /home/james/Downloads/glibc-build/math/s_modff128.o] Error 1
  cc1: all warnings being treated as errors
  make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:807: /home/james/Downloads/glibc-build/math/s_modfl.os] Error 1
  cc1: all warnings being treated as errors
  make[2]: *** [/home/james/Downloads/glibc-build/sysd-rules:841: /home/james/Downloads/glibc-build/math/s_modf.os] Error 1
  make[2]: Leaving directory '/home/james/Downloads/glibc/math'
  make[1]: *** [Makefile:215: math/subdir_lib] Error 2
  make[1]: Leaving directory '/home/james/Downloads/glibc'
  make: *** [Makefile:9: all] Error 2
  </code></pre>
  
  <p>edit 2: more information in response to comments by Basile:
  I need glibc to run some modules for Phoronix Test Suite, and in the future I will probably need it to build libraries for R. As far as I can tell, it is not included with Clear Linux (at least PTS doesn't think I have it installed), and I do not see it among the list of available bundles.
  Versions:</p>
  
  <pre><code>    james@clr ~/Downloads $ uname -r
      4.17.1-582.native
      james@clr ~/Downloads $ gcc --version
      gcc (Clear Linux OS for Intel Architecture) 8.1.1 20180514
      Copyright (C) 2018 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 commands
  
  james@clr ~/Downloads $ git clone git://sourceware.org/git/glibc.git
  james@clr ~/Downloads $ cd glibc
  james@clr ~/Downloads/glibc $ git checkout --track -b local_glibc-2.27 origin/release/2.27/master
  Branch 'local_glibc-2.27' set up to track remote branch 'release/2.27/master' from 'origin'.
  Switched to a new branch 'local_glibc-2.27'
  james@clr ~/Downloads/glibc $ mkdir /home/james/Downloads/glibc-build/
  james@clr ~/Downloads/glibc $ cd /home/james/Downloads/glibc-build/
  james@clr ~/Downloads/glibc-build $ ~/Downloads/glibc/configure --prefix=/home/james/Downloads/glibc-build
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking for gcc... gcc
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for readelf... readelf
  checking whether we are using the GNU C++ compiler... yes
  checking whether g++ accepts -g... yes
  checking whether g++ can link programs... yes
  checking for sysdeps preconfigure fragments... aarch64 alpha arm hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc tile x86_64 checking whether gcc compiles in -mx32 mode by default... no
  
  checking for use of fpu sysdeps directories... yes
  checking for -fstack-protector... yes
  checking for -fstack-protector-strong... yes
  checking for -fstack-protector-all... yes
  checking for assembler and linker STT_GNU_IFUNC support... yes
  checking for gcc attribute ifunc support... yes
  checking if compiler warns about alias for function with incompatible types... yes
  checking sysdep dirs... sysdeps/unix/sysv/linux/x86_64/64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86 sysdeps/x86/nptl sysdeps/unix/sysv/linux/wordsize-64 sysdeps/x86_64/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/64 sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86/fpu sysdeps/x86_64/multiarch sysdeps/x86_64 sysdeps/x86 sysdeps/ieee754/float128 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/wordsize-64 sysdeps/ieee754 sysdeps/generic
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether ln -s works... yes
  checking whether as is GNU as... yes
  checking whether ld is GNU ld... yes
  checking for as... as
  checking version of as... 2.30, ok
  checking for ld... ld
  checking version of ld... 2.30, ok
  checking for gnumake... no
  checking for gmake... no
  checking for make... make
  checking version of make... 4.2.1, ok
  checking for gnumsgfmt... no
  checking for gmsgfmt... no
  checking for msgfmt... msgfmt
  checking version of msgfmt... 0.19.8.1, ok
  checking for makeinfo... makeinfo
  checking version of makeinfo... 6.5, ok
  checking for sed... sed
  checking version of sed... 4.5, ok
  checking for gawk... gawk
  checking version of gawk... 4.2.1, ok
  checking for bison... bison
  checking version of bison... 3.0.5, ok
  checking if gcc is sufficient to build libc... yes
  checking for nm... gcc-nm
  checking for python3... python3
  checking LD_LIBRARY_PATH variable... ok
  checking for bash... /usr/bin/bash
  checking for perl... /usr/bin/perl
  checking for install-info... /usr/bin/install-info
  checking for .set assembler directive... yes
  checking linker support for protected data symbol... yes
  checking linker support for INSERT in linker script... yes
  checking for broken __attribute__((alias()))... no
  checking whether to put _rtld_local into .sdata section... no
  checking whether to use .ctors/.dtors header and trailer... no
  checking for libunwind-support in compiler... no
  checking whether --noexecstack is desirable for .S files... yes
  checking for -z combreloc... yes
  checking for linker that supports -z execstack... yes
  checking for linker that supports --no-dynamic-linker... yes
  checking for -static-pie... yes
  checking for -fpie... yes
  checking for --hash-style option... yes
  checking for sufficient default -shared layout... no
  checking for GLOB_DAT reloc... yes
  checking linker output format... elf64-x86-64
  checking for -fno-toplevel-reorder -fno-section-anchors... yes
  checking for -mtls-dialect=gnu2... yes
  checking whether cc puts quotes around section names... no
  checking for __builtin_memset... no
  checking for redirection of built-in functions... yes
  checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
  checking if gcc accepts -fno-tree-loop-distribute-patterns with __attribute__ ((__optimize__))... yes
  checking for libgd... yes
  checking for is_selinux_enabled in -lselinux... no
  checking for _FORTIFY_SOURCE predefine... yes
  checking whether the linker provides working __ehdr_start... yes
  checking for __builtin_trap with no external dependencies... yes
  checking whether the C++ compiler supports thread_local... yes
  running configure fragment for sysdeps/unix/sysv/linux/x86_64/64
  running configure fragment for sysdeps/unix/sysv/linux/x86_64
  running configure fragment for sysdeps/unix/sysv/linux
  checking installed Linux kernel header files... 3.2.0 or later
  checking for kernel header at least 3.2.0... ok
  checking for symlinks in /home/james/Downloads/glibc-build/include... ok
  running configure fragment for sysdeps/gnu
  running configure fragment for sysdeps/unix/inet
  running configure fragment for sysdeps/x86_64
  checking for AVX512DQ support in assembler... yes
  checking for AVX512 support... yes
  checking for Intel MPX support... yes
  checking whether -fPIC is default... no
  checking whether -fPIE is default... no
  configure: creating ./config.status
  config.status: creating config.make
  config.status: creating Makefile
  config.status: creating config.h
  config.status: executing default commands
  </code></pre>
  
  <p>Edit 3: The FULL output of make was too long to include, so I put it on pastebin:
  <a href="https://pastebin.com/H3yGC5aj" rel="nofollow noreferrer">https://pastebin.com/H3yGC5aj</a></p>