Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685994 - net-misc/rsync-3.1.3 USE=static : configure.sh: error: cannot run C compiled programs
Summary: net-misc/rsync-3.1.3 USE=static : configure.sh: error: cannot run C compiled ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-14 20:41 UTC by Nuno
Modified: 2021-12-26 02:21 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/tmp/portage/net-misc/rsync-3.1.3/temp/environment (environment,95.67 KB, text/plain)
2019-05-14 20:41 UTC, Nuno
Details
emerge --info '=net-misc/rsync-3.1.3::gentoo' (emerge.info.txt,6.18 KB, text/plain)
2019-05-14 20:41 UTC, Nuno
Details
/var/tmp/portage/net-misc/rsync-3.1.3/temp/build.log (build.log,3.04 KB, text/x-log)
2019-05-14 20:49 UTC, Nuno
Details
/var/tmp/portage/net-misc/rsync-3.1.3/temp/config.log (config.log,8.71 KB, text/x-log)
2019-05-15 14:37 UTC, Nuno
Details
conftest.c (conftest.c,418 bytes, text/plain)
2019-05-22 17:46 UTC, Mike Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno 2019-05-14 20:41:05 UTC
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
Comment 1 Nuno 2019-05-14 20:41:41 UTC
Created attachment 576698 [details]
emerge --info '=net-misc/rsync-3.1.3::gentoo'
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-14 20:47:39 UTC
Please attach the entire build log to this bug report.
Comment 3 Nuno 2019-05-14 20:49:34 UTC
It's already part of the bug description, but here it goes
Comment 4 Nuno 2019-05-14 20:49:56 UTC
Created attachment 576702 [details]
/var/tmp/portage/net-misc/rsync-3.1.3/temp/build.log
Comment 5 Mike Gilbert gentoo-dev 2019-05-14 21:40:06 UTC
> See `config.log' for more details

Please attach config.log.
Comment 6 Nuno 2019-05-15 14:37:38 UTC
Created attachment 576774 [details]
/var/tmp/portage/net-misc/rsync-3.1.3/temp/config.log
Comment 7 Mike Gilbert gentoo-dev 2019-05-15 16:11:40 UTC
> 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).
Comment 8 Mike Gilbert gentoo-dev 2019-05-15 16:14:02 UTC
Copying ARM and toolchain for suggestions.
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2019-05-15 18:24:24 UTC
Is it reproducible? Would be nice to look at the backtrace and final executable.
Comment 10 Nuno 2019-05-19 22:27:57 UTC
Is there an easy way I can get the conftest.c and conftest files to post here?
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2019-05-21 06:23:03 UTC
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 $?
Comment 12 Nuno 2019-05-22 16:07:50 UTC
(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.
Comment 13 Mike Gilbert gentoo-dev 2019-05-22 17:46:00 UTC
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?
Comment 14 Nuno 2019-05-23 15:05:01 UTC
(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
Comment 15 Mike Gilbert gentoo-dev 2019-05-23 16:02:10 UTC
Perhaps this is being caused by sys-apps/sandbox.

Can you try building this package with FEATURES="-usersandbox -sandbox"?
Comment 16 Nuno 2019-05-24 14:46:17 UTC
(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!
Comment 17 Mike Gilbert gentoo-dev 2019-05-24 15:01:00 UTC
(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?
Comment 18 Nuno 2019-05-25 18:09:02 UTC
(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.
Comment 19 Nuno 2019-11-04 17:11:35 UTC
USE=static FEATURES=usersandbox emerge -1 =net-misc/rsync-3.1.3

still failing with sys-apps/sandbox-2.18
Comment 20 Nuno 2020-11-12 18:22:40 UTC
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 :/
Comment 21 SpanKY gentoo-dev 2021-10-24 04:12:26 UTC
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.
Comment 22 SpanKY gentoo-dev 2021-11-03 00:43:10 UTC
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.
Comment 23 Nuno 2021-12-26 02:21:33 UTC
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"