Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Khem Raj <raj.khem@gmail.com>, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v3 05/13] tcf-agent: Fix ranlib call when using llvm-ranlib
Date: Thu, 29 May 2025 21:15:07 +0100	[thread overview]
Message-ID: <b175dfb344278086015735e6f8a0e7a66dfd3e32.camel@linuxfoundation.org> (raw)
In-Reply-To: <d8f36286-97a2-4189-82bd-79b66afa9c9e@gmail.com>

On Thu, 2025-05-29 at 10:59 -0700, Khem Raj wrote:
> 
> 
> On 5/29/25 2:20 AM, Richard Purdie wrote:
> > On Thu, 2025-05-22 at 20:52 -0700, Khem Raj via lists.openembedded.org wrote:
> > > This ensures that binutils-ranlib or llvm-ranlib
> > > behaves same as gcc-ranlib
> > > 
> > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > ---
> > >   meta/recipes-devtools/tcf-agent/tcf-agent_git.bb | 5 +++++
> > >   1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb b/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
> > > index 235936288ba792c86af4dd1899b2f6585328141f..41706f4b60f1f25233ff91c8f112b8122a5c6c30 100644
> > > --- a/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
> > > +++ b/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
> > > @@ -51,6 +51,11 @@ CFLAGS:append:riscv64 = " ${LCL_STOP_SERVICES}"
> > >   CFLAGS:append:riscv32 = " ${LCL_STOP_SERVICES}"
> > >   CFLAGS:append:loongarch64 = " ${LCL_STOP_SERVICES}"
> > >   
> > > +# This works with gcc-ranlib wrapper only which expands $@ shell array,
> > > +# but it will fail if RANLIB was set to <cross>-ranlib or
> > > +# <cross>-llvm-ranlib has same behaviour
> > > +RANLIB:append:toolchain-clang = " $@"
> > > +
> > >   do_install() {
> > >   	oe_runmake install INSTALLROOT=${D}
> > >   	install -d ${D}${sysconfdir}/init.d/
> > > 
> > 
> > The people on the patch review calls are struggling to understand the
> > issue here. Could you explain this a bit more in the comment so we can
> > understand it?
> > 
> > Does this imply there is a missing piece on the commandline in the
> > makefiles (or whatever) of tcf-agent which should really be fixed
> > instead?
> 
> I can explain it a bit more. tcf-agent calls RANLIB after calling AR to 
> create the archive [1], when RANLIB is set to gcc-ranlib this goes 
> unnoticed, since calling gcc-ranlib without any arguments it silenlty
> does nothing and exits with return code 0, however, calling ranlib or
> llvm-ranlib does demand library name as commandline option and since it 
> is not there it exits with code 1
> 
> aarch64-poky-linux-musl-llvm-ranlib
> OVERVIEW: LLVM ranlib
> 
> Generate an index for archives
> 
> USAGE: aarch64-poky-linux-musl-llvm-ranlib archive...
> 
> OPTIONS:
>    -h --help             - Display available options
>    -V --version          - Display the version of this program
>    -D                    - Use zero for timestamps and uids/gids (default)
>    -U                    - Use actual timestamps and uids/gids
>    -X{32|64|32_64|any}   - Specify which archive symbol tables should be 
> generated if they do not already exist (AIX OS only)
> aarch64-poky-linux-musl-llvm-ranlib: error: an archive name must be 
> specified
> make: *** [Makefile:53: obj/GNU/Linux/a64/Debug/libtcf.a] Error 1
> 
> 
> When we add $@, to RANLIB then it becomes the make variable,
> $@ - An automatic Makefile variable that expands to the target name (the 
> file being built)
> 
> 
> so the makefile target now rightly adds the .a filename to RANLIB call.
> 
> tcf-agent seems to add $@ for solaris and osx, I guess someone saw the 
> problem on default ranlib on these platforms but not on linux where 
> gcc-ar is used commonly.
> 
> [1] 
> https://gitlab.eclipse.org/eclipse/tcf/tcf.agent/-/blob/master/agent/Makefile?ref_type=heads#L53

Can we open something with tcf agent to add this on linux then? I'm
just worried this workaround is fairly fragile and likely to cause us
problems in future. In some ways I'd rather patch tcf agent for this
issue as that would at least be clearer.

If we have an open upstream ticket or patch, then we can probably just
append the variable for now.

Cheers,

Richard



  reply	other threads:[~2025-05-29 20:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23  3:52 [PATCH v3 00/13] clang: Add clang C/C++ toolchain Khem Raj
2025-05-23  3:52 ` [PATCH v3 01/13] toolchain: Provide abstraction for choosing per-recipe toolchain Khem Raj
2025-05-29 14:10   ` [OE-core] " Richard Purdie
2025-05-29 23:44   ` Peter Kjellerstedt
2025-05-23  3:52 ` [PATCH v3 02/13] clang.bbclass: Specify ldso when using usermerge Khem Raj
2025-05-23  3:52 ` [PATCH v3 03/13] vte: Disable gi data generation when using clang on arm Khem Raj
2025-05-23  3:52 ` [PATCH v3 04/13] clang: Add compiler-rt to default deps when using clang compiler Khem Raj
2025-05-23  3:52 ` [PATCH v3 05/13] tcf-agent: Fix ranlib call when using llvm-ranlib Khem Raj
2025-05-29  9:20   ` [OE-core] " Richard Purdie
2025-05-29 17:59     ` Khem Raj
2025-05-29 20:15       ` Richard Purdie [this message]
2025-05-29 20:47         ` Khem Raj
2025-05-23  3:52 ` [PATCH v3 06/13] libjpeg-turbo: Fix build on mips/clang Khem Raj
2025-05-29  9:22   ` [OE-core] " Richard Purdie
2025-05-29 16:28     ` Khem Raj
2025-05-29 20:26       ` Richard Purdie
2025-05-29 20:48         ` Khem Raj
2025-05-23  3:52 ` [PATCH v3 07/13] pixman: Fix build with mips/clang Khem Raj
2025-05-29  9:23   ` [OE-core] " Richard Purdie
2025-05-29 20:05     ` Khem Raj
2025-05-29  9:24   ` Ross Burton
2025-05-29 20:43     ` Khem Raj
2025-05-23  3:52 ` [PATCH v3 08/13] vulkan-samples: Disable overriding-option as error Khem Raj
2025-05-23  3:52 ` [PATCH v3 09/13] bluez: Disable invalid-pp-token warning with clang Khem Raj
2025-05-23  3:52 ` [PATCH v3 10/13] systemtap: Pin to build with GCC Khem Raj
2025-05-23  3:52 ` [PATCH v3 11/13] seatd: Disable sign-compare warning as error on clang Khem Raj
2025-05-23  3:52 ` [PATCH v3 12/13] systemd-boot: Pin to use gcc toolchain on arm Khem Raj
2025-05-23  3:52 ` [PATCH v3 13/13] meta: Add TCOVERRIDE for toolchain selection at recipe scope Khem Raj

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=b175dfb344278086015735e6f8a0e7a66dfd3e32.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.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