Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 621848 - dev-libs/klibc-2.0.4-r2 does not build with PIC enabled
Summary: dev-libs/klibc-2.0.4-r2 does not build with PIC enabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
: 646322 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-15 18:47 UTC by Xavier Miller (RETIRED)
Modified: 2018-02-27 09:34 UTC (History)
23 users (show)

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


Attachments
build.log (build.log,6.30 KB, text/x-log)
2017-06-15 18:47 UTC, Xavier Miller (RETIRED)
Details
Changed KV_SUB to 9 and get this error (build.log,76.09 KB, text/plain)
2018-01-12 14:42 UTC, Oliver Hildebrandt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Miller (RETIRED) gentoo-dev 2017-06-15 18:47:01 UTC
Created attachment 476614 [details]
build.log

Testing 17.0 profile, PIC is enabled, and I got this error message while emerging klibc:

kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
Comment 1 Xavier Miller (RETIRED) gentoo-dev 2017-06-15 18:47:41 UTC
# emerge --info '=dev-libs/klibc-2.0.4-r2::gentoo'
Portage 2.3.6 (python 2.7.13-final-0, default/linux/amd64/17.0/no-multilib, gcc-6.3.0, glibc-2.24-r2, 4.11.5-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.11.5-gentoo-x86_64-AMD_Athlon-tm-64_X2_Dual_Core_Processor_4400+-with-gentoo-2.4.1
KiB Mem:     2054048 total,    203724 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Thu, 15 Jun 2017 09:00:01 +0000
sh bash 4.4_p12
ld GNU ld (Gentoo 2.28 p1.2) 2.28
distcc 3.2rc1 x86_64-gentoo-linux-gnu [enabled]
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.13::gentoo, 3.4.6::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1::gentoo
sys-apps/openrc:          0.27.2::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r3::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.28-r2::gentoo
sys-devel/gcc:            6.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.24-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://anongit.gentoo.org/repo/gentoo.git
    priority: -1000

gentoo-kodi-overlay
    location: /usr/local/portage/gentoo-kodi-overlay
    masters: gentoo
    priority: 0

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

proaudio
    location: /var/lib/layman/proaudio
    masters: gentoo
    priority: 50

xmw
    location: /var/lib/layman/xmw
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE as-is freedist"
CBUILD="x86_64-gentoo-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=k8-sse3 -mtune=k8"
CHOST="x86_64-gentoo-linux-gnu"
CONFIG_PROTECT="/etc /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 /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=k8-sse3 -mtune=k8"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --quiet-build=n --buildpkg"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg candy config-protect-if-modified distcc distcc-pump distlocks ebuild-locks fixlafiles merge-sync 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="ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="fr_BE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--as-needed"
MAKEOPTS="-j5 -l3"
PKGDIR="/var/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="/var/tmp"
USE="3dnow 3dnowext X a52 aac acpi alsa amd64 apng branding bzip2 cairo cdda cli consolekit cracklib crossdev crypt cryptsetup css cxx dbus dlna dri dts dvd exif flac gif gpm gtk gudev iconv joystick jpeg lcms libcanberra libinput libnotify mad mmx mng modules mp3 mpeg ncurses nls nptl ogg opengl openmp opus pam pango pcre pdf png policykit python3 qt5 readline sane scanner sdl seccomp session sna sndfile snmp spell sqlite sse sse2 ssl startup-notification svg tcpd tiff truetype udev unicode upnp upower usb vdpau vorbis wmf x264 xattr xcb xinerama xml xosd xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="ice1712 hda-intel usb-audio virmidi" 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="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 sse3" 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" INPUT_DEVICES="keyboard mouse joystick libinput" KERNEL="linux" L10N="fr nl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr fr_FR fr_BE nl nl_NL nl_BE" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="nvidia" 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, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

dev-libs/klibc-2.0.4-r2::gentoo was built with the following:
USE="-custom-cflags -debug -test"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=k8-sse3 -mtune=k8 -nostdlib"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=k8-sse3 -mtune=k8 -nostdlib"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--as-needed -z noexecstack"
Comment 2 Xavier Miller (RETIRED) gentoo-dev 2017-06-23 08:03:27 UTC
to make the kernel, I do so

make CC="gcc -fuse-ld=bfd -Wl,-fuse-ld=bfd" LDFLAGS="-fuse-ld=bfd"

is it possible to hack that for klibc?

(will check it soon)
Comment 3 devsk 2017-10-08 12:01:36 UTC
This is because of PIE being enabled by default by GCC 6.

See https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1574982

I wonder if we can hack the klibc to build with -fno-PIE
Comment 4 Martin DiViaio 2017-11-24 16:43:04 UTC
For what it's worth... I fixed this by modifying the kernel version line in the klibc-2.0.4-r2.ebuild file.

The original was:
KV_MAJOR="4" KV_MINOR="x" KV_SUB="4"

I set it to:
KV_MAJOR="4" KV_MINOR="x" KV_SUB="13"

It appears that the package compiles a puppy kernel to compile the klibc libraries against. This line in the ebuild tells it what version it's compiling. The "kernel does not support PIC mode" error is actually coming from the kernel compile phase of the install.

In my case: I feel safe setting the KV_SUB variable to 13 since I'm running a 4.13 kernel but you may want to compare this line to your currently running kernel.

Thanks.
Comment 5 Jiří Moravec 2017-11-24 21:24:20 UTC
Thanks Martin, you just saved my day. :-))
Comment 6 Uladzimir Bely 2017-12-02 08:07:47 UTC
Modifying version in ebuild also worked for me.
Comment 7 Pat Erley 2017-12-02 19:57:24 UTC
4.9 is a LTS kernel value that fixes this, so I'd suggest going with that rather than newer.  It's also likely to be a value that could be made the default in the ebuild.
Comment 8 Pacho Ramos gentoo-dev 2017-12-03 11:55:15 UTC
Does anyone want to proxy maintain this?
https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers
Comment 9 Conrad Kostecki gentoo-dev 2017-12-03 17:44:11 UTC
(In reply to Pat Erley from comment #7)
> 4.9 is a LTS kernel value that fixes this, so I'd suggest going with that
> rather than newer.  It's also likely to be a value that could be made the
> default in the ebuild.

Yep, setting KV_SUB="9" does the job. KV_SUB="14" works too, shouldn't be 4.14 the next LTS kernel?
Comment 10 Neil 2017-12-05 15:36:54 UTC
> Yep, setting KV_SUB="9" does the job. KV_SUB="14" works too, shouldn't be 4.14 the next LTS kernel?

Worked here too.

Needed klibc to produce an initramfs.
Comment 11 bluenuht 2017-12-06 21:43:43 UTC
Can you confirm that the fix is currently

edit /usr/portage/dev-libs/klibc/klibc-2.0.4-r2.ebuild changing the 25 line from 
KV_MAJOR="4" KV_MINOR="x" KV_SUB="4"
to 
KV_MAJOR="4" KV_MINOR="x" KV_SUB="14"

run 
ebuild /usr/portage/dev-libs/klibc/klibc-2.0.4-r2.ebuild digest
to validate the change and then emerge with
emerge -av dev-libs/klibc
?


The emerge succeeded but I do not know how to test that klibc emerged is in a "good" state.

Should I have matched the KV with uname -r ?
Mine is currently 4.12.12-gentoo

what is the best way to continue the emerge -e @world profile switch ?

What is the time frame on an official fix ?

Sorry for all the newb questions.
Comment 12 diamond 2017-12-07 09:38:13 UTC
Projected EOL for 4.4 is Feb, 2022. 4.9 is Jan, 2019 and 4.14 is Jan, 2020.
https://www.kernel.org/category/releases.html
So, it's better to fix this bug for 4.4 kernel instead of upgrading kernel.
Comment 13 Neil 2017-12-07 09:43:33 UTC
(In reply to bluenuht from comment #11)
> Can you confirm that the fix is currently
> 
> edit /usr/portage/dev-libs/klibc/klibc-2.0.4-r2.ebuild changing the 25 line
> from 
> KV_MAJOR="4" KV_MINOR="x" KV_SUB="4"
> to 
> KV_MAJOR="4" KV_MINOR="x" KV_SUB="14"
> 
> run 
> ebuild /usr/portage/dev-libs/klibc/klibc-2.0.4-r2.ebuild digest
> to validate the change and then emerge with
> emerge -av dev-libs/klibc
> ?


I tend not to mess around with ebuilds from portage and instead created a local overlay using the existing ebuild but making the change in that.

Can't comment on testing it I'm afraid but I rebuilt my initramfs and rebooted fine so it seems to "just work(TM)".
Comment 14 diamond 2017-12-07 09:54:14 UTC
Does anybody have success with 4.4 kernel?
Comment 15 thomas 2017-12-31 10:02:48 UTC
klibc compiles when I change the version to "9".

However, splashutils, which is the only package that needs klibc, fails to compile with:
/usr/lib64/klibc/include/limits.h:43:26: fatal error: linux/limits.h: No such file or directory

See also https://bugs.gentoo.org/639742.

I don't know if the splashutils error is because of the change in the ebuild of klibc, because splashutils failed to compile without that change, too.

Both failed during emerge -e @world after switching to GCC 6.
Comment 16 Oliver Hildebrandt 2018-01-12 14:42:56 UTC
Created attachment 514486 [details]
Changed KV_SUB to 9 and get this error

usr/klibc/sigsuspend.c:8:10: Kfatal error: Kklibc/havesyscall.h: No such file or directory
 #include <klibc/havesyscall.h>
compilation terminated.
make[2]: *** [/var/tmp/portage/dev-libs/klibc-2.0.4-r99/work/klibc-2.0.4/scripts/Kbuild.klibc:254: usr/klibc/sigsuspend.o] Error 1
make[1]: *** [/var/tmp/portage/dev-libs/klibc-2.0.4-r99/work/klibc-2.0.4/./Kbuild:9: all] Error 2
make: *** [Makefile:119: klibc] Error 2

When i compile klibc with KV_SUB set to 9 or 14 i get this error and don't know how to fix it.

Here is the 'Output from emerge --info:
Portage 2.3.19 (python 2.7.14-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-7.2.0, glibc-2.26-r5, 4.14.12-gentoo-VM x86_64)
=================================================================
System uname: Linux-4.14.12-gentoo-VM-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.4.1
KiB Swap:    2097148 total,   2094844 free
Timestamp of repository gentoo: Wed, 10 Jan 2018 09:28:54 +0000
Head commit of repository gentoo: ef54db470d2fae2fb815fa1ab1a4b92c0d7a6ef8

sh bash 4.3_p48-r1
ld GNU gold (Gentoo 2.29.1 p3 2.29.1) 1.14
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.10.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0::gentoo, 7.2.0::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo
    priority: -1000

Ollis-Overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 20

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

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -mtune=bdver2 -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xorg.conf.d /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 /etc/splash /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe -mtune=bdver2 -fomit-frame-pointer"
DISTDIR="/usr/local/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask-write=y --with-bdeps=y --jobs=6 --load-average=6 --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/ http://mirror.leaseweb.com/gentoo/ http://de-mirror.org/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-march=native -O2 -pipe -mtune=bdver2 -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j7 -l6"
PKGDIR="/usr/local/packages"
PORTAGE_BUNZIP2_COMMAND="/usr/bin/lbunzip2"
PORTAGE_BZIP2_COMMAND="/usr/bin/lbzip2"
PORTAGE_COMPRESS="/usr/bin/lbzip2"
PORTAGE_COMPRESS_FLAGS="-9"
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"
USE="X a52 aac aacplus acpi activities addc aes aio alsa amd64 ao apng arj aspell avx bash-completion berkdb bluray branding btrfs bzip2 c++0x c++11x cacao cairo cdda cdr cgroup cgroups clang cleartype cli client cmake colord console consolekit corefonts crypt cups curl cxx d3d9 dbus declarative dri dri3 drm dts dv dvd dvdr editor efi egl emboss emf encode evdev exif f16c faac faad fam fat fbcon ffmpeg fftw firefox flac fltk fma fma3 fma4 fontconfig foomaticdb fortran fpm fuse g-sorcery gallium games gbm gcrypt gd gdbm gif gimp git glamor glut glx gmp gnupg gnutls gold gpg gpm graphite grub gsm gtk gtk2 gtk3 harfbuzz hunspell i18n iconv icu id3tag imagemagick innodb-snappy inotify introspection iproute2 ipv6 iso ispell ithreads jack java javascript jbig jit jpeg jpeg2k jpg kde kipi kmod kms kwallet l10n ladspa lame largepages latin1 lcms ldap ldapdb legacy-sys
Comment 17 Oliver Hildebrandt 2018-01-12 15:08:14 UTC
(In reply to Oliver Hildebrandt from comment #16)
> Created attachment 514486 [details]
> Changed KV_SUB to 9 and get this error
> 
> usr/klibc/sigsuspend.c:8:10: Kfatal error: Kklibc/havesyscall.h: No such
> file or directory
>  #include <klibc/havesyscall.h>
> compilation terminated.
> make[2]: ***
> [/var/tmp/portage/dev-libs/klibc-2.0.4-r99/work/klibc-2.0.4/scripts/Kbuild.
> klibc:254: usr/klibc/sigsuspend.o] Error 1
> make[1]: ***
> [/var/tmp/portage/dev-libs/klibc-2.0.4-r99/work/klibc-2.0.4/./Kbuild:9: all]
> Error 2
> make: *** [Makefile:119: klibc] Error 2
> 
> When i compile klibc with KV_SUB set to 9 or 14 i get this error and don't
> know how to fix it.
> 
> Here is the 'Output from emerge --info:
> Portage 2.3.19 (python 2.7.14-final-0,
> default/linux/amd64/17.0/desktop/plasma, gcc-7.2.0, glibc-2.26-r5,
> 4.14.12-gentoo-VM x86_64)
> =================================================================
> System uname:
> Linux-4.14.12-gentoo-VM-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-
> gentoo-2.4.1
> KiB Swap:    2097148 total,   2094844 free
> Timestamp of repository gentoo: Wed, 10 Jan 2018 09:28:54 +0000
> Head commit of repository gentoo: ef54db470d2fae2fb815fa1ab1a4b92c0d7a6ef8
> 
> sh bash 4.3_p48-r1
> ld GNU gold (Gentoo 2.29.1 p3 2.29.1) 1.14
> app-shells/bash:          4.3_p48-r1::gentoo
> dev-java/java-config:     2.2.0-r3::gentoo
> dev-lang/perl:            5.26.1-r1::gentoo
> dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
> dev-util/cmake:           3.10.1::gentoo
> dev-util/pkgconfig:       0.29.2::gentoo
> sys-apps/baselayout:      2.4.1-r2::gentoo
> sys-apps/openrc:          0.34.11::gentoo
> sys-apps/sandbox:         2.12::gentoo
> sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
> sys-devel/automake:       1.15.1-r1::gentoo
> sys-devel/binutils:       2.29.1-r1::gentoo
> sys-devel/gcc:            6.4.0::gentoo, 7.2.0::gentoo
> sys-devel/gcc-config:     1.9.1::gentoo
> sys-devel/libtool:        2.4.6-r4::gentoo
> sys-devel/make:           4.2.1-r1::gentoo
> sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
> sys-libs/glibc:           2.26-r5::gentoo
> Repositories:
> 
> gentoo
>     location: /usr/portage
>     sync-type: git
>     sync-uri: https://github.com/gentoo-mirror/gentoo
>     priority: -1000
> 
> Ollis-Overlay
>     location: /usr/local/portage
>     masters: gentoo
>     priority: 20
> 
> x11
>     location: /var/lib/layman/x11
>     sync-type: laymansync
>     sync-uri: git://anongit.gentoo.org/proj/x11
>     masters: gentoo
>     priority: 50
> 
> ACCEPT_KEYWORDS="amd64 ~amd64"
> ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x"
> CBUILD="x86_64-pc-linux-gnu"
> CFLAGS="-march=native -O2 -pipe -mtune=bdver2 -fomit-frame-pointer"
> CHOST="x86_64-pc-linux-gnu"
> CONFIG_PROTECT="/etc /usr/share/X11/xorg.conf.d /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 /etc/splash /etc/terminfo"
> CXXFLAGS="-march=native -O2 -pipe -mtune=bdver2 -fomit-frame-pointer"
> DISTDIR="/usr/local/distfiles"
> EMERGE_DEFAULT_OPTS="--autounmask-write=y --with-bdeps=y --jobs=6
> --load-average=6 --keep-going"
> FCFLAGS="-O2 -pipe"
> FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks
> ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch
> parallel-install preserve-libs protect-owned sandbox sfperms strict
> unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv
> usersandbox usersync"
> FFLAGS="-O2 -pipe"
> GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/
> http://mirror.leaseweb.com/gentoo/ http://de-mirror.org/gentoo/
> http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
> LANG="de_DE.utf8"
> LC_ALL="de_DE.utf8"
> LDFLAGS="-march=native -O2 -pipe -mtune=bdver2 -fomit-frame-pointer -Wl,-O1
> -Wl,--as-needed"
> LINGUAS="de"
> MAKEOPTS="-j7 -l6"
> PKGDIR="/usr/local/packages"
> PORTAGE_BUNZIP2_COMMAND="/usr/bin/lbunzip2"
> PORTAGE_BZIP2_COMMAND="/usr/bin/lbzip2"
> PORTAGE_COMPRESS="/usr/bin/lbzip2"
> PORTAGE_COMPRESS_FLAGS="-9"
> 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"
> USE="X a52 aac aacplus acpi activities addc aes aio alsa amd64 ao apng arj
> aspell avx bash-completion berkdb bluray branding btrfs bzip2 c++0x c++11x
> cacao cairo cdda cdr cgroup cgroups clang cleartype cli client cmake colord
> console consolekit corefonts crypt cups curl cxx d3d9 dbus declarative dri
> dri3 drm dts dv dvd dvdr editor efi egl emboss emf encode evdev exif f16c
> faac faad fam fat fbcon ffmpeg fftw firefox flac fltk fma fma3 fma4
> fontconfig foomaticdb fortran fpm fuse g-sorcery gallium games gbm gcrypt gd
> gdbm gif gimp git glamor glut glx gmp gnupg gnutls gold gpg gpm graphite
> grub gsm gtk gtk2 gtk3 harfbuzz hunspell i18n iconv icu id3tag imagemagick
> innodb-snappy inotify introspection iproute2 ipv6 iso ispell ithreads jack
> java javascript jbig jit jpeg jpeg2k jpg kde kipi kmod kms kwallet l10n
> ladspa lame largepages latin1 lcms ldap ldapdb legacy-sys

*EDIT* Used an entry in package.env to link klibc with the bfd linker and now it works :-)
Comment 18 Sergio 2018-01-13 14:33:26 UTC
dev-libs/klibc-2.0.4-r2 successfully built after applying the workaround for 4.14.13-gentoo-s1 kernel and media-gfx/splashutils-1.5.4.4-r7 also successfully built.

Regards,
Sergio
Comment 19 Oleg Gawriloff 2018-01-22 13:01:59 UTC
Fix from https://bugs.gentoo.org/621848#c9 works.
Updated version of klibc available from barzog-overlay
Comment 20 Ben Kohler gentoo-dev 2018-02-01 17:09:20 UTC
*** Bug 646322 has been marked as a duplicate of this bug. ***
Comment 21 Oschtan 2018-02-06 04:44:04 UTC
KV_MAJOR="4" KV_MINOR="x" KV_SUB="9"
linux-headers-4.9
gentoo-sources-4.9.76-r1
klibc compiled successfully
Comment 22 Patrick Lauer gentoo-dev 2018-02-25 12:54:25 UTC
klibc-2.0.4-r3.ebuild has KV_SUB="14" and build for me with gcc7.
Comment 23 diamond 2018-02-25 21:19:53 UTC
It doesn't resolved for 4.4 longterm kernels.
Comment 24 Mark Nowiasz 2018-02-27 08:43:30 UTC
Still causes splashutils to fail:

/usr/lib64/klibc/include/limits.h:43:10: fatal error: linux/limits.h: No such file or directory
 #include <linux/limits.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.

uname -a
Linux seven 4.15.5-gentoo #1 SMP Fri Feb 23 08:54:24 CET 2018 x86_64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz GenuineIntel GNU/Linux

This issue seems not to fixed - why has the bug been resolved?
Comment 25 Andreas Schneider 2018-02-27 09:34:40 UTC
Hi guys!

The solution documented is confirmed to work with dev-libs/klibc-2.0.4-r2 but only with gentoo-sources.

I'm using ck-sources which causes the fix not to work, making it impossible to compile nvidia-drivers e.g.

Will this be generally handled in dev-libs/klibc-2.0.4-r3 which is already testing?


Best,
Andreas