Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcc-12 Emerge Fails
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
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 754

PostPosted: Sun Mar 24, 2024 11:10 pm    Post subject: gcc-12 Emerge Fails Reply with quote

I unmerged GCC-12 (because I am using gcc-13) I forgot that gcc-12 is
needed by nvidia-cuda-toolkit. (Probably just for the install because I can still run stable diffusion.)

When I try to emerge gcc-12 I receive an error. See below. Any ideas on
re-emerging gcc-12? Should I try the binary version?

Code:
   end of emerge :
checking for x86_64-pc-linux-gnu-gcc... /tmp/portage/sys-devel/gcc-12.3.1_p20240209/work/build/./gcc/xgcc -B/tmp/portage/sys-devel/gcc-12.3.1_p20240209/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include   -fno-checking
checking for suffix of object files... configure: error: in `/tmp/portage/sys-devel/gcc-12.3.1_p20240209/work/build/x86_64-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make[2]: *** [Makefile:19067: configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory '/tmp/portage/sys-devel/gcc-12.3.1_p20240209/work/build'
make[1]: *** [Makefile:24875: stage1-bubble] Error 2
make: *** [Makefile:25223: bootstrap-lean] Error 2
 * ERROR: sys-devel/gcc-12.3.1_p20240209::gentoo failed (compile phase):
 *   emake failed
 *


Code:
$ emerge --info '=sys-devel/gcc-12.3.1_p20240209::gentoo'
Portage 3.0.61 (python 3.11.8-final-0, default/linux/amd64/23.0/split-usr, gcc-13, glibc-2.38-r10, 6.7.10-gentoo-2 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.7.10-gentoo-2-x86_64-13th_Gen_Intel-R-_Core-TM-_i9-13900K-with-glibc2.38
KiB Mem:    98672016 total,  69207656 free
KiB Swap:  262143996 total, 262143996 free
Timestamp of repository steam-overlay: Sun, 24 Mar 2024 09:48:29 +0000
Head commit of repository steam-overlay: 4db06d32f72ef46e43a840483a96d71f239c3bfd

Timestamp of repository gentoo: Sun, 24 Mar 2024 22:00:00 +0000
Head commit of repository gentoo: 8b8ba7f1e16e0d6b4811e8ced708041bcc9a4208
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.41 p5) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r6::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.28.3::gentoo
dev-build/libtool:         2.4.7-r3::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.3.2::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r2::gentoo
dev-lang/python:           2.7.18_p16-r2::gentoo, 3.10.13_p3::gentoo, 3.11.8_p1::gentoo, 3.12.2_p1::gentoo
dev-lang/rust:             1.75.0-r1::gentoo
sys-apps/baselayout:       2.14-r2::gentoo
sys-apps/openrc:           0.53::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.41-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20240210::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             17.0.6::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-kernel/linux-headers:  6.6::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r10::gentoo
Repositories:

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

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=raptorlake -O2 -fomit-frame-pointer -pipe -W -Wall"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /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/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 /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=raptorlake -O2 -fomit-frame-pointer -pipe -W -Wall"
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"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch 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 xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirrors.rit.edu/gentoo/     https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/     https://mirror.servaxnet.com/gentoo/     https://mirror.clarkson.edu/gentoo/     https://gentoo.osuosl.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j32"
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 Xaw3d a52 aac acl acpi alsa amd64 audiofile bash-completion bcmath bzip2 cairo caps cdparanoia cdr cet clamav crypt ctype cups dbus dga directfb dri dts dv dvd dvdr elogind encode esd ffmpeg fftw flac foomaticdb gcj gd gdbm gif glut gnutls gphoto2 gpm gstreamer gtk iconv icu imagemagick imap imlib ipv6 jpeg libglvnd libtirpc lm_sensors lzma lzo mad mariadb mikmod mjpeg mng mp3 mpeg mplayer multilib musepack nas ncurses nls nptl nvidia offensive ogg openal openexr opengl openmp orc pam pcre pdf perl plasma plotutils png policykit portaudio posix postscript ppds pulseaudio qt5 quicktime readline sasl sdl seccomp semantic-desktop slp sndfile sockets sox speex spell split-usr ssl svg syslog test-rust theora threads tiff truetype unicode usb vdpau vhosts vorbis win32codecs wmf x264 xattr xml xmp xpm xulrunner xvid xvmc zlib zstd" ABI_X86="64" ADA_TARGET="gcc_12" 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 ssse3 vpclmulqdq" 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" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" 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-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" SANE_BACKENDS="genesys" VIDEO_CARDS="nvidia" 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, 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


Code:
$ emerge -pqv '=sys-devel/gcc-12.3.1_p20240209::gentoo'
[ebuild  NS   ] sys-devel/gcc-12.3.1_p20240209 [13.2.1_p20240210] USE="cet (cxx) (default-stack-clash-protection) (default-znow) fortran (multilib) nls openmp (pie) sanitize ssp zstd -ada (-custom-cflags) -d -debug -doc (-fixed-point) -go -graphite -hardened (-ieee-long-double) -jit (-libssp) -lto -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv (-modula2%)"
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1468
Location: Earth

PostPosted: Sun Mar 24, 2024 11:45 pm    Post subject: Reply with quote

you should rather use the ebuild from pentoo https://gpo.zugaina.org/dev-util/nvidia-cuda-toolkit which will compile with gcc-13.

i assume you're already using a personal overlay - just copy the ebuild and enjoy.

8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 754

PostPosted: Mon Mar 25, 2024 12:25 am    Post subject: Reply with quote

CooSee: I am using nvidia-cuda-toolkit from the standard Gentoo repository.

I may try adding the pentoo repository. I see the nvidia-cuda-toolkit version is also newer.

Thank you for the suggestion.
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1468
Location: Earth

PostPosted: Mon Mar 25, 2024 2:43 pm    Post subject: Reply with quote

you're welcome!

look at https://wiki.gentoo.org/wiki/Creating_an_ebuild_repository

and howto handle multiple repositories https://forums.gentoo.org/viewtopic-p-8659032.html?sid=53a4e813df95fded4fba3c3fb4580945 - look at my post - use it as an example.

or clone pentoo repo to a Folder and copy the ebuild you need to your local repo.

8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 754

PostPosted: Tue Mar 26, 2024 3:19 am    Post subject: Reply with quote

In this case for only one package, I like the idea of my own e-build repository instead of a large repo with lots of packages. (I am making an assumption about the pentoo repo). The only down-side is that keeping it up-to-date relies on ME. Thank you for the links. I'll try it this coming weekend.

There is a "new" incentive for me to work on this ... I can not use "emerge --depclean" until fix this issue. (Also, --exclude does not seem to work with emerge --depclean ...) Here is what "emerge --depclean -p" gives which will be "fixed" after I move to a newer nvidia-cuda-toolkit ebuild that uses gcc-13 ..

Code:
Calculating dependencies... done!
 * Dependencies could not be completely resolved due to
 * the following required packages not being installed:
 *
 *   <sys-devel/gcc-13_pre[cxx] pulled in by:
 *     dev-util/nvidia-cuda-toolkit-12.3.2
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22578

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

jagdpanther wrote:
I unmerged GCC-12 (because I am using gcc-13) I forgot that gcc-12 is
needed by nvidia-cuda-toolkit.
emerge --depclean sys-devel/gcc:12 should have failed in this case. Do you mean that you used emerge --unmerge? If yes, don't do that. --unmerge will let you do dangerous things like remove critical packages.
jagdpanther wrote:
When I try to emerge gcc-12 I receive an error. See below. Any ideas on
re-emerging gcc-12? Should I try the binary version?
You did not provide sufficient information for us to help you. The build output directs you to check config.log for details, but you did not post or pastebin this. Please upload it to a pastebin for us to review.
jagdpanther wrote:
Code:
CFLAGS="-march=raptorlake -O2 -fomit-frame-pointer -pipe -W -Wall"
As I read gcc 13 changes, support for -march=raptorlake is new in gcc-13. I expect gcc-12 will fail to run when passed this -march. From my system:
Code:
$ gcc-12 -x c -c /dev/null -o /dev/null -march=raptorlake
cc1: error: bad value 'raptorlake' for '-march=' switch
cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 znver4 btver1 btver2 native
$ gcc-13 -x c -c /dev/null -o /dev/null -march=raptorlake
$
You will likely need to use an older -march when building gcc-12. However, I expect this is not your only problem, so you still should share the config.log that gcc directed you to read.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 754

PostPosted: Thu Mar 28, 2024 1:13 am    Post subject: Reply with quote

I'll try the local repository path forward to use a newer cuda first and if I have issues then I'll try to reinstall gcc-12 to use the slightly older Gentoo repository provided cuda.

Hu: Yes, I did a bad thing and used emerge --unmerge sys-devel/gcc:12. I did this after having to run "emerge --resume --skipfirst" to skip over gcc-12 in the middle of step 16 of the profile upgrade to version 23. At the end of that very long emerge I did the quick emerge --unmerge gcc:12. At the beginning of the profile upgrade I switched to -march=raptorlake from -march=native as native did not work. (I think an i9-13900k should be raptorlake.) I ASSUME there was no issue with the emerge of cuda because I had not yet deleted gcc-12.


CooSee: Following the instructions in the Gentoo Wiki https://wiki.gentoo.org/wiki/Creating_an_ebuild_repository seem to work. One issue is that when I first tried to use it emerge didn't see the new package. eix gave me a clue:
Code:
$ eix nvidia-cuda-toolkit
[I] dev-util/nvidia-cuda-toolkit
     Available versions:  (~)11.8.0-r4(0/11.8.0)^md (~)12.3.2(0/12.3.2)^md **12.4.0(0/12.4.0)


The eix man page stated that the "**" meant
" This means the version is "masked by missing keyword" for all architectures."

So removed the comment hash mark on the following line in the ebuild file:
Code:
KEYWORDS="-* ~amd64 ~amd64-linux"


The 2nd issue, that I haven't fixed is during the emerge I receive:

Code:
...
>>> Source unpacked in /tmp/portage/dev-util/nvidia-cuda-toolkit-12.4.0/work
>>> Preparing source in /tmp/portage/dev-util/nvidia-cuda-toolkit-12.4.0/work ...
sed: can't read /tmp/portage/dev-util/nvidia-cuda-toolkit-12.4.0/files/cuda-config.in: No such file or directory
...


An ls -l shows that files is really a symbolic link back to my new repo to a directory that does not exist:
Code:
files -> /var/db/repos/local/dev-util/nvidia-cuda-toolkit/files


The only two things in /var/db/repos/local/dev-util/nvidia-cuda-toolkit are "Manifest" and "nvidia-cuda-toolkit-12.4.0.ebuild".

Any ideas?


Last edited by jagdpanther on Thu Mar 28, 2024 1:27 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22578

PostPosted: Thu Mar 28, 2024 1:23 am    Post subject: Reply with quote

You may wish to read my post in open-vm-tools not available for ARM, where someone else trying to use a local repository encountered the same problem. In short, the ebuild expects to use the files directory from the directory containing the ebuild. If you fork the ebuild, you need to copy or link back to the original files directory.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 754

PostPosted: Thu Mar 28, 2024 2:00 am    Post subject: Reply with quote

Hu: Thanks.

My solution. (Although I would like to get my new local repo up and running with the newer cuda but I don't need it.)

eselect repository disable -f local # because it is currently not working and the only package is cuda

edit /etc/portage/make.conf to

Code:
...
# next line commented out because of GCC recompile failure when switching
#    from Gentoo profile 17.1 to 23.0
#COMMON_FLAGS="-march=native -O2 -fomit-frame-pointer -pipe"
# The following is used just long enough in profile 23 to 
#    emerge  gcc-12 which is needed for the version of
#    nvidia-cuda-tools in the Gentoo repository.
#    gcc-12 does NOT like -march=[raptorlake|native]
COMMON_FLAGS="-O2 -fomit-frame-pointer -pipe"
#  currently using i9-13900k:  raptorlake  for profile 23
#COMMON_FLAGS="-march=raptorlake -O2 -fomit-frame-pointer -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
...


emerge --update --deep --changed-use @world
# only package emerged is gcc-12

edit /etc/portage/make.conf back to

Code:
# COMMON_FLAGS="-O2 -fomit-frame-pointer -pipe"
#  currently using i9-13900k:  raptorlake  for profile 23
COMMON_FLAGS="-march=raptorlake -O2 -fomit-frame-pointer -pipe"


Now everything works including "emerge --depclean"


Is there a "proper" way to change COMMON_FLAGS for just gcc-12?


If anyone is curious:
Code:
Current /etc/portage/make.profile symlink:
  default/linux/amd64/23.0/split-usr

I am not using systemd
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22578

PostPosted: Thu Mar 28, 2024 2:14 am    Post subject: Reply with quote

It looks like you just need to override CFLAGS / CXXFLAGS for gcc-12. Many people use package.env to apply per-package overrides of specific environment variables. I expect that would work here.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1938

PostPosted: Thu Mar 28, 2024 2:20 am    Post subject: Reply with quote

We may be able to update downgrade_arch_flags in toolchain.eclass to handle this if someone knows what it would be appropriate to replace raptorlake with for older GCCs.
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