Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 952961 - x11-libs/wxGTK-3.2.6: fails to compile with LTO and -fno-semantic-interposition
Summary: x11-libs/wxGTK-3.2.6: fails to compile with LTO and -fno-semantic-interposition
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo wxWidgets project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2025-03-31 17:55 UTC by pngu
Modified: 2025-03-31 18:15 UTC (History)
1 user (show)

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


Attachments
Full Build Log (build.log.xz,17.00 KB, application/x-xz)
2025-03-31 17:55 UTC, pngu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pngu 2025-03-31 17:55:54 UTC
Created attachment 923317 [details]
Full Build Log

Hi, this is my first bug report, I'm filling it out following recommendations from the Wiki (that I can't post a link to due to my account being brand new), if there's anything missing, let me know.

---

Steps to reproduce:

1. Enable LTO via make.conf:

WARNING_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
COMMON_FLAGS="-O2 -pipe -fomit-frame-pointer -fno-semantic-interposition -ftree-vectorize -fvect-cost-model=dynamic -flto=auto -floop-block -fgraphite-identity -floop-parallelize-all ${WARNING_FLAGS}"
LDFLAGS="${LDFLAGS} ${WARNING_FLAGS}"

2. Build x11-libs/wxGTK

emerge -va x11-libs/wxGTK-3.2.6

3. Build fails with LTO errors, see attached logs.

 * Messages for package x11-libs/wxGTK-3.2.6:

 * ERROR: x11-libs/wxGTK-3.2.6::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=x11-libs/wxGTK-3.2.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-libs/wxGTK-3.2.6::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-libs/wxGTK-3.2.6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-libs/wxGTK-3.2.6/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6-abi_x86_64.amd64'
 * S: '/var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6'

---

Output of emerge --info '=x11-libs/wxGTK-3.2.6::gentoo':

