From: Herve Codina via buildroot <buildroot@buildroot.org>
To: Yegor Yefremov <yegorslists@googlemail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/alchemy: don't copy the C library into the Alchemy staging
Date: Wed, 25 Nov 2026 11:48:20 +0100 [thread overview]
Message-ID: <20261125114820.667d3696@bootlin.com> (raw)
In-Reply-To: <20261125093330.194145-1-yegorslists@googlemail.com>
Hi Yegor,
On Wed, 25 Nov 2026 10:33:30 +0100
Yegor Yefremov <yegorslists@googlemail.com> wrote:
> With BR2_ROOTFS_MERGED_USR=y and a glibc toolchain, ulog fails to link:
>
> SharedLib: libulog => alchemy-out/build/libulog/libulog.so
> .../ld: cannot find /lib64/libm.so.6: No such file or directory
> .../ld: cannot find /lib64/libmvec.so.1: No such file or directory
>
> For eglibc/musl targets, Alchemy copies the C library from the toolchain
> sysroot (lib/libc.so*, lib/libm.so*, ...) into its own staging
> directory, and passes that directory to the linker with -L. Normally
> sysroot/lib only holds the runtime libraries. With merged /usr,
> sysroot/lib is a symlink to usr/lib, so the glibc libc.so and libm.so
> linker scripts are copied as well. ld then finds alchemy-out/staging/lib/
> libm.so first. As that script is outside of the sysroot, ld does not
> prefix its absolute paths (/lib64/libm.so.6) with the sysroot and fails.
>
> Buildroot already provides the C library in the sysroot, so there is no
> need for Alchemy to install it. Pass an empty TOOLCHAIN_LIBC to Alchemy
> to skip this step. It has to be passed on the command line, as Alchemy
> overrides the environment variable. This fixes all Alchemy-based
> packages (ulog, libfutils, libshdata).
>
> This issue has been present since commit 7f1f3f87868f ("package/alchemy:
> new host package"), which added Alchemy with the libc installation
> enabled. It therefore affects 2022.02 and later, including 2026.02.x.
>
> Fixes:
> https://autobuild.buildroot.org/results/60397b107a5c09de5fd444babae8db538690ef33
>
> Fixes: 7f1f3f87868fa333833dbba9f4f07adc338b34ed ("package/alchemy: new host package")
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> package/alchemy/alchemy.mk | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/package/alchemy/alchemy.mk b/package/alchemy/alchemy.mk
> index 10d1068ac4..ae3efa67d5 100644
> --- a/package/alchemy/alchemy.mk
> +++ b/package/alchemy/alchemy.mk
> @@ -23,7 +23,15 @@ $(eval $(host-generic-package))
>
> # Variables used by other packages
>
> -ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake
> +# Alchemy copies the C library from the toolchain sysroot into its own
> +# staging directory, and adds that directory to the linker search path.
> +# With BR2_ROOTFS_MERGED_USR, sysroot/lib is sysroot/usr/lib, so this
> +# also copies the glibc libc.so/libm.so linker scripts. ld then finds
> +# them outside of the sysroot and doesn't prefix their absolute paths
> +# (/lib64/libm.so.6) with it. The libc is provided by Buildroot anyway,
> +# so tell Alchemy there is none to install. This has to be passed on the
> +# command line, as Alchemy overrides the environment variable.
> +ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake TOOLCHAIN_LIBC=
>
> # TARGET_ARCH is set to 'xxx' to avoid Alchemy managing the architecture.
> # When Alchemy manages the architecture, it can add some flags to CFGLAGS and
LGTM. Thanks for handling this.
Acked-by: Herve Codina <herve.codina@bootlin.com>
Best regards,
Hervé
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2026-11-25 10:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 9:33 [Buildroot] [PATCH] package/alchemy: don't copy the C library into the Alchemy staging Yegor Yefremov via buildroot
2026-11-25 10:48 ` Herve Codina via buildroot [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=20261125114820.667d3696@bootlin.com \
--to=buildroot@buildroot.org \
--cc=herve.codina@bootlin.com \
--cc=yegorslists@googlemail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.