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

Bug 740820

Summary: net-misc/spread-5.0.1-r1 fails to compile: ld.lld: error: unknown argument '-Wl,-O1'
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Joshua Kinard <kumba>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log

Description Agostino Sarubbo gentoo-dev 2020-09-07 06:49:23 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-misc/spread-5.0.1 fails to compile.
Discovered on: amd64 (internal ref: tinderbox)

NOTE:
This machine uses a clang/LLVM toolchain.
If you think that this issue is strictly related to clang/LLVM please block bug 408963. If you think that this issue is strictly related to the LLD linker, please block bug 731004.
This machine uses also GLIBC-2.32. If you think that this issue is strictly related to GLIBC please block bug 736174.
Comment 1 Agostino Sarubbo gentoo-dev 2020-09-07 06:49:26 UTC
Created attachment 658918 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-01-18 07:25:50 UTC
tinderbox has reproduced this issue with version 5.0.1-r1 - Updating summary.
Comment 3 Joshua Kinard gentoo-dev 2022-01-29 01:22:11 UTC
-Wl,-O1 is a standard mechanism in GNU toolchains for passing arguments to the linker via the C/C++ compiler.  I *think* GNU ld in binutils is smart enough to accept -Wl,* syntax as well as the operand argument directly.  I don't run clang, so I can't directly test this package to directly see what the core issue is.

That said, grepping the source directory, I cannot find //any// references to -Wl,-O1 being passed anywhere.  It looks like this value is passed by Portage itself, because if I undefine LDFLAGS in /etc/portage/make.conf, the following default LDFLAGS get passed:

              Host: x86_64-pc-linux-gnu
          Compiler: x86_64-pc-linux-gnu-gcc
                [snip]
      Linker flags: -Wl,-O1 -Wl,--as-needed -fno-lto -fno-use-linker-plugin
         Libraries: -lm -lnsl

But if I explicitly set LDFLAGS to "" in make.conf:

              Host: x86_64-pc-linux-gnu
          Compiler: x86_64-pc-linux-gnu-gcc
                [snip]
      Linker flags:  -fno-lto -fno-use-linker-plugin
         Libraries: -lm -lnsl

So this seems to confirm that it's a Portage default somewhere that is trying to pass -Wl,-O1, and if the LLVM LLD doesn't like that argument format, that's an issue that needs to be taken up with LLVM upstream.

As for Spread itself, the ebuild needs some minor TLC, but there has been no activity out of upstream in a few years, last post to their mailing list was June 2020, and their SVN repository is locked behind a public key authentication portal for unknown reasons, so I can't check to see what, if any development has happened.  That said, the website is up and running, so I will assume the software is still supported and/or developed, just at an amazingly-slow pace.

Marking bug as INVALID as the reported issue does not seem to be caused by the package itself.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-29 01:24:11 UTC
I think the best fix is probably to just stop calling $(LD), really, given it's been deprecated for yeaaaars.
Comment 5 Joshua Kinard gentoo-dev 2022-01-29 01:35:07 UTC
(In reply to Sam James from comment #4)
> I think the best fix is probably to just stop calling $(LD), really, given
> it's been deprecated for yeaaaars.

Neither of the ebuild's invoke LD directly.  It looks like that's the Makefiles in the source.  I am tempted to leave that for Upstream to fix at some point, if they are still alive.  I am not terribly familiar with the under-the-hood workings of this package.  I only picked maintenance of it several years ago because it was a dependency for a netflow analysis package I made local ebuilds for that I don't really mess with anymore and which were never committed to the tree because of some unresolved licensing questions I ran into (software was sponsored by the US DoD and thus is dual-licensed under GPL2 and US DoD DFARS -- we don't have handling for DFARS).
Comment 6 Agostino Sarubbo gentoo-dev 2022-01-29 08:09:25 UTC
I guess that here the problem is that LD is used during link instead of CC