Created attachment 576696 [details] /var/tmp/portage/net-misc/rsync-3.1.3/temp/environment net-misc/rsync-3.1.3 fails to compile on ARM using USE=static. USE=-static works. This started happening after the CHOST change from armv7a-hardfloat-linux-gnueabi to armv7a-unknown-linux-gnueabihf[1]. emerge -p: ``` banana ~ # emerge -pqv '=net-misc/rsync-3.1.3::gentoo' [ebuild R ] net-misc/rsync-3.1.3 USE="acl iconv ipv6 static* xattr -examples -stunnel" ``` emerge output: ``` banana ~ # emerge -1 rsync Calculating dependencies... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) net-misc/rsync-3.1.3::gentoo >>> Failed to emerge net-misc/rsync-3.1.3, Log file: >>> '/var/tmp/portage/net-misc/rsync-3.1.3/temp/build.log' >>> Jobs: 0 of 1 complete, 1 failed Load avg: 1.22, 0.87, 0.71 * Messages for package net-misc/rsync-3.1.3: * ERROR: net-misc/rsync-3.1.3::gentoo failed (configure phase): * econf failed * * Call stack: * ebuild.sh, line 124: Called src_configure * environment, line 2342: Called econf '--with-rsyncd-conf=/etc/rsyncd.conf' '--without-included-pop t' '--enable-acl-support' '--enable-iconv' '--enable-ipv6' '--enable-xattr-support' * phase-helpers.sh, line 718: Called __helpers_die 'econf failed' * isolated-functions.sh, line 119: Called die * The specific snippet of code: * die "$@" * * If you need support, post the output of `emerge --info '=net-misc/rsync-3.1.3::gentoo'`, * the complete build log and the output of `emerge -pqv '=net-misc/rsync-3.1.3::gentoo'`. * The complete build log is located at '/var/tmp/portage/net-misc/rsync-3.1.3/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/net-misc/rsync-3.1.3/temp/environment'. * Working directory: '/var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3' * S: '/var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3' [21:17] banana ~ # 1less /var/tmp/portage/net-misc/rsync-3.1.3/temp/build.log ``` build.log ``` * Package: net-misc/rsync-3.1.3 * Repository: gentoo * Maintainer: base-system@gentoo.org * USE: acl arm elibc_glibc iconv ipv6 kernel_linux static userland_GNU xattr * FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox >>> Unpacking source... >>> Unpacking rsync-3.1.3.tar.gz to /var/tmp/portage/net-misc/rsync-3.1.3/work >>> Source unpacked in /var/tmp/portage/net-misc/rsync-3.1.3/work >>> Preparing source in /var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3 ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3 ... * econf: updating rsync-3.1.3/config.sub with /usr/share/gnuconfig/config.sub * econf: updating rsync-3.1.3/config.guess with /usr/share/gnuconfig/config.guess ./configure --prefix=/usr --build=armv7a-unknown-linux-gnueabihf --host=armv7a-unknown-linux-gnueabihf --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/rsync-3.1.3 --htmldir=/usr/share/doc/rsync-3.1.3/html --libdir=/usr/lib --with-rsyncd-conf=/etc/rsyncd.conf --without-included-popt --enable-acl-support --enable-iconv --enable-ipv6 --enable-xattr-support configure.sh: Configuring rsync 3.1.3 checking build system type... armv7a-unknown-linux-gnueabihf checking host system type... armv7a-unknown-linux-gnueabihf checking whether to include debugging symbols... yes checking for armv7a-unknown-linux-gnueabihf-gcc... armv7a-unknown-linux-gnueabihf-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure.sh: error: in `/var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3': configure.sh: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details !!! Please attach the following file when seeking support: !!! /var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3/config.log * ERROR: net-misc/rsync-3.1.3::gentoo failed (configure phase): * econf failed * * Call stack: * ebuild.sh, line 124: Called src_configure * environment, line 2342: Called econf '--with-rsyncd-conf=/etc/rsyncd.conf' '--without-included-popt' '--enable-acl-support' '--enable-iconv' '--enable-ipv6' '--enable-xattr-support' * phase-helpers.sh, line 718: Called __helpers_die 'econf failed' * isolated-functions.sh, line 119: Called die * The specific snippet of code: * die "$@" * * If you need support, post the output of `emerge --info '=net-misc/rsync-3.1.3::gentoo'`, * the complete build log and the output of `emerge -pqv '=net-misc/rsync-3.1.3::gentoo'`. * The complete build log is located at '/var/tmp/portage/net-misc/rsync-3.1.3/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/net-misc/rsync-3.1.3/temp/environment'. * Working directory: '/var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3' * S: '/var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3' ``` [1] https://www.gentoo.org/support/news-items/2018-09-07-arm-17-profile-migration.html
Created attachment 576698 [details] emerge --info '=net-misc/rsync-3.1.3::gentoo'
Please attach the entire build log to this bug report.
It's already part of the bug description, but here it goes
Created attachment 576702 [details] /var/tmp/portage/net-misc/rsync-3.1.3/temp/build.log
> See `config.log' for more details Please attach config.log.
Created attachment 576774 [details] /var/tmp/portage/net-misc/rsync-3.1.3/temp/config.log
> configure.sh:3091: checking whether we are cross compiling > configure.sh:3099: armv7a-unknown-linux-gnueabihf-gcc -o conftest -O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -march=armv7-a -Wl,-O1 -Wl,--as-needed -static conftest.c >&5 > configure.sh:3103: $? = 0 > configure.sh:3110: ./conftest > configure.sh:3114: $? = 139 > configure.sh:3121: error: in `/var/tmp/portage/net-misc/rsync-3.1.3/work/rsync-3.1.3': > configure.sh:3123: error: cannot run C compiled programs. According to Google, exit status 139 probably means that the test program was killed with SIGSEGV (segmentation fault).
Copying ARM and toolchain for suggestions.
Is it reproducible? Would be nice to look at the backtrace and final executable.
Is there an easy way I can get the conftest.c and conftest files to post here?
I'm surprised its's not in config.log yet. Try minimal example: echo 'int main(){}' > conftest.c && armv7a-unknown-linux-gnueabihf-gcc -o conftest -O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -march=armv7-a -Wl,-O1 -Wl,--as-needed -static conftest.c && ./conftest; echo $?
(In reply to Sergei Trofimovich from comment #11) > I'm surprised its's not in config.log yet. Try minimal example: > > echo 'int main(){}' > conftest.c && armv7a-unknown-linux-gnueabihf-gcc > -o conftest -O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu > -march=armv7-a -Wl,-O1 -Wl,--as-needed -static conftest.c && ./conftest; > echo $? No errors: banana /tmp # echo 'int main(){}' > conftest.c && armv7a-unknown-linux-gnueabihf-gcc -o conftest -O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -march=armv7-a -Wl,-O1 -Wl,--as-needed -static conftest.c && ./conftest; echo $? 0 I tested if my compiler was working before posting the bug so this is expected. It would help to look at the actual conftest.c and conftest files generated by configure.sh, but I'm not sure how.
Created attachment 577588 [details] conftest.c I modified configure.sh to save a copy of conftest.c. See attached. Are you able to reproduce the error using this source code?
(In reply to Mike Gilbert from comment #13) > Created attachment 577588 [details] > conftest.c > > I modified configure.sh to save a copy of conftest.c. See attached. Thank you. > Are you able to reproduce the error using this source code? Nope. No error :/ banana /tmp # cat conftest.c && echo ==== && armv7a-unknown-linux-gnueabihf-gcc -o conftest -O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -march=armv7-a -Wl,-O1 -Wl,--as-needed -static conftest.c && ./conftest; echo $?; ls -l conftest.out /* confdefs.h */ #define PACKAGE_NAME "rsync" #define PACKAGE_TARNAME "rsync" #define PACKAGE_VERSION "3.1.3" #define PACKAGE_STRING "rsync 3.1.3" #define PACKAGE_BUGREPORT "http://rsync.samba.org/bugzilla.html" #define PACKAGE_URL "" #define RSYNC_VERSION "3.1.3" /* end confdefs.h. */ #include <stdio.h> int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } ==== 0 -rw-r--r-- 1 root root 0 May 23 16:03 conftest.out
Perhaps this is being caused by sys-apps/sandbox. Can you try building this package with FEATURES="-usersandbox -sandbox"?
(In reply to Mike Gilbert from comment #15) > Perhaps this is being caused by sys-apps/sandbox. > > Can you try building this package with FEATURES="-usersandbox -sandbox"? Yes I can! building static rsync with: FEATURES="-usersandbox -sandbox" works FEATURES="-usersandbox" works FEATURES="-sandbox" fails So the problem is FEATURES="usersandbox". I tried rebuilding sys-apps/sandbox but it still fails to build rsync with USE=static FEATURES=usersandbox. TL;DR the workaround is to build rsync using FEATURES="-usersandbox". Thanks everyone for the help!
(In reply to Nuno from comment #16) One more test: Could you try upgrading to the latest version of sys-apps/sandbox (2.17), and see if the build works with FEATURES="usersandbox" after that?
(In reply to Mike Gilbert from comment #17) > (In reply to Nuno from comment #16) > > One more test: Could you try upgrading to the latest version of > sys-apps/sandbox (2.17), and see if the build works with > FEATURES="usersandbox" after that? Still failing with FEATURES="usersandbox" after installing sys-apps/sandbox-2.17::gentoo.
USE=static FEATURES=usersandbox emerge -1 =net-misc/rsync-3.1.3 still failing with sys-apps/sandbox-2.18
I was going to try to reproduce this using 3.2.3-r1 and also test it on a newer kernel, but the static use-flag appears to have been dropped from rsync. https://bugs.gentoo.org/741116 If you still want to investigate this further (e.g. to catch a possible sandbox bug), let me know and I'll test using an older ebuild. Otherwise, I guess this can be closed :/
if you could retest w/sandbox-2.27, that'd be great. the USE=static flag really only added -static to LDFLAGS, so you should be able to recheck with the latest versions like: LDFLAGS=-static emerge rsync you might have to manually rebuild other packages with USE=static-libs.
i tried locally with sandbox-3.0 and it seems to be working. so going to assume one of the recent changes related to ptrace has resolved this. please re-open if sandbox-3.0+ still fails for you.
Hi! Sorry for the delay. Just wanna add that `LDFLAGS=-static emerge -1 rsync` is working on my ARM system. Had to rebuild dev-libs/openssl with USE=static-libs. Used sys-apps/sandbox-2.25 and net-misc/rsync-3.2.3-r5, which are the current stable. # emerge --info rsync | tail -n 5 net-misc/rsync-3.2.3-r5::gentoo was built with the following: USE="acl iconv ipv6 ssl xattr -examples -lz4 -stunnel -system-zlib -xxhash -zstd" LDFLAGS="-static"