Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Profile 23.0 binutils: C compiler cannot create ex..
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1247
Location: Edinburgh, UK

PostPosted: Tue Mar 26, 2024 3:10 pm    Post subject: [SOLVED]Profile 23.0 binutils: C compiler cannot create ex.. Reply with quote

Joining the Profile Prang'd Party, hi all fellow sufferers :D

I've followed the eselect news article faithfully up to step 9, but when rebuilding binutils it fails with:
Code:
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... no
configure: error: in `/tmp/portage/sys-devel/binutils-2.42-r1/work/build':
configure: error: C compiler cannot create executables


I'm (hopefully) upgrading from default/linux/amd64/17.1 to default/linux/amd64/23.0/split-usr. If I switch back to the former, I can rebuild binutils no problem.

One thing: The earlier step of emerge -uDN @world was (I think) done with an earlier version of binutils, which I depclean'd immediately afterwards. Is that likely the problem? Would rebuilding gcc with the newer binutils (under the old profile) be worth a try? (Takes a while so I'd welcome a tip on this.)

My CHOST did not change. I removed it from my make.conf as per instructions.

Code:
# emerge --info gcc
Portage 3.0.63 (python 3.11.8-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.39-r2, 6.8.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.8.1-gentoo-x86_64-Intel-R-_Xeon-R-_E-2224_CPU_@_3.40GHz-with-glibc2.39
KiB Mem:    16240948 total,  11418788 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 25 Mar 2024 20:30:00 +0000
Head commit of repository gentoo: 2d33c780bd1c0867858139e1d9e0a28ec36ae365
sh bash 5.2_p26
ld GNU gold (Gentoo 2.42 p3 2.42.0) 1.16
distcc 3.4 x86_64-pc-linux-gnu [disabled]
ccache version 4.9.1 [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.29.0::gentoo
dev-build/libtool:         2.4.7-r3::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.0-r1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r2::gentoo
dev-lang/python:           3.11.8_p1::gentoo, 3.12.2_p1::gentoo
dev-lang/rust-bin:         1.76.0::gentoo
dev-util/ccache:           4.9.1-r1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.53::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             13.2.1_p20240210::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            17.0.6::gentoo, 18.1.2::gentoo
sys-kernel/linux-headers:  6.7::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-max-age: 3

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

Installed sets: @kde, @mailsrv, @mplayer, @nodejs
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/portage/make.conf /usr/bin/pear /usr/bin/vncserver /usr/lib/X11/xdm/Xsetup_0 /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/hp/hplip.conf /etc/php/apache2-php8.1/ext-active/ /etc/php/apache2-php8.2/ext-active/ /etc/php/apache2-php8.3/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cgi-php8.3/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/cli-php8.3/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/fpm-php8.3/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/php/phpdbg-php8.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/home/cache/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --quiet-build=n --verbose-conflicts"
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"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live ccache distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/distfiles.gentoo.org/ http://mirrors.gethosted.online/gentoo http://mirrors.soeasyto.com/distfiles.gentoo.org/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en_GB"
MAKEOPTS="-j5"
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="/tmp"
SHELL="/bin/bash"
USE="X aac acl acpi amd64 apache2 bash-completion bzip2 cli crypt curl dbm dbus dri dv dvd elogind encode exif fam fat ffmpeg flac fortran ftp gd gdbm hardened iconv imagemagick imap imlib innodb ipv6 java javascript jpeg lcms libkms libtirpc libwww lto lzo mad matroska mdadm minimal mp3 multilib mysql ncurses network nls nsplugin ntfs offensive ogg openmp pam pcre pcre16 pdf php png policykit posix raw readline rtmp samba scanner seccomp session sharedmem soap split-usr ssl startup-notification test-rust theora threads tidy tiff tokenizer tordns truetype udev unicode usb vhosts x264 xattr xinetd xmlrpc xvid xz zip zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="access_compat actions alias auth_basic auth_digest authn_core authn_anon authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cache_disk cgid dav dav_fs dav_lock dbd deflate dir env expires ext_filter file_cache filter headers ident imagemap include info libass log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http proxy_wstunnel rewrite setenvif slotmem_shm so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" 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 sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-GB" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" SANE_BACKENDS="hp net" VIDEO_CARDS="vesa mga" 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, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

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

sys-devel/gcc-13.2.1_p20240210::gentoo was built with the following:
USE="(cxx) doc fortran hardened lto (multilib) nls openmp (pie) sanitize ssp zstd -ada -cet (-custom-cflags) -d -debug -default-stack-clash-protection -default-znow (-fixed-point) -go -graphite (-ieee-long-double) -jit (-libssp) -modula2 -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv" ABI_X86="(64)"
CFLAGS="-march=native -pipe -O2"
CXXFLAGS="-march=native -pipe -O2"
FEATURES="usersync buildpkg-live pid-sandbox userfetch userpriv binpkg-logs protect-owned binpkg-docompress multilib-strict distlocks assume-digests news sfperms unknown-features-warn fail-clean unmerge-orphans preserve-libs binpkg-multi-instance usersandbox sandbox binpkg-dostrip ccache pkgdir-index-trusted strict qa-unresolved-soname-deps network-sandbox fixlafiles merge-sync ipc-sandbox unmerge-logs ebuild-locks"


Last edited by Havin_it on Tue Mar 26, 2024 5:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1661

PostPosted: Tue Mar 26, 2024 3:29 pm    Post subject: Reply with quote

Please post the config.log given in the output to a paste site. That will reveal the true error.
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1247
Location: Edinburgh, UK

PostPosted: Tue Mar 26, 2024 4:11 pm    Post subject: Reply with quote

Pasted! HERE
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1661

PostPosted: Tue Mar 26, 2024 4:19 pm    Post subject: Reply with quote

Code:
configure:4518: checking whether the C compiler works
configure:4540: x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--undefined-version conftest.c  >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: pack-relative-relocs: unknown -z option
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status

Ensure your binutils is selected to the latest version (via binutils-config or eselect binutils) and try again. This does work with 2.41 for certain.
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1247
Location: Edinburgh, UK

PostPosted: Tue Mar 26, 2024 4:33 pm    Post subject: Reply with quote

Am using =binutils-2.42-r1. 2.41 was the version I just depclean'd.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1661

PostPosted: Tue Mar 26, 2024 4:45 pm    Post subject: Reply with quote

What does /usr/x86_64-pc-linux-gnu/bin/ld --version report? Does /usr/x86_64-pc-linux-gnu/bin/ld --help|grep pack-relative-relocs return anything?
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1247
Location: Edinburgh, UK

PostPosted: Tue Mar 26, 2024 4:51 pm    Post subject: Reply with quote

Code:
# /usr/x86_64-pc-linux-gnu/bin/ld --version
GNU gold (Gentoo 2.42 p3 2.42.0) 1.16
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.


No output from the other command.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1661

PostPosted: Tue Mar 26, 2024 4:54 pm    Post subject: Reply with quote

Looks like a gold incompatibility. gold is slowly being ignored and may or may not have a future. It will work with ld.bfd

Edit: the 23.0 profile adds this option by default to LDFLAGS where it is allowed. gold linker does not support it. It should be possible to override this with
Code:
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
in make.conf
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1247
Location: Edinburgh, UK

PostPosted: Tue Mar 26, 2024 5:38 pm    Post subject: Reply with quote

Rebuilt binutils with USE="-gold" (under 17.1) but I'm still getting the same failure after switching (same output you posted from config.log). Are there other steps to revert to ld.bfd? It's a long time since I changed this and the wiki only mentions the USE change.

EDIT: Disregard, I had package.env config enabling gold default also.

EDIT EDIT:

Banished gold (not sure it ever did much for me anyway) and binutils now rebuilding happily under 23.0. Thanks for the steers :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum