Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 738642 - app-admin/apache-tools-2.4.46 fails to build on Sparc, undefined references to __sync_*_8
Summary: app-admin/apache-tools-2.4.46 fails to build on Sparc, undefined references t...
Status: RESOLVED DUPLICATE of bug 740464
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: Normal normal (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: libatomic-linking CVE-2019-12412
  Show dependency tree
 
Reported: 2020-08-23 02:37 UTC by spock128
Modified: 2021-05-09 07:20 UTC (History)
4 users (show)

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


Attachments
Build log (with LDFLAGS="-latomic") (build.log,36.43 KB, text/x-log)
2020-08-23 02:39 UTC, spock128
Details
build.log (2.4.46, ppc) (apache-tools-2.4.46:20210316-175904.log,36.56 KB, text/plain)
2021-03-16 18:01 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description spock128 2020-08-23 02:37:14 UTC
The recent stable ebuild for apache-tools is failing to compile on my sparc box. The error messages are showing undefined references to various atomics, but adding -latomic to LDFLAGS does not help.

Reproducible: Always

Steps to Reproduce:
1. emerge -v1 apache-tools
1a. LDFLAGS="-latomic" emerge -v1 apache-tools
Actual Results:  
...
/usr/share/apr/build/libtool  --mode=link sparc-unknown-linux-gnu-gcc  -pthread  -mcpu=ultrasparc -O2 -pipe    -L/var/tmp/portage/dev-libs/apr-util-1.6.1-r6/temp  -latomic -o htpasswd  htpasswd.lo passwd_common.lo       -laprutil-1 -ldb-5.3 -lgdbm -lexpat -lapr-1 -luuid -lrt -lcrypt -lpthread -ldl -lcrypt
libtool: link: sparc-unknown-linux-gnu-gcc -pthread -mcpu=ultrasparc -O2 -pipe -o htpasswd htpasswd.o passwd_common.o  -L/var/tmp/portage/dev-libs/apr-util-1.6.1-r6/temp //usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/libatomic.so -laprutil-1 //usr/lib/libdb-5.3.so -lgdbm -lexpat -lapr-1 -luuid -lrt -lpthread -ldl -lcrypt -pthread -Wl,-rpath -Wl,//usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0 -Wl,-rpath -Wl,//usr/lib
/usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../sparc-unknown-linux-gnu/bin/ld: /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../lib/libapr-1.so: undefined reference to `__sync_val_compare_and_swap_8'
/usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../sparc-unknown-linux-gnu/bin/ld: /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../lib/libapr-1.so: undefined reference to `__sync_lock_test_and_set_8'
/usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../sparc-unknown-linux-gnu/bin/ld: /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../lib/libapr-1.so: undefined reference to `__sync_sub_and_fetch_8'
/usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../sparc-unknown-linux-gnu/bin/ld: /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../lib/libapr-1.so: undefined reference to `__sync_fetch_and_sub_8'
/usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../sparc-unknown-linux-gnu/bin/ld: /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../lib/libapr-1.so: undefined reference to `__sync_fetch_and_add_8'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:40: htpasswd] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-admin/apache-tools-2.4.46/work/httpd-2.4.46/support'
make: *** [/var/tmp/portage/app-admin/apache-tools-2.4.46/work/httpd-2.4.46/build/rules.mk:75: all-recursive] Error 1
make: Leaving directory '/var/tmp/portage/app-admin/apache-tools-2.4.46/work/httpd-2.4.46/support'


Expected Results:  
emerge completes successfully.

Portage 2.3.103 (python 3.7.8-final-0, default/linux/sparc/17.0/desktop, gcc-9.3.0, glibc-2.31-r6, 5.4.48-gentoo sparc64)
=================================================================
System uname: Linux-5.4.48-gentoo-sparc64-sun4u-with-gentoo-2.4.1
KiB Mem:      506800 total,     60576 free
KiB Swap:    5242864 total,   5241824 free
Timestamp of repository gentoo: Fri, 21 Aug 2020 20:45:01 +0000
Head commit of repository gentoo: e24d2805002ba5ececb242a44351372b23655d17
sh bash 5.0_p18
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
distcc 3.3.3 sparc-unknown-linux-gnu [enabled]
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.4-r1::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r6::gentoo
Repositories:

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

robert7k
    location: /var/lib/layman/robert7k
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="sparc"
ACCEPT_LICENSE="@FREE bh-luxi as-is freedist fairuse unRAR xv all-rights-reserved"
CBUILD="sparc-unknown-linux-gnu"
CFLAGS="-mcpu=ultrasparc -O2 -pipe"
CHOST="sparc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-mcpu=ultrasparc -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
ENV_UNSET="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=""
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distcc distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news 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=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages/sparc"
PORTAGE_CONFIGROOT="/"
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="/var/tmp"
USE="7z X a52 aac aalib acl alsa apache2 apng avahi background berkdb big-endian branding bzip2 cairo caps cdda cdparanoia cdr cdrom cli crypt cups curl dbus dri dts dvd dvdr elogind emboss encode escreen exif expat flac fontconfig fortran fpx fuse gcrypt gd gdbm gif glib gmp gnutls gpm graphviz gstreamer gtk gzip hddtemp hfs howl-compat iconv icu idn imagemagick imlib ipv6 jbig jpeg jpeg2k lcms libglvnd libnotify libtirpc mad mdnsresponder-compat mng motif mp3 mp4 mpeg mpeg2 mplayer ncurses nls nptl ogg openal opengl openmp pam pango pcre pdf png policykit ppds python qt4 readline rle scanner screen sdl sndfile soup sparc speex spell split-usr sqlite ssl startup-notification svg tcpd tex theora threads tiff truetype udev udisks unicode upower usb v4l vim-syntax vorbis wma wmf wxwidgets x264 xattr xcb xgetdefault xinerama xml xpm xrandr xv xvid zeroconf zlib" ADA_TARGET="gnat_2018" APACHE2_MODULES="alias authn_core authz_core authz_host autoindex cache deflate dir env expires file_cache filter headers ident include info log_config logio mime mime_magic negotiation rewrite socache_shmcb speling ssl status unixd userdir vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" 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="evdev" KERNEL="linux" L10N="en en_US en_GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="fbdev mach64" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 spock128 2020-08-23 02:39:48 UTC
Created attachment 656288 [details]
Build log (with LDFLAGS="-latomic")
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-08-23 20:57:24 UTC
tentatively adding as blocker to bug 721344 but it's not a 32 bit arch...
Comment 3 spock128 2020-09-06 03:48:04 UTC
Sparc userland is usually 32bit for performance, though the kernel is 64.

I took a look a the machine again, and I found that apache-tools-2.4.46 is already installed - portage is attempting to re-build it when I run `emerge -uavND @world`.

Looking closer, the problem appears to be in dev-libs/apr-1.7.0-r1: libapr-1.so contains undefined references to __sync_fetch* and friends, which breaks anything trying to link against it. Notably, these aren't included in libatomic - that was a red herring.

When I build apr-1.6.3-r4 manually, it doesn't exhibit this behavior, but unfortunately emerge won't let me downgrade for some reason.
Comment 4 ernsteiswuerfel archtester 2021-03-16 18:01:29 UTC
Created attachment 691857 [details]
build.log (2.4.46, ppc)

Same on ppc.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-05-09 07:20:02 UTC

*** This bug has been marked as a duplicate of bug 740464 ***