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.
Created attachment 451691 [details] Patch
Created attachment 451693 [details] Patch v2 Removes the leading dot from the section name, hopefully that will make the EWS for Apple ports happier.
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 =)
(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.
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.
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].
<rdar://problem/88855880>