настроить: ошибка: отсутствует поддержка __attribute__ ((конструктор))? - PullRequest
0 голосов
/ 18 января 2019

Я пытаюсь собрать библиотеку glibc с использованием среды bitbake внутри Yocto Project. Я могу построить его успешно, но когда я изменяю флаг компилятора C в файле local.conf, он выдает ошибку отсутствующего атрибута.

build / conf / local.conf file.

здесь я добавляю одну строку:

TARGET_CFLAGS += "-fprofile-arcs -ftest-coverage"

тогда выдает ошибки: отсутствует атрибут ((конструктор)) поддержка?

Я добавил эту строку в файл local.conf.

TARGET_CFLAGS + = "-fprofile-arcs -ftest-покрытие"

Пожалуйста, найдите ссылку на файл config.log: https://drive.google.com/open?id=14tiQJ8JIFE_tDWt3H9tS8zBBQROcZDNa

Sstate summary: Wanted 7 Found 1 Missed 6 Current 51 (14% match, 89% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: glibc-2.28-r0 do_configure: configure failed
ERROR: glibc-2.28-r0 do_configure: Function failed: do_configure (log file is located at /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/temp/log.do_configure.19973)
ERROR: Logfile of failure stored in: /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/temp/log.do_configure.19973
Log data follows:
| DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| Previously configured separate build directory detected, cleaning /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/build-i586-poky-linux
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing python function autotools_aclocals
| DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common']
| DEBUG: Python function autotools_aclocals finished
| DEBUG: Executing shell function do_configure
| NOTE: Running ../git/configure  --build=x86_64-linux        --host=i586-poky-linux          --target=i586-poky-linux        --prefix=/usr           --exec_prefix=/usr          --bindir=/usr/bin           --sbindir=/usr/sbin         --libexecdir=/usr/libexec           --datadir=/usr/share        --sysconfdir=/etc           --sharedstatedir=/com           --localstatedir=/var        --libdir=/usr/lib           --includedir=/usr/include           --oldincludedir=/usr/include        --infodir=/usr/share/info           --mandir=/usr/share/man         --disable-silent-rules          --disable-dependency-tracking           --with-libtool-sysroot=/scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot --enable-kernel=3.2.0                 --disable-profile                 --disable-debug --without-gd                 --enable-clocale=gnu                 --with-headers=/scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot/usr/include                 --without-selinux                 --enable-tunables                 --enable-bind-now                 --enable-stack-protector=strong                 --enable-stackguard-randomization                 --disable-crypt                 --with-default-link                                    --enable-nscd --disable-static
| checking build system type... x86_64-pc-linux-gnu
| checking host system type... i586-poky-linux-gnu
| checking for i586-poky-linux-gcc... i586-poky-linux-gcc  -m32 -march=i586  --sysroot=/scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot
| checking for suffix of object files... o
| checking whether we are using the GNU C compiler... yes
| checking whether i586-poky-linux-gcc  -m32 -march=i586  --sysroot=/scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot accepts -g... yes
| checking for gcc... gcc
| checking for i586-poky-linux-readelf... i586-poky-linux-readelf
| checking whether we are using the GNU C++ compiler... yes
| checking whether i586-poky-linux-g++  -m32 -march=i586  --sysroot=/scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot accepts -g... yes
| checking whether i586-poky-linux-g++  -m32 -march=i586  --sysroot=/scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot can link programs... no
| checking for sysdeps preconfigure fragments... aarch64 alpha arm hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc x86_64
| checking for use of fpu sysdeps directories... yes
| checking for -fstack-protector... (cached) no
| checking for -fstack-protector-strong... (cached) no
| checking for -fstack-protector-all... (cached) no
| 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/i386 sysdeps/unix/sysv/linux/x86 sysdeps/x86/nptl 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/i586 sysdeps/i386/fpu sysdeps/x86/fpu sysdeps/i386 sysdeps/x86 sysdeps/wordsize-32 sysdeps/ieee754/float128 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic
| checking for a BSD-compatible install... /scratch/work/day8/poky/build/tmp/hosttools/install -c
| checking whether ln -s works... yes
| checking whether /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/as is GNU as... yes
| checking whether /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/ld is GNU ld... yes
| checking for /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/as... /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/as
| checking version of /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/as... 2.31.1.20181224, ok
| checking for /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/ld... /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/ld
| checking version of /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/8.2.0/ld... 2.31.1.20181224, ok
| checking for gnumake... make
| checking version of make... 4.2.1, ok
| checking for gnumsgfmt... no
| checking for gmsgfmt... no
| checking for msgfmt... no
| checking for makeinfo... makeinfo
| checking version of makeinfo... 6.1, ok
| checking for sed... sed
| checking version of sed... 4.2.2, ok
| checking for gawk... gawk
| checking version of gawk... 4.1.3, ok
| checking for bison... bison
| checking version of bison... 3.0.4, ok
| checking if i586-poky-linux-gcc  -m32 -march=i586  --sysroot=/scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/recipe-sysroot is sufficient to build libc... yes
| checking for i586-poky-linux-nm... i586-poky-linux-nm
| checking for python3... python3
| configure: WARNING:
| *** These auxiliary programs are missing or incompatible versions: msgfmt
| *** some features or tests will be disabled.
| *** Check the INSTALL file for required versions.
| checking LD_LIBRARY_PATH variable... ok
| checking for bash... (cached) /bin/bash
| checking for perl... /scratch/work/day8/poky/build/tmp/hosttools/perl
| checking for install-info... /usr/bin/install-info
| checking for .set assembler directive... no
| checking linker support for protected data symbol... yes
| checking linker support for INSERT in linker script... no
| 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... configure: error: missing __attribute__ ((constructor)) support??
| NOTE: The following config.log files may provide further information.
| NOTE: /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/build-i586-poky-linux/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/temp/log.do_configure.19973)
ERROR: Task (/scratch/work/day8/poky/meta/recipes-core/glibc/glibc_2.28.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 388 tasks of which 387 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /scratch/work/day8/poky/meta/recipes-core/glibc/glibc_2.28.bb:do_configure
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

1 Ответ

0 голосов
/ 25 января 2019

Поскольку вы включили поддержку покрытия кода, добавив эти CFLAGS -fprofile-arcs -ftest-покрытие - эти CFLAGS должны быть распространены для компиляции двоичного файла conftest, который создается autoconf , Этот двоичный файл создан для проверки того, поддерживается ли одна конкретная функция (как «использовать заголовок и трейлер .ctors / .dtors») или нет (на самом деле, в процессе конфигурирования происходит несколько аналогичных сборок для проверки конкретных функций). , Я не могу доказать это, потому что подробные распечатки ошибок должны быть в определенном файле журнала, которым вы не поделились:

| NOTE: The following config.log files may provide further information.
| NOTE: /scratch/work/day8/poky/build/tmp/work/i586-poky-linux/glibc/2.28-r0/build-i586-poky-linux/config.log

Но, держу пари, он должен содержать что-то вроде:

conftest.c:(.text+0xae): undefined reference to `__gcov_init'
...
collect2: ld returned 1 exit status

Это связано с тем, что в коде используются некоторые вызовы функций, а компоновщик не может найти свои реализации (даже в этих конфликтных двоичных файлах, где они абсолютно бессмысленны).

В можно можно пропустить этот конкретный тест конфигурации, указав соответствующий параметр конфигурации - libc_cv_ctors_header (в этом случае имя берется из файла glib configure.ac) - добавление EXTRA_OECONF в local.conf (например, EXTRA_OECONF = "libc_cv_ctors_header = yes"), но эти флаги фактически влияют на все такие тесты, и нам не следует угадывать значения да / нет и так далее.

Таким образом, было бы лучше, чтобы компоновщик знал о поддержке покрытия - т. Е. Предоставлял те же флаги для TARGET_LDFLAGS :

TARGET_LDFLAGS += "-fprofile-arcs -ftest-coverage"
...