Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 556142 - dev-libs/klibc-2.0.4 doesn't compile with GCC 5
Summary: dev-libs/klibc-2.0.4 doesn't compile with GCC 5
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-5
  Show dependency tree
 
Reported: 2015-07-28 16:14 UTC by Tom Li
Modified: 2017-01-14 21:19 UTC (History)
20 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,6.96 KB, text/plain)
2016-04-26 14:26 UTC, Toralf Förster
Details
dev-libs:klibc-2.0.4:20160426-132919.log (dev-libs:klibc-2.0.4:20160426-132919.log,4.56 KB, text/plain)
2016-04-26 14:26 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,180.53 KB, text/plain)
2016-04-26 14:26 UTC, Toralf Förster
Details
environment (environment,91.41 KB, text/plain)
2016-04-26 14:26 UTC, Toralf Förster
Details
new ebuild (klibc-2.0.4-r1.ebuild,9.19 KB, text/plain)
2016-06-22 19:22 UTC, astro
Details
klibc-2.0.4-r1 build log (klibc-2.0.4-r1-build.xz,9.96 KB, application/x-xz)
2017-01-10 21:37 UTC, Kanogin Alexander
Details
klibc-2.0.4-r1 sandbox log (klibc-2.0.4-r1-sandbox-19444.xz,1.53 KB, application/x-xz)
2017-01-10 21:37 UTC, Kanogin Alexander
Details
Output emerge dev-libs/klibc (201701012-dev-libs_klibc-emerge-output.txt.xz,1.45 KB, application/x-xz)
2017-01-12 10:27 UTC, Kanogin Alexander
Details
dev-libs/klibc build log (201701012-dev-libs_klibc-2.0.4-build.log.xz,1.48 KB, application/x-xz)
2017-01-12 10:27 UTC, Kanogin Alexander
Details
klibc-2.0.4-r1 build log (ebuild from current attachments) (2017-01-14-klibc-2.0.4-r1.xz,12.23 KB, application/x-xz)
2017-01-14 21:19 UTC, Kanogin Alexander
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Li 2015-07-28 16:14:40 UTC
dev-libs/klibc-2.0.4 in build against Linux 3.12, at that time there is no GCC 5 support in Linux kernel. 

  CC      kernel/bounds.s
In file included from include/linux/compiler.h:54:0,
                 from include/uapi/linux/stddef.h:1,
                 from include/linux/stddef.h:4,
                 from /mnt/vm/compile/portage/dev-libs/klibc-2.0.4/work/linux-3.12/include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from include/linux/page-flags.h:8,
                 from kernel/bounds.c:9:
include/linux/compiler-gcc.h:103:30: fatal error: linux/compiler-gcc5.h: No such file or directory
compilation terminated.

Add "include/linux/compiler-gcc5.h" from the patch below can fix the issue:

http://lists.denx.de/pipermail/u-boot/2015-February/204332.html
Comment 1 Tom Li 2015-07-28 16:42:08 UTC
just hacked

KV_MAJOR="4"
KV_SUB="1"

to build klibc against Linux 4.1 and it works fine.
Comment 2 Reuben Farrelly 2015-10-06 05:54:56 UTC
+1.  This should really be handled as a request to upgrade the kernel source that the package pulls in during the build.  I ran into the same problem with gcc-5 not building this package so I updated the klibc ebuild to pull in Linux kernel 4.2.3 source instead - and klibc built fine for me as well (with gcc-5).

Please let me know if this request is best handled in this ticket or if I should open another bugzilla and link it to this one.
Comment 3 devsk 2015-12-10 17:21:03 UTC
Can someone please push that fix?
Comment 4 Zentoo 2015-12-15 10:43:56 UTC
I confirm that klibc compiled fine with a modified ebuild using:
KV_MAJOR="4"
KV_SUB="1"

This ebuild need to be modified to ensure that kernel have gcc5 header (from 3.18 series I think).

A temporary fix is to create in your own local overlay a dev-libs/klibc-2.0.4-r1 with KV_MAJOR="4" and KV_SUB="1".

