Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 834978 - net-misc/rsync fails to cross compile for musl (CBUILD=x86_64-pc-linux-gnu, CHOST=x86_64-pc-linux-musl)
Summary: net-misc/rsync fails to cross compile for musl (CBUILD=x86_64-pc-linux-gnu, C...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-12 01:44 UTC by Kirill Chibisov
Modified: 2022-03-12 22:03 UTC (History)
2 users (show)

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


Attachments
Compilation failure log (rsync-failure.txt,12.02 KB, text/plain)
2022-03-12 01:46 UTC, Kirill Chibisov
Details
Configure output (configure.txt,12.47 KB, text/plain)
2022-03-12 09:08 UTC, Kirill Chibisov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill Chibisov 2022-03-12 01:44:18 UTC
When cross compiling for `x86_64-pc-linux-musl` net-misc/rsync-3.2.3-r5 it fails due to missing ifunc on musl and asks to disable simd. The simd was always disabled in musl overlay for rsync however the commit https://github.com/gentoo/musl/commit/f75ebda71b2844cbb82dfe5b0ea7b2a7c83195a3 removed everything related to rsync without porting fix to gentoo's rsync ebuild (look for `--disable-simd`).

Reproducible: Always

Steps to Reproduce:
Build rsync.
Actual Results:  
It doesn't build.

Expected Results:  
It builds.

Portage 3.0.30 (python 3.8.12-final-0, default/linux/amd64/17.0/musl, gcc-11.2.1, musl-1.2.2-r7, 5.16.11-gentoo-dist x86_64)
=================================================================
System uname: Linux-5.16.11-gentoo-dist-x86_64-Intel-R-_Core-TM-_i9-9900K_CPU_@_3.60GHz-with-glibc2.33
KiB Mem:    65699628 total,  51532748 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 11 Mar 2022 20:05:03 +0000
sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p2) 2.37
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-lang/python:           3.9.9-r1::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.25::gentoo
sys-devel/binutils:        2.37_p1-r2::gentoo
sys-devel/binutils-config: 5.4::gentoo
sys-devel/gcc:             11.2.1_p20220115::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.2-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-musl"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news nodoc noinfo noman parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j16"
PKGDIR="/usr/x86_64-pc-linux-musl/packages/"
PORTAGE_CONFIGROOT="/usr/x86_64-pc-linux-musl/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/usr/x86_64-pc-linux-musl/tmp/"
SHELL="/bin/zsh"
USE="acl amd64 bzip2 cli crypt dri fortran git iconv ipv6 libglvnd libtirpc ncurses networkmanager nls nptl openmp pam pcre readline seatd seccomp split-usr ssl unicode xattr zlib {ARCH}" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="sse2" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Kirill Chibisov 2022-03-12 01:46:25 UTC
Created attachment 766806 [details]
Compilation failure log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-12 01:48:44 UTC
FWIW, the fact that this is cross-compilation is quite relevant I think, given that we've had a loooot of bugs related to that w/ rsync + SIMD, even outside of musl.
Comment 3 Fabian Groffen gentoo-dev 2022-03-12 08:45:31 UTC
what confuses me:

khnum% emerge --info | head -n1
Portage 3.0.30 (python 3.9.9-final-0, default/linux/ppc64/17.0/musl, gcc-11.2.0, musl-1.2.2-r7, 5.15.23-gentoo ppc64)
khnum% qlist -IvR rsync
net-misc/rsync-3.2.3-r5::gentoo

sokaris% emerge --info | head -n1
Portage 3.0.30 (python 3.9.9-final-0, default/linux/arm64/17.0/musl, gcc-11.2.0, musl-1.2.2-r7, 5.15.23-gentoo aarch64)
sokaris% qlist -IvR rsync
net-misc/rsync-3.2.3-r5::gentoo

None of these are cross, but can you show your configure output?  For it looks like it wrongly determines it can use the simd instructions while it shouldn't.  I don't have x64 platform using musl, so that may be a reason too.
Comment 4 Kirill Chibisov 2022-03-12 09:08:21 UTC
Created attachment 766848 [details]
Configure output
Comment 5 Kirill Chibisov 2022-03-12 09:09:32 UTC
My host has all simd stuff, my target won't have it though. The only simd stuff it'll have is sse2.
Comment 6 Kirill Chibisov 2022-03-12 10:36:55 UTC
I was able to build rsync from ::gentoo without any issue in chroot. So it looks like cross issue indeed.
Comment 7 Fabian Groffen gentoo-dev 2022-03-12 19:45:04 UTC
hmmm, the cross patch is supposed to address, exactly this.  I wonder what happen without that patch applied.  It replaces build with host, but I wonder if it shouldn't use target instead.
Comment 8 Mike Gilbert gentoo-dev 2022-03-12 21:37:34 UTC
(In reply to Fabian Groffen from comment #7)
> It replaces build with host, but I wonder if it shouldn't use target instead.

Unlikely; we are not building a cross compiler here.