llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.87k stars 11.93k forks source link

[lld] CANNOT LINK EXECUTABLE "clang": unknown reloc type 16 @ 0x7b4a4f523ba0 (1273) on x86_64-linux-android30 #115103

Open trcrsired opened 2 hours ago

trcrsired commented 2 hours ago

image Why?

trcrsired commented 2 hours ago

@MaskRay

trcrsired commented 1 hour ago

I have checked the bionic and glibc code: bionic does not support R_X86_64_DTPMOD64??

https://github.com/aosp-mirror/platform_bionic/blob/3da2fec061833d3445990b4b891628dd4e757038/linker/linker_relocate.cpp#L477

glibc:

https://github.com/aosp-mirror/platform_bionic/blob/3da2fec061833d3445990b4b891628dd4e757038/linker/linker_relocate.cpp#L477

#define R_X86_64_NONE       0   /* No reloc */
#define R_X86_64_64     1   /* Direct 64 bit  */
#define R_X86_64_PC32       2   /* PC relative 32 bit signed */
#define R_X86_64_GOT32      3   /* 32 bit GOT entry */
#define R_X86_64_PLT32      4   /* 32 bit PLT address */
#define R_X86_64_COPY       5   /* Copy symbol at runtime */
#define R_X86_64_GLOB_DAT   6   /* Create GOT entry */
#define R_X86_64_JUMP_SLOT  7   /* Create PLT entry */
#define R_X86_64_RELATIVE   8   /* Adjust by program base */
#define R_X86_64_GOTPCREL   9   /* 32 bit signed PC relative
                       offset to GOT */
#define R_X86_64_32     10  /* Direct 32 bit zero extended */
#define R_X86_64_32S        11  /* Direct 32 bit sign extended */
#define R_X86_64_16     12  /* Direct 16 bit zero extended */
#define R_X86_64_PC16       13  /* 16 bit sign extended pc relative */
#define R_X86_64_8      14  /* Direct 8 bit sign extended  */
#define R_X86_64_PC8        15  /* 8 bit sign extended pc relative */
#define R_X86_64_DTPMOD64   16  /* ID of module containing symbol */
trcrsired commented 1 hour ago

image

trcrsired commented 1 hour ago

binaries are here: https://github.com/trcrsired/llvm-releases/releases/tag/20241105

x86_64-linux-android30.tar.xz