Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gcc build failed [SOLVED]
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
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 405

PostPosted: Sun Dec 29, 2024 9:13 pm    Post subject: Gcc build failed [SOLVED] Reply with quote

Code:
emerge --info '=sys-devel/gcc-14.2.1_p20241221::gentoo'
Portage 3.0.66.1 (python 3.12.8-final-0, default/linux/amd64/23.0/no-multilib, gcc-14, glibc-2.40-r5, 5.15.165-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.15.165-gentoo-dist-x86_64-Intel-R-_Core-TM-_i5-4200M_CPU_@_2.50GHz-with-glibc2.40
KiB Mem:     8043116 total,   3078720 free
KiB Swap:    9327612 total,   9327612 free
Timestamp of repository gentoo: Sun, 29 Dec 2024 00:45:00 +0000
Head commit of repository gentoo: 48d718a3354194cf3e571b5e83722df7fd55bc82
Timestamp of repository masterlay: Tue, 17 Dec 2024 22:21:44 +0000
Head commit of repository masterlay: 6db7649217ea20a9e5aad62f4f5d2b3900a436da

sh bash 5.2_p37
ld GNU ld (Gentoo 2.43 p3) 2.43.1
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.16.5-r2::gentoo
dev-build/cmake:           3.30.6::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.5.2::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.8::gentoo, 3.13.1::gentoo
dev-lang/rust-bin:         1.82.0-r101::gentoo
llvm-core/llvm:            17.0.6-r3::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/openrc:           0.55.1::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.43-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20241116::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r5::gentoo
Repositories:

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

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

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=haswell"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O2 -pipe -march=haswell"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 1"
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=haswell"
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 nodoc noinfo noman 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 -march=haswell"
GENTOO_MIRRORS="http://mirror.as43289.net/gentoo     rsync://212.110.163.13/gentoo/     https://mirrors.evoluso.com/gentoo/"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="--jobs 4"
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="/tmp"
SHELL="/bin/bash"
USE="X acl alsa amd64 asm bzip2 cet custom-cflags dist-kernel eudev gdbm iconv ipv6 jemalloc jit jpeg jpg jumbo-build libtirpc lm-sensors minimal native-extensions ncurses networkmanager openmp orc pam pcre ssl tcmalloc test-rust threads tkip unicode xattr xs zlib" 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="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 ssse3" 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" GRUB_PLATFORMS="pc" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput 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-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="intel i915 nouveau" 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, 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


Thank you

I have been using 8 gigabyte of ram, 8 gigabyte of swap.
4200m Intel cpu, i's not fresh install, it worked earlier.

Code:
2024-08-08T17:47:16 >>> sys-devel/gcc: 1:23:01
2024-11-25T13:49:49 >>> sys-devel/gcc: 1:40:34


Last edited by RIA77 on Mon Dec 30, 2024 6:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 423

PostPosted: Sun Dec 29, 2024 9:32 pm    Post subject: Reply with quote

You'll need to post the build.log too.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 405

PostPosted: Sun Dec 29, 2024 10:05 pm    Post subject: Reply with quote

Where I can find build log ?
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3810
Location: Rasi, Finland

PostPosted: Sun Dec 29, 2024 10:15 pm    Post subject: Reply with quote

RIA77 wrote:
Where I can find build log ?

When build fails emerge prints the location of the build.log at the end.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 405

PostPosted: Sun Dec 29, 2024 10:30 pm    Post subject: Reply with quote

I restarted, so I can't see emerge otput of exact location.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3810
Location: Rasi, Finland

PostPosted: Sun Dec 29, 2024 10:48 pm    Post subject: Reply with quote

Based on your earlier emerge --info paste you should have it user /tmp/portage.
Under there you should have directories like sys-devel and gcc-<version>.

Unless you have your PORTAGE_TMPDIR on tmpfs...
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 405

PostPosted: Mon Dec 30, 2024 4:23 pm    Post subject: Reply with quote

Here is build log

https://www.file.io/Equ6/download/PM0azgbPfh0W
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2055

PostPosted: Mon Dec 30, 2024 4:37 pm    Post subject: Reply with quote

Code:

: final link failed: No space left on device
/usr/x86_64-pc-linux-gnu/bin/ld: final link failed: No space left on device
/usr/x86_64-pc-linux-gnu/bin/ld: final link failed: No space left on device
collect2: error: ld returned 1 exit status


You seem to have run out of disk space.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 405

PostPosted: Mon Dec 30, 2024 4:50 pm    Post subject: Reply with quote

I am not sure.

Code:
Filesystem       Inodes  IUsed    IFree IUse% Mounted on
/dev/root       1836000 306617  1529383   17% /
devtmpfs        1004390    683  1003707    1% /dev
tmpfs            819200    906   818294    1% /run
shm             1005389      1  1005388    1% /dev/shm
tmpfs           1005389 151649   853740   16% /tmp
tmpfs            201077     18   201059    1% /run/user/1000
/dev/sda9      15261696   2461 15259235    1% /run/media/linux/4914fc93-1052-4880-a9fe-b3db49394ad9

I have 8 gigs of ram, enabled swap. My tmpfs is 4gb

Code:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        28G   12G   15G  44% /
devtmpfs         10M     0   10M   0% /dev
tmpfs           1.6G  1.5M  1.6G   1% /run
shm             3.9G     0  3.9G   0% /dev/shm
tmpfs           4.0G  3.0G  1.1G  75% /tmp
tmpfs           786M  4.0K  786M   1% /run/user/1000
/dev/sda9       229G  141G   88G  62% /run/media/linux/4914fc93-1052-4880-a9fe-b3db49394ad9
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31382
Location: here

PostPosted: Mon Dec 30, 2024 4:59 pm    Post subject: Reply with quote

The gcc need >4GB to compile on tmpfs, see the related wiki page.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54658
Location: 56N 3W

PostPosted: Mon Dec 30, 2024 5:05 pm    Post subject: Reply with quote

RIA77,


Code:
: final link failed: No space left on device
/usr/x86_64-pc-linux-gnu/bin/ld: final link failed: No space left on device
/usr/x86_64-pc-linux-gnu/bin/ld: final link failed: No space left on device
collect2: error: ld returned 1 exit status


Linking takes place in /var/tmp/portage by default.
That will be in / (root) unless you have changed it.

Code:
MAKEOPTS="--jobs 4"
is a bit much with only 8G real RAM and big C++ packages like gcc.
I'm not sure if linking is only single threaded or not, so it may not be your issue here.

You have plenty of i-nodes as shown by your
Code:
Filesystem       Inodes  IUsed    IFree IUse% Mounted on
/dev/root       1836000 306617  1529383   17% /

What about free space ?
Code:
df -h


/var/tmp/portage eventually fills with broken emerges unless you clean it out before you run emerge.

You may need to use
Code:
du -h -d1
recursively to track down the space hog,
Note:
Code:
rm bigfile
won't free the space if a process has bigfile open.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22901

PostPosted: Mon Dec 30, 2024 5:42 pm    Post subject: Reply with quote

RIA77 wrote:
I am not sure.
I have 8 gigs of ram, enabled swap. My tmpfs is 4gb
Code:
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           4.0G  3.0G  1.1G  75% /tmp
Your /tmp can grow to 4G, but is presently 75% used. If that usage isn't from a failed gcc build that would be wiped on next run, then you have much less than 4G available to build gcc. Your swap doesn't make tmpfs bigger, it only protects against exhausting RAM quite so soon.
NeddySeagoon wrote:
Linking takes place in /var/tmp/portage by default.
That will be in / (root) unless you have changed it.
OP's early output indicates it was moved to /tmp:
Code:
PORTAGE_TMPDIR="/tmp"
NeddySeagoon wrote:
What about free space ?
Code:
df -h
Although OP showed that, OP also reported restarting since the failure, so it's not clear that the OP's current df output is consistent with the system's state at the time of the failure.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 405

PostPosted: Mon Dec 30, 2024 6:58 pm    Post subject: Reply with quote

Tmp folder was mistake.
Changed tmpfs to /var/tmp/portage and it works.

Code:
2024-12-30T17:12:11 >>> sys-devel/gcc: 1:26:51


I was hoping for faster build, but that's another topic.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54658
Location: 56N 3W

PostPosted: Mon Dec 30, 2024 7:30 pm    Post subject: Reply with quote

RIA77,

Building in tmpfs does not improve build times. It only saves writes that will never be read. That may be a good thing for FLASH based storage.

tmpfs is the kernel disk cache with no place on disk.
It follows that if you have the RAM to build in tmpfs, the kernel cache will do it anyway.

The useless writes are all done by DMA, so CPU time is of the order of fractions of a second for gcc.
You can use tmpfs for most things, if you wish and build big things on disk.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
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