Bug 277947 - devel/gmake: fails build WITH_LTO=yes
Summary: devel/gmake: fails build WITH_LTO=yes
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-25 12:54 UTC by Benjamin Takacs
Modified: 2024-03-27 09:05 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (tijl)


Attachments
devel/gmake: mark LTO_UNSAFE (279 bytes, patch)
2024-03-25 12:54 UTC, Benjamin Takacs
nimaje+fbz: maintainer-approval? (tijl)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Takacs 2024-03-25 12:54:15 UTC
Created attachment 249472 [details]
devel/gmake: mark LTO_UNSAFE

devel/gmake fails to build if WITH_LTO=yes is set.

relevant part of the log:
--- make ---
cc  -O2 -pipe  -flto=thin -fstack-protector-strong -fno-strict-aliasing -Wl,--export-dynamic -flto=thin -fstack-protector-strong -o make src/ar.o src/arscan.o  src/commands.o src/default.o src/dir.o  src/expand.o src/file.o src/function.o  src/getopt.o src/getopt1.o src/guile.o  src/hash.o src/implicit.o src/job.o  src/load.o src/loadapi.o src/main.o  src/misc.o src/output.o src/read.o  src/remake.o src/rule.o src/shuffle.o  src/signame.o src/strcache.o  src/variable.o src/version.o  src/vpath.o  src/posixos.o   src/remote-stub.o   lib/libgnu.a   /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib 
ld: error: undefined symbol: find_in_given_path
>>> referenced by job.c
>>>               lto.tmp:(child_execute_job)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [make] Error code 1

Until that is fixed it should be marked as LTO_UNSAFE
Comment 1 Tijl Coosemans freebsd_committer freebsd_triage 2024-03-25 17:17:44 UTC
This works here.  Which version of FreeBSD do you use?  Which version of clang?
Comment 2 Benjamin Takacs 2024-03-25 17:58:24 UTC
(In reply to Tijl Coosemans from comment #1)

building for: FreeBSD 132amd64-test-test-lto 13.2-RELEASE-p10 FreeBSD 13.2-RELEASE-p10 amd64

FreeBSD clang version 14.0.5
Comment 3 Tatsuki Makino 2024-03-27 09:05:11 UTC
In this case, it seems that
BINARY_ALIAS= ranlib=llvm-ranlib
can keep LTO safe.

However, the environment that caused this same problem and confirmed that this would solve it is 12.4-STABLE :)
A retest with a version that is not out of support is required.