Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 893654 - sys-devel/gcc-12.2.1 fails build with USE="sanitize" under musl armv6j chroot
Summary: sys-devel/gcc-12.2.1 fails build with USE="sanitize" under musl armv6j chroot
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-08 22:46 UTC by David Flogeras
Modified: 2024-03-08 01:17 UTC (History)
2 users (show)

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


Attachments
Failed build log from emerge (build.log.xz,130.84 KB, application/x-xz)
2023-02-08 22:47 UTC, David Flogeras
Details
gcc-build-logs requested by sam (gcc-build-logs.tar.xz,223.20 KB, application/x-xz)
2023-02-09 11:14 UTC, David Flogeras
Details
build.log.xz (build.log.xz,129.46 KB, text/plain)
2023-05-11 12:21 UTC, Joonas Niilola
Details
gcc-build-logs.tar.xz (gcc-build-logs.tar.xz,235.39 KB, application/x-tar)
2023-05-11 12:21 UTC, Joonas Niilola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Flogeras 2023-02-08 22:46:34 UTC
build.log (to follow) seems to indicate static_assert failing on the following check of sanitizer_platform_limits_posix.h:1444:

  COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==         \
                 offsetof(CLASS, MEMBER))

Building with USE="-sanitize"

emerge --info from qemu chroot

Portage 3.0.43 (python 3.10.9-final-0, default/linux/arm/17.0/musl/armv7a, gcc-12, musl-1.2.3, 5.15.88-gentoo armv6l)
=================================================================
System uname: Linux-5.15.88-gentoo-armv6l-Intel-R-_Core-TM-_i7-10700_CPU_@_2.90GHz-with-libc
KiB Mem:    65791444 total,  16143644 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 08 Feb 2023 12:00:01 +0000
Head commit of repository gentoo: 1a48f61a3ba2e4fec02d68180db5fcceb9643b36
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p5) 2.39.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.10.9-r1::gentoo
dev-util/cmake:            3.24.3::gentoo
dev-util/meson:            0.64.1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/openrc:           0.45.2-r2::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://mirror.its.dal.ca/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24

musl
    location: /usr/local/portage/musl
    masters: gentoo
    priority: 0
    volatile: True

dave
    location: /usr/local/portage/dave
    masters: gentoo
    priority: 1
    volatile: True

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="@FREE"
CBUILD="armv6j-unknown-linux-musleabihf"
CFLAGS="-march=armv6j -mfpu=vfp -pipe -O2"
CHOST="armv6j-unknown-linux-musleabihf"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=armv6j -mfpu=vfp -pipe -O2"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news nodoc noinfo noman parallel-fetch 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 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en"
MAKEOPTS="-j12"
PKGDIR="/usr/portage/packages"
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"
SHELL="/bin/bash"
USE="acl arm bzip2 cli crypt dri iconv libglvnd ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl test-rust unicode xattr zlib" ADA_TARGET="gnat_2021" 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" 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 evdev" KERNEL="linux" L10N="en" 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_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap 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, LFLAGS, LIBTOOL, 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


Reproducible: Always
Comment 1 David Flogeras 2023-02-08 22:47:53 UTC
Created attachment 850250 [details]
Failed build log from emerge
Comment 2 Larry the Git Cow gentoo-dev 2023-02-08 23:09:44 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7fc81f2fe989beb56e9e5e657ad8bff2aea71219

commit 7fc81f2fe989beb56e9e5e657ad8bff2aea71219
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-08 23:08:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-08 23:09:36 +0000

    profiles/default/linux/arm/17.0/musl: update bug ref in mask
    
    Bug: https://bugs.gentoo.org/893654
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/default/linux/arm/17.0/musl/package.use.mask | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 tt_1 2023-02-09 06:33:38 UTC
I have the same error with gcc-12.2.0 and armv7a+musl, but gcc-13 snapshot is working: 


emerge -pv sys-devel/gcc:13 --nodeps

