From: Mark Wielaard <mark@klomp.org>
To: Nick Clifton <nickc@redhat.com>
Cc: annobin@sourceware.org, Matthias Klose <doko@debian.org>
Subject: Re: ubuntu-riscv Re: ☠ Buildbot (Sourceware): annobin - failed test (failure) (master)
Date: Fri, 08 Mar 2024 18:19:56 +0100 [thread overview]
Message-ID: <992e9c3e56a9545d91f08c8c315b288288f44964.camel@klomp.org> (raw)
In-Reply-To: <a6621c03-60f4-4fa4-bda2-2e9124ba5abb@redhat.com>
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
prev parent reply other threads:[~2024-03-08 17:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 19:22 builder
2024-03-05 21:05 ` Mark Wielaard
2024-03-06 10:45 ` Nick Clifton
2024-03-07 0:05 ` Mark Wielaard
2024-03-07 13:34 ` ubuntu-riscv " Mark Wielaard
2024-03-08 15:28 ` Nick Clifton
2024-03-08 17:19 ` Mark Wielaard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=992e9c3e56a9545d91f08c8c315b288288f44964.camel@klomp.org \
--to=mark@klomp.org \
--cc=annobin@sourceware.org \
--cc=doko@debian.org \
--cc=nickc@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).