Отладка процесса сборки glibc - PullRequest
0 голосов
/ 29 июня 2018

Я пытаюсь установить glibc на Clear Linux, и у меня возникают проблемы с отладкой (или даже с тем, какой из множества make-файлов нужно отлаживать). Мои предыдущие попытки в этих двух темах: Как мне встроить в указанный каталог, используя опцию "prefix" в configure? Ошибки сборки glibc: что не так с файлами make / confgure?

Так что теперь моя проблема в том, что когда я запускаю make, сборка останавливается с:

  -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

Я подозреваю, что ключ может быть в этой теме, но это немного над моей головой. ассоциативно-математический с GCC

Я также предполагаю, что более поздние ошибки из make-файлов - результат того, что пошло не так с ассоциативной математикой.

Редактировать По просьбе я побежал

james@clr ~/Downloads/glibc-build $ make -j

и это был конец вывода

 -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

edit 2: дополнительная информация в ответ на комментарии Basile: Мне нужен glibc для запуска некоторых модулей для Phoronix Test Suite, и в будущем он мне, вероятно, понадобится для сборки библиотек для R. Насколько я могу судить, он не включен в Clear Linux (по крайней мере, PTS не думает, что я установить его), и я не вижу его в списке доступных комплектов. Версии:

    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

Редактировать 3. Полный вывод make был слишком длинным для включения, поэтому я поместил его в pastebin: https://pastebin.com/H3yGC5aj

1 Ответ

0 голосов
/ 29 июня 2018

Заданная вами командная строка компилятора содержит следующие флаги:

-fassociative-math -fasynchronous-unwind-tables -feliminate-unused-debug-types -fexceptions -ffat-lto-objects -fmerge-all-constants -fno-semantic-interposition -fno-signed-zeros -fno-stack-protector -fno-trapping-math -frounding-math -fstack-protector -ftree-loop-distribute-patterns

Однако -fassociative-math является одной из небезопасных математических оптимизаций, и glibc не может быть построен с ними, потому что при таких оптимизациях математическая библиотека будет давать неверные результаты - и, как вы выяснили, некоторые из необходимых флагов компилятора для частей из математической библиотеки даже несовместимы с ними.

Вы не передавали эти флаги явно configure или make, поэтому, скорее всего, они получены из переменной окружения CFLAGS. Вы должны сбросить это, прежде чем звонить configure и make.

...