samba ebuild fails in configuration phase. The relevant message is: -------------------- Checking for library archive : no libarchive support not found. Try installing libarchive-dev or libarchive-devel. Otherwise, use --without-libarchive to build without libarchive support. libarchive support is required for the smbclient tar-file mode (complete log in /var/tmp/portage/net-fs/samba-4.11.6-r2/work/samba-4.11.6-abi_x86_64.amd64/bin/config.log) ---------- A rebuild of libarchive didn't fix the problem: app-arch/libarchive-3.4.0:0/13::gentoo USE="acl blake2 bzip2 e2fsprogs iconv lz4 lzma lzo threads xattr zlib zstd -expat -libressl -nettle -static-libs" ABI_X86="(64) -32 (-x32)" This new version of samba comes on my system with a emerge -DuvN @world: [ebuild U ] net-fs/samba-4.11.6-r2::gentoo [4.8.6-r4::gentoo] USE="acl client cups json%* ldap pam system-mitkrb5 systemd zeroconf -addc -addns -ads -ceph -cluster -debug (-dmapi) (-fam) -gpg -iprint -profiling-data% -python -quota (-selinux) -syslog (-system-heimdal) -test -winbind (-gnutls%)" ABI_X86="(64) -32 (-x32)" PYTHON_SINGLE_TARGET="python3_6%* (-python3_7) (-python3_8) (-python2_7%*)" 0 KiB Since this update fails, other ebuilds depending on this also don't get updates (even though I use --keep-going, but after samba fails they don't get updated). Reproducible: Always
Thank you for the report. Please recompile and *attach* the logfiles and paste the emerge info as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket We need to have all information at hand before ticket assignment, so that the maintainer can look after it in one session with minimal number of callbacks. Please reopen this ticket (Status:unconfirmed) afterwards.
Created attachment 614822 [details] emerge --info
Created attachment 614824 [details] /var/tmp/portage/net-fs/samba-4.11.6-r2/temp/build.log
Created attachment 614826 [details] Current problem with samba - emerge doesn't keep going... The problem is that when I used --keep-going with portage in the past, a failed ebuild would be skipped and portage would recalculate dependencies based upon this skipped ebuild, but keep going, whereas now it always stops after samba repeatedly fails. Sometimes, if I rerun the original command (emerge -aDuvN @world) there would be a different ordering and one more ebuild would "get through" before it again fails. Manually emerging some of the announced updates often succeeds, like app-emulation/wine-staging-5.2::wine and app-emulation/wine-vanilla-5.2::wine have been emerged just fine with the manual command "emerge -a1v app-emulation/wine-staging app-emulation/wine-vanilla"...
This probably has to do with your non-safe CFLAGS and LDFLAGS. But can you attach /var/tmp/portage/net-fs/samba-4.11.6-r2/work/samba-4.11.6-abi_x86_64.amd64/bin/config.log which has details of the configure check failure? CFLAGS="-march=znver1 -O2 -pipe -pie -fPIE -fstack-protector-strong -fstack-check=specific -fno-plt -mindirect-branch=thunk -mfunction-return=thunk" LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=both -Wl,-z,relro -Wl,-znow -pie -fPIE -fstack-protector-strong -fstack-check=specific -fno-plt -mindirect-branch=thunk -mfunction-return=thunk"
Created attachment 614958 [details] /var/tmp/portage/net-fs/samba-4.11.6-r2/work/samba-4.11.6-abi_x86_64.amd64/bin/config.log And so it is... The CFLAGS! ['x86_64-pc-linux-gnu-gcc', '-march=znver1', '-O2', '-pipe', '-pie', '-fPIE', '-fstack-protector-strong', '-fstack-check=specific', '-fno-plt', '-mindirect-branch=thunk', '-mfunction-return=thunk', '-Wl,-O2', '-Wl,--as-needed', '-Wl,--sort-common', '-Wl,--hash-style=both', '-Wl,-z,relro', '-Wl,-znow', '-pie', '-fPIE', '-fstack-protector-strong', '-fstack-check=specific', '-fno-plt', '-mindirect-branch=thunk', '-mfunction-return=thunk', '-shared', 'test.c.1.o', '-o/var/tmp/portage/net-fs/samba-4.11.6-r2/work/samba-4.11.6-abi_x86_64.amd64/bin/.conf_check_cad97aab1b07747a588d5868568a6e6e/testbuild/default/libtestprog.so', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-L/usr/local/lib', '-L/usr/local/lib', '-larchive', '-Wl,-O2', '-Wl,--as-needed', '-Wl,--sort-common', '-Wl,--hash-style=both', '-Wl,-z,relro', '-Wl,-znow', '-pie', '-fPIE', '-fstack-protector-strong', '-fstack-check=specific', '-fno-plt', '-mindirect-branch=thunk', '-mfunction-return=thunk', '-Wl,-no-undefined', '-Wl,--export-dynamic'] err: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib64/Scrt1.o: in function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status I normally see those "in function `_start': ... undefined reference to `main'" failures in the failed emerge message output by portage, and I then know that I have to add this ebuild to my "non-pic/non-pie" gcc-profile (in /etc/portage/package.env, using a profile from /etc/porage/env with the appropriate "safe" CFLAGS), but this time I completely missed the error message. Thanks! Building samba without "-fPIE -fPIC" fixed it. (IMHO it is actually the other way around: position-independend is hardend and hardend is safe...) https://wiki.gentoo.org/wiki/Project:AMD64/Fixing_-fPIC_Errors_Guide https://forums.gentoo.org/viewtopic-t-1022004-view-previous.html
Do you know that PIE is now enabled by default starting in 17.0 profiles? https://www.gentoo.org/support/news-items/2017-11-30-new-17-profiles.html
No, I did not. I started this Linux box with 17.0, afaik. The problem was znver1 gcc support and amdgpu drivers for my Vega graphics card. Also, around that time, Spectre was an issue with not mitigations yet in place, so I found those /safer/ CFLAGS and LDFLAGS for my system, and I decided not only to go for PIE, but also for PIC. Until recently everything worked very well with those settings, except for a lot of pyhton packages... It seems that python stuff isn't ever happy with position independend code :-( So created more profiles (in /etc/portage/env) and keep a list of those packages requiring "special" treatment (depending on the view) in /etc/portage/package.env. I think I added -fPIC because there is a typical error when GCC requests this. From https://github.com/vaeth/portage-env-mv/tree/master/package.cflags - # +fPIE +pie # these are collected in an extra file: pie # Typical error on 32bit: hang with "corrupted double-linked list" # Typical error: undefined reference to `main' # Typical error: undefined symbol # Typical error: recompile with -fPIC I also added CFLAGS initially to make GCC safer in regard to Spectre, like mentioned here (posting by mv): https://forums.gentoo.org/viewtopic-t-1076300.html Maybe I do have it all wrong, because the list of packages unable to handle my settings grow day by day. If -pie -fPIE is the default now anyway, at least I get some position indipendent code -- not -pic -fPIC though! Anyway, thanks for your help. Out of interest: is only the config broken with my settings, or would actually the whole build fail? Is there a way to patch and then test this?
BTW, I just noticed I don't even use -fPIC! This is the relevant part of my /etc/portage/make.conf: -------------------- COMMON_FLAGS="-O2 -pipe" COMMON_ARCH_FLAGS="-march=znver1" COMMON_MITIGATION_FLAGS="-pie -fPIE -fstack-protector-strong -fstack-check=specific -fno-plt -mindirect-branch=thunk -mfunction-return=thunk" CFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}" CXXFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}" FCFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}" FFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}" LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=both -Wl,-z,relro -Wl,-znow ${COMMON_MITIGATION_FLAGS}" -------------------- If gcc now defaults to -fno-plt and -pie -fPIE, then I don't see the difference... The flags are redundant and would be used even when not specified, right? So where does -fPIC come from?!?
I think even though PIE is default-on, your putting it in CFLAGS explicitly will force it on in places where it woudln't otherwise be on. Please take -pie and -fPIE out of your CFLAGS.
FYI I changed it according to your recommendation and removed -pie -fPIE from my CFLAGS. Thanks again!