False positives in nolibc check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
The nolibc build is enabled on x86-64, i686, and aarch64 since commit
bfb432f4cce5 ("configure: Always enable `CONFIG_NOLIBC` if the arch is
supported").

When I build the liburing 2.4 rpm package for Fedora i686, nolibc is
enabled but the following compilation error occurs:

  gcc -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection  -Wno-unused-parameter -DLIBURING_INTERNAL  -nostdlib -nodefaultlibs -ffreestanding -fno-builtin -shared -Wl,--version-script=liburing.map -Wl,-soname=liburing.so.2 -o liburing.so.2.4 setup.os queue.os register.os syscall.os version.os nolibc.os -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes  -nostdlib -nodefaultlibs
  make[1]: Leaving directory '/builddir/build/BUILD/liburing-2.4/src'
  /usr/bin/ld: /tmp/cca16k90.ltrans0.ltrans.o: in function `__io_uring_submit':
  /builddir/build/BUILD/liburing-2.4/src/queue.c:388: undefined reference to `__stack_chk_fail_local'

This is caused by the stack protector compiler options, which depend on
the libc __stack_chk_fail_local symbol.

The compile_prog check in ./configure should use the final
CFLAGS/LDFLAGS (including -ffreestanding) that liburing is compiled with
to avoid false positives. That way it can detect that nolibc won't work
with these compiler options and fall back to using libc.

In general, I'm concerned that nolibc is fragile because the toolchain
and libc sometimes have dependencies that are activated by certain
compiler options. Some users will want libc and others will not. Maybe
make it an explicit option instead of probing?

I've included a downstream patch in the Fedora package that disables
nolibc for the time being.

Thanks,
Stefan

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux