Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 909305 - net-libs/nodejs-20.3.0[lto] fails to compile (lto): ../../src/node_options.h:107:7: error: type ‘struct EnvironmentOptions’ violates the C++ One Definition Rule [-Werror=odr]
Summary: net-libs/nodejs-20.3.0[lto] fails to compile (lto): ../../src/node_options.h:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-06-27 14:35 UTC by Kostadin Shishmanov
Modified: 2023-07-05 22:07 UTC (History)
0 users

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


Attachments
build log compressed with xz (build.log.xz,57.42 KB, application/x-xz)
2023-06-27 15:37 UTC, Kostadin Shishmanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2023-06-27 14:35:37 UTC
net-libs/nodejs-20.3.0 fails to compile with USE=lto and -Werror=odr added to CFLAGS and LDFLAGS


FAILED: node 
x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,--as-needed -march=native -O3 -pipe -fno-plt -falign-functions=32 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -pthread -rdynamic -m64 obj/src/large_pages/node_text_start.node_text_start.o -Wl,--whole-archive obj/libnode.a obj/tools/v8_gypfiles/libv8_base_without_compiler.a -Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive obj/tools/v8_gypfiles/libv8_snapshot.a -Wl,--no-whole-archive -Wl,-z,relro -Wl,-z,now  -flto=4 -fuse-linker-plugin -ffat-lto-objects  -o node -Wl,--start-group obj/gen/node.node_snapshot.o obj/src/node.node_main.o obj/deps/histogram/libhistogram.a obj/deps/uvwasi/libuvwasi.a obj/libnode.a obj/libnode_text_start.a obj/tools/v8_gypfiles/libv8_snapshot.a obj/tools/v8_gypfiles/libv8_libplatform.a obj/deps/llhttp/libllhttp.a obj/deps/base64/libbase64.a obj/deps/base64/libbase64_ssse3.a obj/deps/base64/libbase64_sse41.a obj/deps/base64/libbase64_sse42.a obj/deps/base64/libbase64_avx.a obj/deps/base64/libbase64_avx2.a obj/deps/simdutf/libsimdutf.a obj/deps/ada/libada.a obj/tools/v8_gypfiles/libv8_base_without_compiler.a obj/tools/v8_gypfiles/libv8_libbase.a obj/tools/v8_gypfiles/libv8_zlib.a obj/tools/v8_gypfiles/libv8_compiler.a obj/tools/v8_gypfiles/libv8_turboshaft.a obj/tools/v8_gypfiles/libv8_initializers.a  -lz -luv -lbrotlidec -lbrotlienc -lcares -lnghttp2 -lcrypto -lssl -licui18n -licuuc -licudata -ldl -Wl,--end-group
../../src/node_options.h:107:7: error: type ‘struct EnvironmentOptions’ violates the C++ One Definition Rule [-Werror=odr]
  107 | class EnvironmentOptions : public Options {
      |       ^
../../src/node_options.h:107: note: a different type is defined in another translation unit
  107 | class EnvironmentOptions : public Options {
      | 
../../src/node_options.h:148:15: note: the first difference of corresponding definitions is field ‘cpu_prof_dir’
  148 |   std::string cpu_prof_dir;
      |               ^
../../src/node_options.h:159: note: a field with different name is defined in another translation unit
  159 |   std::string redirect_warnings;
      | 
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
make: *** [Makefile:149: node] Error 1
Comment 1 Mike Gilbert gentoo-dev 2023-06-27 15:32:08 UTC
Please attach the build log and provide emerge --info. Then change the status to UNCONFIRMED.
Comment 2 Kostadin Shishmanov 2023-06-27 15:37:04 UTC
Created attachment 864721 [details]
build log compressed with xz

Attaching it, didn't notice it hadn't uploaded. Guess it was because the log was too big. Sorry for that. Also adding emerge --info from a successful build, only difference is USE=lto is disabled



Portage 3.0.49 (python 3.11.4-final-0, default/linux/amd64/17.1/desktop/gnome/systemd/merged-usr, gcc-13, glibc-2.37-r3, 6.3.9-gentoo-thp-eevdf x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.3.9-gentoo-thp-eevdf-x86_64-13th_Gen_Intel-R-_Core-TM-_i5-13600KF-with-glibc2.37
KiB Mem:    16254516 total,   2604408 free
KiB Swap:   33031160 total,  30386424 free
Timestamp of repository gentoo: Tue, 27 Jun 2023 14:31:59 +0000
Head commit of repository gentoo: f14aa860068fb7aa89dd0cc78113e8c18252f4c0

Timestamp of repository guru: Tue, 27 Jun 2023 08:31:53 +0000
Head commit of repository guru: f816a5721ef5cd93b24bb5194d6165304e5d872f

Timestamp of repository mv: Mon, 26 Jun 2023 19:03:52 +0000
Head commit of repository mv: 98b4d523d27643dcac095c053236ba728d1e3ab6

Timestamp of repository steam-overlay: Sat, 24 Jun 2023 23:02:09 +0000
Head commit of repository steam-overlay: 3d22ff5d30dcf0cbede6a84c28266b291caf8f68

Timestamp of repository thegreatmcpain: Mon, 26 Jun 2023 19:03:59 +0000
Head commit of repository thegreatmcpain: 708054ca06a91668f223608d2c216db9986c6243

sh bash 5.2_p15-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r6::gentoo
dev-lang/perl:             5.36.1-r2::gentoo
dev-lang/python:           3.11.4::gentoo
dev-lang/rust:             1.70.0::gentoo
dev-util/cmake:            3.26.4-r1::gentoo
dev-util/meson:            1.1.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/sandbox:          2.32::gentoo
sys-apps/systemd:          253.5::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo
sys-devel/gcc:             13.1.1_p20230527::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.4::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

mv
    location: /var/db/repos/mv
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/mv.git
    masters: gentoo
    volatile: False

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

thegreatmcpain
    location: /var/db/repos/thegreatmcpain
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/thegreatmcpain.git
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe -fno-plt -flto=auto -falign-functions=32 -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/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=native -O3 -pipe -fno-plt -flto=auto -falign-functions=32 -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="-march=native -O3 -pipe -fno-plt -flto=auto -falign-functions=32 -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 multilib-strict 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="-march=native -O3 -pipe -fno-plt -flto=auto -falign-functions=32 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
GENTOO_MIRRORS="http://mirror.leaseweb.com/gentoo/     http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/     http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j16"
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"
SHELL="/bin/bash"
USE="X aac acl acpi amd64 branding bzip2 cairo cdr clang cli colord crypt dbus dri dvdr eds encode evo exif flac fortran gdbm gif gnome gnome-keyring gstreamer gtk gui iconv icu introspection jpeg keyring lcms libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf pgo pipewire png policykit ppds pulseaudio qt5 readline screencast sdl seccomp sound ssl startup-notification svg sysprof systemd test-rust tiff tracker truetype udev udisks unicode upower usb vaapi vulkan wayland wxwidgets x264 xattr xcb xft xml xv zlib zstd" ABI_X86="64" 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" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" GRUB_PLATFORMS="efi-64" 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="php8-1" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby32" 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, INSTALL_MASK, LC_ALL, LD, 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

=================================================================
                        Package Settings
=================================================================

net-libs/nodejs-20.3.0::gentoo was built with the following:
USE="icu inspector npm snapshot ssl system-icu system-ssl -debug -doc -lto -pax-kernel -test" ABI_X86="(64)" CPU_FLAGS_X86="sse2"
CFLAGS="-march=native -O3 -pipe -fno-plt -falign-functions=32 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,-O1 -Wl,--as-needed"
CXXFLAGS="-march=native -O3 -pipe -fno-plt -falign-functions=32 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,-O1 -Wl,--as-needed"
FEATURES="unmerge-logs config-protect-if-modified ipc-sandbox binpkg-multi-instance pid-sandbox ebuild-locks xattr buildpkg-live assume-digests network-sandbox binpkg-logs protect-owned distlocks usersync multilib-strict qa-unresolved-soname-deps binpkg-docompress strict merge-sync usersandbox binpkg-dostrip unknown-features-warn userfetch sandbox parallel-fetch sfperms fixlafiles preserve-libs unmerge-orphans news userpriv"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=native -O3 -pipe -fno-plt -falign-functions=32 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
Comment 3 William Hubbs gentoo-dev 2023-07-05 22:07:00 UTC
This has been disabled in the tree because of multiple issues with
different versions of nodejs.

Thanks,

William