Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 427352

Summary: =dev-libs/klibc-1.5.25 fails to build with clang-3.1-r4
Product: Gentoo Linux Reporter: Fabio Scaccabarozzi <fsvm88>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED OBSOLETE    
Severity: normal CC: anton.kochkov, fsvm88, mgorny, wizardedit
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 408963, 410945    
Attachments: emerge fail log
Patch for klibc-2.0.4 to compile with 4.4.1 kernel sources.
Emerge compile log with ebuild patches.

Description Fabio Scaccabarozzi 2012-07-20 15:56:38 UTC
Created attachment 318748 [details]
emerge fail log

=dev-libs/klibc-1.5.25 fails to build with clang-3.1-r4
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-12-26 21:55:59 UTC
Please retest on klibc-2.0.3, so we can stabilize the new series and drop the 1.5 series if all tests are good.
Comment 2 Fabio Scaccabarozzi 2014-06-26 12:38:54 UTC
(In reply to Robin Johnson from comment #1)
> Please retest on klibc-2.0.3, so we can stabilize the new series and drop
> the 1.5 series if all tests are good.

Retested with clang-3.4.2 and klibc 2.0.3-r1. It now fails because of invalid arguments (fno-delete-null-pointer-checks and maccumulate-outgoing-args).
I tried to track these down in the sources, but couldn't find them.
Comment 3 Fabio Scaccabarozzi 2016-02-06 12:37:48 UTC
Retested with klibc-2.0.4 and clang-3.7/3.8_rc1, still fails when compiling.
I bumped the kernel version used by the ebuild to 4.4.1, to no avail (except for the fact that the unknown compile flags are not hard errors anymore, but just soft warnings). Note that with the linux-3.12 headers the errors may be much harder to fix, and anyway klibc's usr/klibc/README.klibc mentions "Extract a recent Linux kernel into a directory".

Please see the attached patch for the ebuild updates and the compile log with the patched ebuild.
Note that I removed all the logic for calculating the kernel version and patches. I know fetching patches is the preferred way because it reuses the same kernel base tarball, on the other hand it's much harder to read and understand - feel free to ignore those changes and/or fix as needed the original ebuild.
Comment 4 Fabio Scaccabarozzi 2016-02-06 12:38:26 UTC
Created attachment 424728 [details, diff]
Patch for klibc-2.0.4 to compile with 4.4.1 kernel sources.
Comment 5 Fabio Scaccabarozzi 2016-02-06 12:38:56 UTC
Created attachment 424730 [details]
Emerge compile log with ebuild patches.
Comment 6 Austin English (RETIRED) gentoo-dev 2016-06-05 03:25:08 UTC
klibc-1.5.25.ebuild
klibc-2.0.2.ebuild
klibc-2.0.2-r1.ebuild
klibc-2.0.3.ebuild
klibc-2.0.3-r1.ebuild
klibc-2.0.4.ebuild

all build for me with clang 3.5.0.
Comment 7 Austin English (RETIRED) gentoo-dev 2016-06-05 04:18:46 UTC
(In reply to Austin English from comment #6)
> klibc-1.5.25.ebuild
> klibc-2.0.2.ebuild
> klibc-2.0.2-r1.ebuild
> klibc-2.0.3.ebuild
> klibc-2.0.3-r1.ebuild
> klibc-2.0.4.ebuild
> 
> all build for me with clang 3.5.0.

Mistake on my end, forgot to put clang after package name in package.env.

1.5.25 still fails:
x86_64-pc-linux-gnu-clang-3.5.0: error: unknown argument: '-fno-delete-null-pointer-checks'
x86_64-pc-linux-gnu-clang-3.5.0: error: unknown argument: '-maccumulate-outgoing-args'
Comment 8 Austin English (RETIRED) gentoo-dev 2016-06-05 04:19:01 UTC
Confirming.
Comment 9 Austin English (RETIRED) gentoo-dev 2016-06-15 19:36:38 UTC
Currently blocked by:
https://llvm.org/bugs/show_bug.cgi?id=9251
https://llvm.org/bugs/show_bug.cgi?id=28145

in clang-3.8, and bug 410945 (linux kernel doesn't build with clang).
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 10:27:03 UTC
Reassigning to the maintainer.
Comment 11 Pacho Ramos gentoo-dev 2019-01-12 10:31:53 UTC
still valid with 2.0.4-r3?
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-03-22 07:17:48 UTC
Many changes in clang since.  Please reopen if you can still repro it with new versions of clang.