Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 636858 - sys-devel/gcc-6.4.0 requires more than 4G space to build
Summary: sys-devel/gcc-6.4.0 requires more than 4G space to build
Status: RESOLVED DUPLICATE of bug 526986
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-08 11:31 UTC by Mike Limansky
Modified: 2017-12-16 23:21 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Limansky 2017-11-08 11:31:00 UTC
I've tried to emerge gcc-6.4.0 but the build failed because I have only 4G in /var/tmp/portage
Comment 1 Ben Kohler gentoo-dev 2017-11-08 13:37:09 UTC
You should allocate some more space then
Comment 2 Mike Limansky 2017-11-08 13:56:17 UTC
(In reply to Ben Kohler from comment #1)
> You should allocate some more space then

Of course I should. The issue is that the package should notify that it requires that amount of space on pkg_pretend phase, but not after an hour of compilation. AFAIK, there is a check-reqs eclass to do such things.
Comment 3 Ben Kohler gentoo-dev 2017-11-08 13:59:40 UTC
Can you do a little more legwork, find out just how much space it actually needed, and also share your "emerge --info gcc" so we can see what options you're building it with?
Comment 4 Mike Limansky 2017-11-08 14:19:39 UTC
Here is the emerge --info gcc output:

sys-devel/gcc-6.4.0::gentoo was built with the following:
USE="cxx fortran (multilib) nls nptl openmp pch sanitize ssp vtv (-altivec) (-awt) -cilk -debug -doc (-fixed-point) (-gcj) -go -graphite (-hardened) (-jit) (-libssp) -mpx -objc -objc++ -objc-gc -pgo (-pie) -regression-test -vanilla" ABI_X86="(64)"
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="-march=native -O2 -pipe"

I'm not sure what is the best way to get a required amount of space. And I suppose it depends on the use flags. While building it I found that it cleans  the space up several times (possible between each phase).
Comment 5 Andrei Slavoiu 2017-11-09 18:52:54 UTC
This is a way to automate it:

Add to your make.conf file these lines:
PORTAGE_ELOG_CLASSES="info warn error log qa"
PORTAGE_ELOG_SYSTEM="save"

and after that for each package that is built a file with the name /var/log/portage/elog/<category>\:<name>-<version>\:<timestamp>.log will be generated. If you don't like having lots of files in a single directory you can also enable to split-elog feature so that subdirs will be created for each package category.

Now, this files will contain quite a lot of info in the case of large packages like gcc so you can extract the esential with this command:
grep -e USE -e FEATURES -e FLAGS -e size

In my case the output is:
USE:        abi_x86_64 amd64 cxx elibc_glibc fortran kernel_linux multilib nls nptl openmp pch pgo sanitize ssp userland_GNU vtv
FEATURES:   compressdebug installsources preserve-libs sandbox splitdebug userpriv usersandbox
strip-flags: CFLAGS: changed '-march=native -g3 -gdwarf-4 -O2 -pipe -gz' to '-march=native -g3 -gdwarf-4 -O2 -pipe'
strip-flags: CXXFLAGS: changed '-march=native -g3 -gdwarf-4 -O2 -pipe -gz' to '-march=native -g3 -gdwarf-4 -O2 -pipe'
CFLAGS="-march=native -g3 -gdwarf-4 -O2 -pipe"
CXXFLAGS="-march=native -g3 -gdwarf-4 -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--threads -Wl,-z,now"
Final size of build directory: 8471992 KiB (  8.0 GiB)
Final size of installed tree:   850312 KiB (830.3 MiB)

For you it should be less as you don't have debug flags enabled so do post your results as well. And remember to cleanup the /var/log/portage/elog from time to time as it might grow to significant size.
Comment 6 Mike Limansky 2017-11-09 21:21:03 UTC
I've installed gcc-6.4.0 on my other box and got following results:

USE:        abi_x86_64 amd64 cxx elibc_glibc fortran kernel_linux multilib nls nptl openmp pch sanitize ssp userland_GNU vtv
FEATURES:   preserve-libs sandbox userpriv usersandbox
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="-march=native -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
Final size of build directory: 2436540 KiB
Final size of installed tree: 175024 KiB

So the final size is less than 4G. I think that it perform some cleaning while building, so the final size is quite small, but the temporary size can be bigger. Maybe it's easier to use something like
$ watch du -hd0 /var/tmp/portage/sys-devel/gcc-6.4.0t
Comment 7 Felix Tiede 2017-12-09 10:59:42 UTC
I just ran (IIRC even *again*) into that very same problem.

I have allocated 6GB of space for /var/tmp/portage, and it still was not enough to build sys-devel/gcc-6.4.0 on my system.

I agree there is some cleanup happening during build-time as the "no space left on device" error popped up around some "unlink" operations in a ./configure-script.

So I suggest sys-devel/gcc should verify to have at least 7GB or more space available in $PORTAGE_TMPDIR.

# emerge --info sys-devel/gcc
Portage 2.3.13 (python 3.4.5-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-6.4.0, glibc-2.25-r9, 4.13.15-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.13.15-gentoo-x86_64-Intel-R-_Core-TM-_i7-7600U_CPU_@_2.80GHz-with-gentoo-2.4.1
KiB Mem:    16296696 total,   1667020 free
KiB Swap:   17823736 total,  17823736 free
Timestamp of repository gentoo: Sat, 09 Dec 2017 02:15:01 +0000
Head commit of repository gentoo: d55c7cd0634878b8a0e9a64338f01a00a5857934
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
distcc 3.2rc1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.9::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.14.1-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.28.1::gentoo, 2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: --ignore-errors

oss-tools
    location: /usr/local/svn-portage
    masters: gentoo
    priority: 0

local
    location: /usr/local/portage
    masters: gentoo
    priority: 1

flow
    location: /var/lib/layman/flow
    sync-type: laymansync
    sync-uri: https://gitlab.com/Flow/flow-s-ebuilds.git
    masters: gentoo
    priority: 50

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

palemoon
    location: /var/lib/layman/palemoon
    sync-type: laymansync
    sync-uri: https://github.com/deu/palemoon-overlay.git
    masters: gentoo
    priority: 50

qownnotes-overlay
    location: /var/lib/layman/qownnotes-overlay
    sync-type: laymansync
    sync-uri: https://github.com/pbek/qownnotes-overlay.git
    masters: gentoo
    priority: 50

Installed sets: @kdevelop
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA OPERA-12 cadsoft AdobeFlash-11.x MakeMKV-EULA PUEL Oracle-BCLA-JavaSE google-chrome"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -maes -mavx -mcx16 -mfxsr -mpclmul -mpopcnt -msahf -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt -O2 -pipe -fomit-frame-pointer -fforce-addr -ftracer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/fax /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/spool/fax/etc"
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 /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -maes -mavx -mcx16 -mfxsr -mpclmul -mpopcnt -msahf -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt -O2 -pipe -fomit-frame-pointer -fforce-addr -ftracer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n --with-bdeps=y --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://de-mirror.org/gentoo/ http://ftp.halifax.rwth-aachen.de/gentoo/ http://mirror.leaseweb.com/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j13 -l3"
PKGDIR="/var/tmp/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--ignore-errors"
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"
USE="X Xaw3d a52 aac aalib acl acpi activities alsa amd64 avx avx2 baloo branding bzip2 c++0x cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dga dri dts dvd dvdr emboss encode evdev exif fam fbcon ffmpeg firefox flac gif glamor gmp gpm gstreamer htmlhandbook http2 iconv imlib ipv6 jpeg kde kipi kwallet latex lcms ldap libnotify lzma mad mikmod mmx mng modules mp3 mp4 mpeg multilib ncurses nepomuk nls nptl ogg opengl openmp opus pam pango pcre pdf pgo phonon plasma png policykit ppds qml qt3support qt5 quicktime readline sdl seccomp semantic-desktop session spell sse sse2 sse3 sse4_1 ssl ssse3 startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower usb v4l vaapi vim-syntax vorbis widgets x264 xattr xcb xcomposite xinerama xml xprint xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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_EXPERIMENTAL_FEATURES="braindump" CALLIGRA_FEATURES="braindump flow gemini karbon kexi krita plan stage tables sheets words" CAMERAS="canon ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev joystick keyboard libinput mouse synaptics" KERNEL="linux" L10N="de de-1901 en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer nlpsolver pdfimport" LINGUAS="de en en_US" LLVM_TARGETS="BPF NVPTX X86" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python3_4 python2_7" RUBY_TARGETS="ruby22 ruby23" SANE_BACKENDS="dell1600n_net net" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

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

sys-devel/gcc-6.4.0::gentoo was built with the following:
USE="cxx doc fortran graphite (multilib) nls nptl openmp pch pgo sanitize ssp vtv (-altivec) (-awt) -cilk -debug (-fixed-point) (-gcj) -go (-hardened) (-jit) (-libssp) -mpx -objc -objc++ -objc-gc (-pie) -regression-test -vanilla" ABI_X86="(64)"
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="-march=native -O2 -pipe"
Comment 8 Felix Tiede 2017-12-09 11:15:19 UTC
Also, for documentation the output of the successful build regarding required sizes:

>>> Completed installing gcc-6.4.0 into /var/tmp/portage/sys-devel/gcc-6.4.0/image/

 * Final size of build directory: 6571264 KiB (  6.2 GiB)
 * Final size of installed tree:   188712 KiB (184.2 MiB)
Comment 9 Andreas K. Hüttel archtester gentoo-dev 2017-12-16 23:21:12 UTC
The space requirements of gcc vary wildly, e.g. depending on use flag settings and CFLAGS. So far noone has made the huge required table...

*** This bug has been marked as a duplicate of bug 526986 ***