Issue 91313
Summary [clang] attribute `__attribute__ ((ifunc("resolve_multiver")))` is accepted even when not supported by the platform (linux-musl)
Labels clang
Assignees
Reporter mablinov
    Hi all,

The symptoms of this issue are identical to https://github.com/llvm/llvm-project/issues/64631: The musl dynamic linker will complain about `unknown relocation 37`.

I stumbled into this issue when porting a GCC test ([ipa-pta-19.c](https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.dg/ipa/ipa-pta-19.c)) into RISC-V Clang, except of course in RISC-V the relocation number is different, so I see `unsupported relocation type 58` instead (`R_RISCV_IRELATIVE`)

There are two strange things:
- The commit that should have fixed https://github.com/llvm/llvm-project/issues/64631 ([0c3a02b8c09bb](https://github.com/llvm/llvm-project/commit/0c3a02b8c09bb408a74a638a263e51d67c92ca74) Function multi-versioning: disable ifunc for ELF targets other than glibc/Android/FreeBSD) doesn't have any effect in my case
- but it *also* doesn't seem to have any effect in the test case that was originally posted in https://github.com/llvm/llvm-project/issues/64631.

So far I've tried with the following LLVM versions:
- 18.1.5
- 17.0.5
- commit `0c3a02b8c09bb` (the exact commit that should have introduced the fix)

Perhaps it never got tested? I noticed while debugging clang, that the function `supportsIFunc` never actually gets called
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to