ubuntu-riscv Re: ☠ Buildbot (Sourceware): annobin - failed test (failure) (master)
Mark Wielaard
mark@klomp.org
Fri Mar 8 17:19:56 GMT 2024
Hi Nick,
On Fri, 2024-03-08 at 15:28 +0000, Nick Clifton wrote:
> Could you test something for me please ? Is it possible to build the
> clang plugin on risc-v, but using the ld.bfd linker ? ie: does this patch
> work:
>
> diff --git a/clang-plugin/Makefile.in b/clang-plugin/Makefile.in
> index 1fc45c0..325d1e9 100644
> --- a/clang-plugin/Makefile.in
> +++ b/clang-plugin/Makefile.in
> @@ -14,6 +14,7 @@ PLUGIN_OPTIONS = \
> -fPIC \
> -Wall \
> -O2 \
> + -flto -fuse-ld=ld.bfd \
> -g -grecord-gcc-switches \
> -Wl,--build-id=md5 \
> -Wl,-z,now
No, clang doesn't seem to like that:
clang: error: invalid linker name in argument '-fuse-ld=ld.bfd'
It does accept -fuse-ld=bfd
But then because we use -flto you still get:
clang++ `llvm-config --cxxflags` \
-D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -shared -fPIC -Wall
-O2 -flto -fuse-ld=bfd -g -grecord-gcc-switches -Wl,--build-id=md5 -
Wl,-z,now `llvm-config --ldflags` `llvm-config --system-libs` \
-I .. -I./.. -lLLVM annobin.cpp -o annobin-for-clang.so
/usr/bin/ld.bfd: /usr/lib/llvm-16/bin/../lib/LLVMgold.so: error loading
plugin: /usr/lib/llvm-16/bin/../lib/LLVMgold.so: cannot open shared
object file: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Leaving out -flto does seem to work (without needing any -fuse-ld=).
And then all tests do also pass!
Cheers,
Mark
More information about the Annobin
mailing list