For people that need a quick and dirty fix:
- edit /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild
  - set KV_MAJOR="4" and KV_SUB="1" at line 26
- cd /usr/portage/dev-libs/klibc/ && ebuild klibc-2.0.4.ebuild digest
- emerge -av1 klibc

It's quick and dirty because next portage sync will remove the hack.
Comment 5 Kobboi 2015-12-18 21:37:22 UTC
While you're at it, maybe also fix this

* Applying klibc-2.0.3-kernel-uapi.patch ...
 [ ok ]
/var/tmp/portage/dev-libs/klibc-2.0.4/temp/environment: line 2383: /var/tmp/portage/dev-libs/klibc-2.0.4/work/klibc-2.0.4/debian/patches/series: No such file or directory
Comment 6 Billy DeVincentis 2016-03-16 12:22:26 UTC
solution worked perfectly for me after upgrading to gcc 5
Comment 7 Toralf Förster gentoo-dev 2016-04-26 14:26:49 UTC
Created attachment 432148 [details]
emerge-info.txt

still fails here\n\n                 from include/linux/page-flags.h:8,
                 from kernel/bounds.c:9:
include/linux/compiler-gcc.h:103:30: fatal error: linux/compiler-gcc5.h: No such file or directory
compilation terminated.
/var/tmp/portage/dev-libs/klibc-2.0.4/work/linux-3.12/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Comment 8 Toralf Förster gentoo-dev 2016-04-26 14:26:51 UTC
Created attachment 432150 [details]
dev-libs:klibc-2.0.4:20160426-132919.log
Comment 9 Toralf Förster gentoo-dev 2016-04-26 14:26:54 UTC
Created attachment 432152 [details]
emerge-history.txt
Comment 10 Toralf Förster gentoo-dev 2016-04-26 14:26:57 UTC
Created attachment 432154 [details]
environment
Comment 11 astro 2016-06-22 19:03:31 UTC
GCC5 working with >=kernel-3.18. (Somebody say 3.16, but it is not work).
I was copy klibc.ebuild to my local overlay, change KV_SUB=18, then klibc build normally.

I used ~gcc-5.4.0 for build ~klibc-2.0.4.
Comment 12 astro 2016-06-22 19:22:20 UTC
Created attachment 438484 [details]
new ebuild
Comment 13 Pacho Ramos gentoo-dev 2016-08-12 13:49:32 UTC
does anyone want to proxy maintain this?
https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers
Comment 14 Carter Young 2016-09-02 21:30:20 UTC
I'd like to maintain this by proxy, please?  I need this for the Unity overlay, in combination with the nvidia-drivers
Comment 15 Pacho Ramos gentoo-dev 2016-09-17 15:09:54 UTC
Sure, CCing proxy maintainers
Comment 16 Kanogin Alexander 2016-09-24 21:00:36 UTC
File linux/compiler-gcc5.h present only in:
linux-3.18/include/linux/compiler-gcc5.h
linux-3.19/include/linux/compiler-gcc5.h
linux-4.0/include/linux/compiler-gcc5.h
linux-4.1/include/linux/compiler-gcc5.h

But /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild for ~amd64 use linux-3.12, in which file include/linux/compiler-gcc5.h absent.
Comment 17 Anton Kochkov 2016-10-07 07:12:53 UTC
May be just apply the same workaround https://bugs.gentoo.org/attachment.cgi?id=446966&action=diff ?
Comment 18 Anton Kochkov 2017-01-08 19:07:29 UTC
Bug https://bugs.gentoo.org/show_bug.cgi?id=473512 depends on this one.
Comment 19 Andreas Sturmlechner gentoo-dev 2017-01-08 21:36:03 UTC
commit ee53fa7bdd32ed0585fa739c7bc61947e32ac5ab
Author: Andreas Sturmlechner <asturm@gentoo.org>
Date:   Sun Jan 8 22:31:48 2017 +0100