Portage 3.0.67 (python 3.12.9-final-0, default/linux/amd64/23.0/desktop/systemd, gcc-14, glibc-2.40-r8, 6.13.8-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.13.8-gentoo-dist-x86_64-AMD_Ryzen_7_5800X3D_8-Core_Processor-with-glibc2.40
KiB Mem:    32845592 total,   7366512 free
KiB Swap:   33554428 total,  33553148 free
Timestamp of repository gentoo: Mon, 31 Mar 2025 11:45:00 +0000
Head commit of repository gentoo: 7eeb2cfdb5d5ff75134d031f4a9b287ddbd91812
Timestamp of repository guru: Mon, 31 Mar 2025 10:20:16 +0000
Head commit of repository guru: ac28c14f3f3580ca7c6d0c67bc4e5171d5eb89cb

Head commit of repository steam-overlay: d93137ae2575727f9df5d43ce6e0368d44b6c0e7

sh bash 5.2_p37
ld GNU ld (Gentoo 2.44 p1) 2.44.0
ccache version 4.10.2 [disabled]
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.17-r1::gentoo
dev-build/cmake:           3.31.5::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.7.0::gentoo
dev-lang/perl:             5.40.0-r1::gentoo
dev-lang/python:           3.12.9::gentoo, 3.13.2::gentoo
dev-lang/rust-bin:         1.84.1-r2::gentoo
dev-util/ccache:           4.10.2-r1::gentoo
llvm-core/llvm:            19.1.7::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-apps/systemd:          256.10::gentoo
sys-devel/binutils:        2.44::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20241221::gentoo
sys-devel/gcc-config:      2.12.1::gentoo
sys-kernel/linux-headers:  6.12::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: <cant_post_links>
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 3
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: <cant_post_links>
    masters: gentoo
    volatile: False

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: <cant_post_links>
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: <cant_post_links>

Installed sets: @esteam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=znver3 -fomit-frame-pointer -fno-semantic-interposition -ftree-vectorize -fvect-cost-model=dynamic -flto=auto -floop-block -fgraphite-identity -floop-parallelize-all -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
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/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O2 -pipe -march=znver3 -fomit-frame-pointer -fno-semantic-interposition -ftree-vectorize -fvect-cost-model=dynamic -flto=auto -floop-block -fgraphite-identity -floop-parallelize-all -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
DISTDIR="/var/cache/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=znver3 -fomit-frame-pointer -fno-semantic-interposition -ftree-vectorize -fvect-cost-model=dynamic -flto=auto -floop-block -fgraphite-identity -floop-parallelize-all -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=znver3 -fomit-frame-pointer -fno-semantic-interposition -ftree-vectorize -fvect-cost-model=dynamic -flto=auto -floop-block -fgraphite-identity -floop-parallelize-all -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
GENTOO_MIRRORS="<cant_post_links>"
LANG="C.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
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"
RUSTFLAGS=" -C target-cpu=native -C opt-level=3 -C strip=symbols"
SHELL="/bin/bash"
USE="X aac acl acpi alsa amd64 bash-completion branding bzip2 cairo cdda crypt dbus dri encode exif gdbm gif gtk gui iconv icu jpeg kf6compat lcms libnotify libtirpc lto man mp3 mp4 mpeg multilib ncurses nls opengl openmp pam pango pcre pdf pipewire png policykit ppds pulseaudio qml qt6 readline sdl sound ssl startup-notification svg systemd test-rust tiff truetype udev udisks unicode upower usb vaapi vulkan wayland wxwidgets x264 xattr xcb xft xml xv zlib" ABI_X86="64" ADA_TARGET="gcc_14" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto 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, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

---

Output of emerge -pqv '=x11-libs/wxGTK-3.2.6::gentoo':

[ebuild  N    ] x11-libs/wxGTK-3.2.6  USE="X gstreamer libnotify lzma opengl sdl tiff wayland -curl -debug -doc -keyring (-pch) -spell -test -webkit" ABI_X86="(64) -32 (-x32)"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-31 17:57:49 UTC
```
/var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6/include/wx/containr.h:189:7: error: virtual table of type ‘struct wxNavigationEnabled’ violates one definition rule [-Werror=odr]
  189 | class wxNavigationEnabled : public W
      |       ^
/var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6/include/wx/containr.h:189:7: note: the conflicting type defined in another translation unit
  189 | class wxNavigationEnabled : public W
      |       ^
/var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6/include/wx/listbase.h:428:18: note: virtual method ‘IsVisible’
  428 |     virtual bool IsVisible(long WXUNUSED(item)) const { return false; }
      |                  ^
<built-in>: note: ought to match virtual method ‘__cxa_pure_virtual’ but does not
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
```

It may require -fno-semantic-interposition as well.
Comment 2 pngu 2025-03-31 18:02:19 UTC
(In reply to Sam James from comment #1)
> ```
> /var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6/include/wx/
> containr.h:189:7: error: virtual table of type ‘struct wxNavigationEnabled’
> violates one definition rule [-Werror=odr]
>   189 | class wxNavigationEnabled : public W
>       |       ^
> /var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6/include/wx/
> containr.h:189:7: note: the conflicting type defined in another translation
> unit
>   189 | class wxNavigationEnabled : public W
>       |       ^
> /var/tmp/portage/x11-libs/wxGTK-3.2.6/work/wxWidgets-3.2.6/include/wx/
> listbase.h:428:18: note: virtual method ‘IsVisible’
>   428 |     virtual bool IsVisible(long WXUNUSED(item)) const { return
> false; }
>       |                  ^
> <built-in>: note: ought to match virtual method ‘__cxa_pure_virtual’ but
> does not
> lto1: some warnings being treated as errors
> lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status
> compilation terminated.
> ```
> 
> It may require -fno-semantic-interposition as well.

I have -fno-semantic-interposition set in make.conf.

The build succeeds when disabling LTO for this package following the Wiki's recommended workaround of creating an env drop-in file and using it for this package:

---

Contents of /etc/portage/env/nolto.conf

# Env setup to disable LTO and related warnings for problematic builds
DISABLE_LTO="-Wno-error=odr -Wno-error=lto-type-mismatch -Wno-error=strict-aliasing -fno-lto"
CFLAGS="${CFLAGS} ${DISABLE_LTO}"
CXXFLAGS="${CXXFLAGS} ${DISABLE_LTO}"
FCFLAGS="${FCFLAGS} ${DISABLE_LTO}"
FFLAGS="${FFLAGS} ${DISABLE_LTO}"

---

Contents of /etc/portage/package.env/nolto

x11-libs/wxGTK nolto.conf
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-31 18:03:31 UTC
Right. What I mean is, this failure may require LTO *and* -fno-semantic-interposition (seen it before with the strange 'note: ought to match virtual method ‘__cxa_pure_virtual’ but does not' bits).
Comment 4 pngu 2025-03-31 18:05:38 UTC
(In reply to Sam James from comment #3)
> Right. What I mean is, this failure may require LTO *and*
> -fno-semantic-interposition (seen it before with the strange 'note: ought to
> match virtual method ‘__cxa_pure_virtual’ but does not' bits).

Oh, got you. I'll try without that flag, but with LTO enabled, and report back.
Comment 5 pngu 2025-03-31 18:15:20 UTC
(In reply to Sam James from comment #3)
> Right. What I mean is, this failure may require LTO *and*
> -fno-semantic-interposition (seen it before with the strange 'note: ought to
> match virtual method ‘__cxa_pure_virtual’ but does not' bits).

You were correct, compilation finishes successfully when forcing that flag back on by passing -fsemantic-interposition. I'll update the bug report's title.