These are the packages that would be merged, in order:

[ebuild   R   *] sys-devel/gcc-13.0.1_pre20230205-r1:13::gentoo  USE="(cxx) fortran nptl openmp (pie) sanitize ssp (-ada) (-cet) (-custom-cflags) -d -debug -default-stack-clash-protection -default-znow -doc (-fixed-point) -go -graphite (-hardened) (-ieee-long-double) -jit (-libssp) -lto (-multilib) (-nls) -objc -objc++ -objc-gc (-pch) -pgo -rust -systemtap -test (-valgrind) -vanilla (-vtv) -zstd" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Comment 4 tt_1 2023-02-09 06:43:32 UTC
equery f gcc:13 | grep san

/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/include/sanitizer
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/include/sanitizer/asan_interface.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/include/sanitizer/common_interface_defs.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/include/sanitizer/hwasan_interface.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/include/sanitizer/lsan_interface.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/include/sanitizer/tsan_interface.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libasan.a
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libasan.so
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libasan.so.8
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libasan.so.8.0.0
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libasan_preinit.o
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libsanitizer.spec
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libubsan.a
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libubsan.so
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libubsan.so.1
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/libubsan.so.1.0.0
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/plugin/include/asan.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/plugin/include/sanitizer.def
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/plugin/include/tree-ssanames.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/plugin/include/tsan.h
/usr/lib/gcc/armv7a-unknown-linux-musleabihf/13/plugin/include/ubsan.h
Comment 5 David Flogeras 2023-02-09 11:14:12 UTC
Created attachment 850290 [details]
gcc-build-logs requested by sam
Comment 6 David Flogeras 2023-02-09 11:17:15 UTC
I see in my original summary, I managed to clip out some text, making it confusing

 Building with USE="-sanitize"

should have read:

 Building with USE="-sanitize" works around the issue
Comment 7 Larry the Git Cow gentoo-dev 2023-02-09 18:07:40 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fac15bff3ed7414082e45b096fa93c4d4a4fcd2

commit 9fac15bff3ed7414082e45b096fa93c4d4a4fcd2
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-09 18:06:22 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-09 18:07:25 +0000

    profiles/default/linux/arm/17.0/musl: unmask gcc[sanitize] for >=sys-devel/gcc-13
    
    tt_1 reports success on armv7a with musl w/ gcc 13. Let's try unmasking it
    for >=13 given it's likely a sync from libsanitizer in LLVM fixes this.
    
    Bug: https://bugs.gentoo.org/893654
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/default/linux/arm/17.0/musl/package.use.mask | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 8 Joonas Niilola gentoo-dev 2023-05-11 12:20:28 UTC
I have trouble building gcc[sanitize] on amd64 musl. An update from gcc-12 didn't work unless I specified "-sanitize" for gcc-13, and even with gcc-13 rebuilding with the use flag enabled fails.
Comment 9 Joonas Niilola gentoo-dev 2023-05-11 12:21:28 UTC
Created attachment 861502 [details]
build.log.xz
Comment 10 Joonas Niilola gentoo-dev 2023-05-11 12:21:38 UTC
Created attachment 861503 [details]
gcc-build-logs.tar.xz
Comment 11 tt_1 2023-05-11 12:27:35 UTC
The fix for gcc-13 is in 50_all_sanitizer_lfs.patch, which was added to gcc-13.2.0-musl-patches-2.tar.xz
Comment 12 Larry the Git Cow gentoo-dev 2023-06-21 21:53:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e52a59f341205b835e7e881596a3eb6a1dad7fb

commit 7e52a59f341205b835e7e881596a3eb6a1dad7fb
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-06-21 21:53:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-21 21:53:53 +0000

    profiles/features/musl: mask <sys-devel/gcc-13[sanitize]
    
    libsanitizer is very brittle, so let's just focus on keeping the latest
    version working.
    
    Closes: https://bugs.gentoo.org/893654
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/features/musl/package.use.mask | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)