dev-libs/klibc: Bump to EAPI 6, 2.0.4-9 Deb-, linux-4.4 tars; GCC-5 fix
Comment 20 Kanogin Alexander 2017-01-10 21:36:24 UTC
Emerging dev-libs/klibc-2.0.4-r1, with gcc version 5.4.0 (Gentoo 5.4.0 p1.0, pie-0.6.5) ends with an error:


 >>> Install klibc-2.0.4-r1 into /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image/ category dev-libs
 make -j3 EXTRA_KLIBCAFLAGS=-Wa,--noexecstack 'EXTRA_KLIBCLDFLAGS=-z noexecstack' 'HOSTLDFLAGS=-z noexecstack' KLIBCOPTFLAGS=-nostdlib HOSTCC=x86_64-pc-linux-gnu-gcc CC=x86_64-pc-linux-gnu-gcc HOSTLD=x86_64-pc-linux-gnu-ld LD=x86_64-pc-linux-gnu-ld INSTALLDIR=/usr/lib64/klibc INSTALLROOT=/var/tmp/portage/dev-libs/klibc-2.0.4-r1/image/ KLIBCARCH=x86_64 KLIBCASMARCH=x86 SHLIBDIR=/lib64 libdir=/usr/lib64 mandir=/usr/share/man T=/var/tmp/portage/dev-libs/klibc-2.0.4-r1/temp 'SKIP_HOSTCFLAGS=-march=native -mtune=native -O2 -pipe -nostdlib' 'SKIP_HOSTLDFLAGS=-Wl,-O1 -Wl,--as-needed -z noexecstack' 'SKIP_KLIBCOPTFLAGS=-march=native -mtune=native -O2 -pipe -nostdlib' install
  INSTALL headers + man pages to /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image//usr/lib64/klibc
  INSTALL binaries to /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image//usr/lib64/klibc/bin
  INSTALL usr/gzip/gzip usr/gzip/gunzip usr/gzip/zcat
  INSTALL usr/kinit/fstype/shared/fstype
  INSTALL usr/dash/sh.shared
  INSTALL usr/kinit/ipconfig/shared/ipconfig
  INSTALL usr/kinit/nfsmount/shared/nfsmount
  INSTALL usr/kinit/resume/shared/resume
  INSTALL usr/utils/shared/chroot usr/utils/shared/dd usr/utils/shared/mkdir usr/utils/shared/mkfifo usr/utils/shared/mknod usr/utils/shared/mount usr/utils/shared/pivot_root usr/utils/shared/umount usr/utils/shared/true usr/utils/shared/false usr/utils/shared/sleep usr/utils/shared/ln usr/utils/shared/mv usr/utils/shared/nuke usr/utils/shared/minips usr/utils/shared/cat usr/utils/shared/ls usr/utils/shared/losetup usr/utils/shared/uname usr/utils/shared/halt usr/utils/shared/kill usr/utils/shared/readlink usr/utils/shared/cpio usr/utils/shared/sync usr/utils/shared/dmesg usr/utils/shared/reboot usr/utils/shared/poweroff
  INSTALL klibc to /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image//usr/lib64/klibc/lib
  INSTALL usr/kinit/run-init/shared/run-init
  INSTALL usr/kinit/kinit usr/kinit/kinit.shared
 * ACCESS DENIED:  fchmodat:     /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image/usr/lib64/klibc/include/asm-generic
chmod: changing permissions of '/var/tmp/portage/dev-libs/klibc-2.0.4-r1/image//usr/lib64/klibc/include/asm-generic': Permission denied
 * ACCESS DENIED:  fchmodat:     /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image/usr/lib64/klibc/include/asm
chmod: changing permissions of '/var/tmp/portage/dev-libs/klibc-2.0.4-r1/image//usr/lib64/klibc/include/asm': Permission denied
 * ACCESS DENIED:  fchmodat:     /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image/usr/lib64/klibc/include/linux
 chmod: changing permissions of '/var/tmp/portage/dev-libs/klibc-2.0.4-r1/image//usr/lib64/klibc/include/linux': Permission denied
 >>> Completed installing klibc-2.0.4-r1 into /var/tmp/portage/dev-libs/klibc-2.0.4-r1/image/

 * Final size of build directory: 731312 KiB
 * Final size of installed tree: 2640 KiB

 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-19444.log"
 *
