This is an archive of the discontinued LLVM Phabricator instance.

[hwasan] Replace j __interceptor_sigsetjmp instead with tail for RISC-V
ClosedPublic

Authored by raj.khem on Jan 12 2023, 10:24 PM.

Details

Summary

on main branch sanitizers fail to build for RISCV64 using binutils 2.40 ( to be released ) ld.

riscv64-yoe-linux-ld: relocation R_RISCV_JAL against `__interceptor_sigsetjmp' w
hich may bind externally can not be used when making a shared object; recompile with -fPIC

clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

Here we use tail macro to let linker do the relaxation.

Diff Detail

Event Timeline

raj.khem created this revision.Jan 12 2023, 10:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 10:24 PM
raj.khem requested review of this revision.Jan 12 2023, 10:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 10:24 PM
Herald added subscribers: Restricted Project, pcwang-thead. · View Herald Transcript
This revision is now accepted and ready to land.Jan 13 2023, 3:10 AM
MaskRay accepted this revision.Jan 13 2023, 5:40 PM

on main branch sanitizers fail to build for RISCV64 using binutils 2.40 ( to be released ) ld.

ld.lld doesn't allow R_RISCV_JAL to a preemptible symbol either. https://sourceware.org/bugzilla/show_bug.cgi?id=28509

MaskRay retitled this revision from [PATCH] [RISC-V][HWASAN] Fix long call linker error with 'j' instruction to [hwasan] Replace j __interceptor_sigsetjmp instead with tail for RISC-V.Jan 13 2023, 5:42 PM