Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831305 - net-dialup/ppp-2.4.9-r5 fails to compile: clang-13: error: unsupported option --print-sysroot
Summary: net-dialup/ppp-2.4.9-r5 fails to compile: clang-13: error: unsupported option...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2022-01-16 13:57 UTC by Agostino Sarubbo
Modified: 2022-05-18 03:04 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,74.96 KB, text/plain)
2022-01-16 13:57 UTC, Agostino Sarubbo
Details
Patch to fix problems with clang (ppp-2.4.9-r7-clang-fix.patch,1.99 KB, patch)
2022-05-18 02:13 UTC, Leonardo Neumann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-01-16 13:57:46 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-dialup/ppp-2.4.9-r5 fails to compile.
Discovered on: amd64 (internal ref: tinderbox)

NOTE:
This machine uses CLANG as a compiler and LLD as a linker
Comment 1 Agostino Sarubbo gentoo-dev 2022-01-16 13:57:48 UTC
Created attachment 762332 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-01-16 13:57:49 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


./configure: line 10: CC: command not found
./configure: line 23: CFLAGS: command not found
clang-13: error: unsupported option '--print-sysroot'
Comment 3 Leonardo Neumann 2022-05-18 02:13:26 UTC
Created attachment 779363 [details, diff]
Patch to fix problems with clang

I've written this patch to fix these problems with clang. The patch moves three nested functions in eap-tls.c file to the outside scope, as clang does not support them nested. It also removes the "$(CC) --print-sysroot" from the include prefix, as clang also does not support it. Can someone please review and test this patch? Thanks!
Comment 4 Doom Guy 2022-05-18 02:16:02 UTC
Tested here. 

sudo emerge net-dialup/ppp
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) net-dialup/ppp-2.4.9-r7::gentoo
>>> Installing (1 of 1) net-dialup/ppp-2.4.9-r7::gentoo
>>> Recording net-dialup/ppp in "world" favorites file...
>>> Jobs: 1 of 1 complete                           Load avg: 0.87, 0.35, 0.13
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

Gentoo with Clang/Musl globally, withouth GCC.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-18 02:16:52 UTC
(In reply to Leonardo Neumann from comment #3)
> Created attachment 779363 [details, diff] [details, diff]
> Patch to fix problems with clang
> 
> I've written this patch to fix these problems with clang. The patch moves
> three nested functions in eap-tls.c file to the outside scope, as clang does
> not support them nested. It also removes the "$(CC) --print-sysroot" from
> the include prefix, as clang also does not support it. Can someone please
> review and test this patch? Thanks!

Could you please submit this upstream and link it here? Thanks a lot!
Comment 6 Leonardo Neumann 2022-05-18 02:37:20 UTC
I just noticed that a similar solution to the first part of the patch was already upstreamed (https://github.com/ppp-project/ppp/commit/6e6a48fe628b76ec368277fd52685428e3dc8766). I couldn't find information about the second part, but it seems they fixed it as well. So, I guess we just have to wait for a new release.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-18 02:50:18 UTC
(In reply to Leonardo Neumann from comment #6)
> I just noticed that a similar solution to the first part of the patch was
> already upstreamed
> (https://github.com/ppp-project/ppp/commit/
> 6e6a48fe628b76ec368277fd52685428e3dc8766). I couldn't find information about
> the second part, but it seems they fixed it as well. So, I guess we just
> have to wait for a new release.

If it's fixed ~identically upstream, then I don't have an issue with applying it. Your patch seems reasonable anyway, I just: 
1. like stuff being upstreamed; 
2. was reluctant to add to our very very large heap of patches;
3. wanted to get this in before the new release they keep saying is around the corner ;)

But yeah, that seems irrelevant now. I'll apply yours.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-18 02:52:51 UTC
fwiw the sysroot part got fixed in the full autotoolsification of ppp which was merged a few months ago
Comment 9 Larry the Git Cow gentoo-dev 2022-05-18 03:04:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=868a874d9e6cb7f604cf6400f75da559a971a339

commit 868a874d9e6cb7f604cf6400f75da559a971a339
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-05-18 03:04:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-18 03:04:25 +0000

    net-dialup/ppp: fix build with clang
    
    Revbump as the nested functions bit can/will affect codegen (trampolines...).
    
    Closes: https://bugs.gentoo.org/831305
    Thanks-to: Leonardo Neumann <leonardo@neumann.dev.br>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../ppp-2.4.9-fix-clang-nested-functions.patch     |  65 ++++++
 .../ppp-2.4.9-fix-openssl-sysroot-clang.patch      |  14 ++
 net-dialup/ppp/ppp-2.4.9-r8.ebuild                 | 256 +++++++++++++++++++++
 3 files changed, 335 insertions(+)