Bug 236205

Summary: [CMake] REGRESSION(r288994): Linker does not get passed --disable-new-dtags
Product: WebKit Reporter: Adrian Perez <aperez>
Component: Tools / TestsAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, annulen, cgarcia, clopez, darin, ews-watchlist, gyuyoung.kim, mcatanzaro, ryuan.choi, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=235476
Attachments:
Description Flags
Patch
none
Patch v2 none

Description Adrian Perez 2022-02-06 12:00:56 PST
After switching from ld.gold to ld.bfd in r288994, the --disable-new-dtags
option is no longer passed to the linker. This can be an issue because without
it ELF headers will contain a DT_RUNPATH entry instead of a DT_RPATH one. The
issue is that DT_RUNPATH can be overriden by the LD_LIBRARY_PATH environment
variable, which can easily result in running binaries straight from the build
directory accidentally using libraries from outside the build directory if
the variable is defined. With DT_RPATH libraries from the lib/ subdirectory
will be used, which is desirable during testing.
Comment 1 Adrian Perez 2022-02-06 12:01:42 PST
CC'd Alex, who first noticed the issue and found the offending commit
(thanks!)
Comment 2 Adrian Perez 2022-02-06 12:05:04 PST
Created attachment 451046 [details]
Patch
Comment 3 Alejandro G. Castro 2022-02-07 02:17:39 PST
Comment on attachment 451046 [details]
Patch

Looks good! Thanks for fixing this! Compilation issues do not seem related?
Comment 4 Adrian Perez 2022-02-07 03:39:55 PST
Created attachment 451075 [details]
Patch v2
Comment 5 Adrian Perez 2022-02-07 03:43:59 PST
(In reply to Alejandro G. Castro from comment #3)
> Comment on attachment 451046 [details]
> Patch
> 
> Looks good! Thanks for fixing this! Compilation issues do not seem related?

One of them (from the i386 32-bit builder) was actually related, I have
uploaded a second version of the patch which avoids using list(POP_BACK)
which is not available in older CMake versions. I am currently chatting
with Angelos to try and understand the other failure to make sure it's
either unrelated or this patch changed to avoid it if needed.
Comment 6 EWS 2022-02-07 07:28:27 PST
Committed r289218 (246903@main): <https://commits.webkit.org/246903@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 451075 [details].
Comment 7 Radar WebKit Bug Importer 2022-02-07 07:29:18 PST
<rdar://problem/88570928>