Comment 21 Kanogin Alexander 2017-01-10 21:37:23 UTC
Created attachment 459528 [details]
klibc-2.0.4-r1 build log
Comment 22 Kanogin Alexander 2017-01-10 21:37:51 UTC
Created attachment 459530 [details]
klibc-2.0.4-r1 sandbox log
Comment 23 Kobboi 2017-01-10 21:49:48 UTC
(In reply to Kanogin Alexander from comment #20)
> Emerging dev-libs/klibc-2.0.4-r1, with gcc version 5.4.0 (Gentoo 5.4.0 p1.0,
> pie-0.6.5) ends with an error:

This is already the topic of bug #605180, this bug is about 2.0.4
Comment 24 Kanogin Alexander 2017-01-11 17:32:46 UTC
(In reply to Kobboi from comment #23)
> (In reply to Kanogin Alexander from comment #20)
> > Emerging dev-libs/klibc-2.0.4-r1, with gcc version 5.4.0 (Gentoo 5.4.0 p1.0,
> > pie-0.6.5) ends with an error:
> 
> This is already the topic of bug #605180, this bug is about 2.0.4

Ebuild for dev-libs/klibc-2.0.4, not updated:
 # ls -la /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild
 -rw-r--r-- 1 portage portage 9382 Aug 25 19:13 /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild

And, also, ebuild dev-libs/klibc-2.0.4 not emerging.
Comment 25 Anton Kochkov 2017-01-11 17:35:02 UTC
(In reply to Kanogin Alexander from comment #24)
> (In reply to Kobboi from comment #23)
> > (In reply to Kanogin Alexander from comment #20)
> > > Emerging dev-libs/klibc-2.0.4-r1, with gcc version 5.4.0 (Gentoo 5.4.0 p1.0,
> > > pie-0.6.5) ends with an error:
> > 
> > This is already the topic of bug #605180, this bug is about 2.0.4
> 
> Ebuild for dev-libs/klibc-2.0.4, not updated:
>  # ls -la /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild
>  -rw-r--r-- 1 portage portage 9382 Aug 25 19:13
> /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild
> 
> And, also, ebuild dev-libs/klibc-2.0.4 not emerging.

Attach build log for klibc-2.0.4 then
Comment 26 Kanogin Alexander 2017-01-12 10:26:07 UTC
Ebuild dev-libs/klibc-2.0.4 not emerging:
 # ls -la /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild 
 -rw-r--r-- 1 portage portage 9382 Aug 25 19:13 /usr/portage/dev-libs/klibc/klibc-2.0.4.ebuild
please, see attahcments.
Comment 27 Kanogin Alexander 2017-01-12 10:27:03 UTC
Created attachment 459740 [details]
Output emerge dev-libs/klibc
Comment 28 Kanogin Alexander 2017-01-12 10:27:45 UTC
Created attachment 459742 [details]
dev-libs/klibc build log
Comment 29 Ed Catmur 2017-01-12 13:22:27 UTC
(In reply to Kanogin Alexander from comment #27)
> Created attachment 459740 [details]
> Output emerge dev-libs/klibc

That bug is fixed in dev-libs/klibc-2.0.4-r1.
Comment 30 Kanogin Alexander 2017-01-14 21:18:06 UTC
I have installed sys-kernel / linux-headers-4.4, and displays an collisions error, with emerging:
 *      /usr/lib64/klibc/include/asm-generic/auxvec.h
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *
 * sys-kernel/linux-headers-4.4:0::gentoo
 *      /usr/include/asm/sigcontext32.h
 *      /usr/include/asm/siginfo.h
Please see attachment.
Comment 31 Kanogin Alexander 2017-01-14 21:19:18 UTC
Created attachment 460074 [details]
klibc-2.0.4-r1 build log (ebuild from current attachments)