RESOLVED FIXED 236506
[CMake] REGRESSION(r289611): Debug builds fail linking binaries with ld.lld
https://bugs.webkit.org/show_bug.cgi?id=236506
Summary [CMake] REGRESSION(r289611): Debug builds fail linking binaries with ld.lld
Adrian Perez
Reported 2022-02-11 07:15:06 PST
SSIA, build failures can be seen e.g. in the WPE x86_64 debug build bot: https://build.webkit.org/#/builders/66/builds/7690 Error message follows: ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o >>> referenced by ThunkGenerators.cpp:886 (/app/webkit/Source/JavaScriptCore/jit/ThunkGenerators.cpp:886) >>> Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o:(JSC::expWrapper) ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o >>> referenced by ThunkGenerators.cpp:886 (/app/webkit/Source/JavaScriptCore/jit/ThunkGenerators.cpp:886) >>> Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o:(JSC::logWrapper) ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o >>> referenced by ThunkGenerators.cpp:886 (/app/webkit/Source/JavaScriptCore/jit/ThunkGenerators.cpp:886) >>> Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o:(JSC::floorWrapper) ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o >>> referenced by ThunkGenerators.cpp:886 (/app/webkit/Source/JavaScriptCore/jit/ThunkGenerators.cpp:886) >>> Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o:(JSC::ceilWrapper) ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o >>> referenced by ThunkGenerators.cpp:886 (/app/webkit/Source/JavaScriptCore/jit/ThunkGenerators.cpp:886) >>> Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/./__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-8.cpp.o:(JSC::truncWrapper) collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.
Attachments
Patch (4.61 KB, patch)
2022-02-11 07:27 PST, Adrian Perez
ews-feeder: commit-queue-
Patch v2 (4.61 KB, patch)
2022-02-11 07:32 PST, Adrian Perez
ews-feeder: commit-queue-
Patch v3 (2.84 KB, patch)
2022-02-11 07:58 PST, Adrian Perez
no flags
Adrian Perez
Comment 1 2022-02-11 07:27:49 PST
Adrian Perez
Comment 2 2022-02-11 07:32:42 PST
Created attachment 451693 [details] Patch v2 Removes the leading dot from the section name, hopefully that will make the EWS for Apple ports happier.
Adrian Perez
Comment 3 2022-02-11 07:37:03 PST
By the way, I think this is an interesting example about how LLD having slightly stricter defaults ended up uncovering an issue in the code =)
Adrian Perez
Comment 4 2022-02-11 07:52:52 PST
(In reply to Adrian Perez from comment #2) > Created attachment 451693 [details] > Patch v2 > > Removes the leading dot from the section name, > hopefully that will make the EWS for Apple ports happier. Gah! Neither GNU toolchains nor Apple's like “.pushsection text”. I wanted to use pushsection/popsection because the assembler (the GNU one at least) sanity-checks that a push has a corresponding pop, and it would be neat to have that; but it will be more portable to use .text/.previous instead.
Adrian Perez
Comment 5 2022-02-11 07:58:25 PST
Created attachment 451697 [details] Patch v3 This version of the patch uses .previous to undo the effect of the .text directives. The net result is the same as .pushsection/.popsection, but the source is more portable.
EWS
Comment 6 2022-02-12 07:49:12 PST
Committed r289695 (247180@main): <https://commits.webkit.org/247180@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 451697 [details].
Radar WebKit Bug Importer
Comment 7 2022-02-12 07:50:19 PST
Note You need to log in before you can comment on or make changes to this bug.