[Buildroot] [PATCH] package/musl: fixup the dynamic loader symlink

yann.morin at orange.com yann.morin at orange.com
Wed Oct 26 13:31:22 UTC 2022


Thomas, All,

On 2022-10-26 14:58 +0200, Thomas Petazzoni via buildroot spake thusly:
> The musl Makefile installs the dynamic loader as a symlink to libc.so
> with the following rule:
> 
> $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
>         $(INSTALL) -D -l $(libdir)/libc.so $@ || true
> 
> While it works, the drawback is that ld-musl-<arch>.so ends up being a
> symlink to /lib/libc.so. While it works on the target, it means we
> have a broken symlink in $(STAGING_DIR) and $(TARGET_DIR) as
> /lib/libc.so doesn't make sense on the build machine.
[--SNIP--]
> diff --git a/package/musl/musl.mk b/package/musl/musl.mk
> index 44c79da6f7..30c3c2fbc0 100644
> --- a/package/musl/musl.mk
> +++ b/package/musl/musl.mk
> @@ -60,12 +60,14 @@ endef
>  define MUSL_INSTALL_STAGING_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
>  		DESTDIR=$(STAGING_DIR) install-libs install-tools install-headers
> +	ln -sf libc.so $(STAGING_DIR)/lib/ld-musl*
>  endef
>  
>  define MUSL_INSTALL_TARGET_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
>  		DESTDIR=$(TARGET_DIR) install-libs
>  	$(RM) $(addprefix $(TARGET_DIR)/lib/,crt1.o crtn.o crti.o rcrt1.o Scrt1.o)
> +	ln -sf libc.so $(TARGET_DIR)/lib/ld-musl*
>  endef

What about external toolchains?

Regards,
Yann E. MORIN.

-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.




More information about the buildroot mailing list