musl: Fix building with pure LLVM toolchain

Message ID 58e0250eb36fccc1e43bf6f667073e87bac0a82f.1640615708.git.esben.haabendal@huawei.com
State New
Headers show
Series musl: Fix building with pure LLVM toolchain | expand

Commit Message

esben.haabendal@huawei.com Dec. 27, 2021, 2:35 p.m. UTC
From: Esben Haabendal <esben.haabendal@huawei.com>

When building musl with a pure LLVM toolchain, we need compiler-rt instead of
libgcc-initial.

Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
---
 meta/recipes-core/musl/musl_git.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Khem Raj Jan. 1, 2022, 9:17 a.m. UTC | #1
I am getting dependency loops with this patch for musl/clang with llvm
runtime now see

http://sprunge.us/5qlw7b

On Mon, Dec 27, 2021 at 6:35 AM Esben Haabendal <esben@geanix.com> wrote:
>
> From: Esben Haabendal <esben.haabendal@huawei.com>
>
> When building musl with a pure LLVM toolchain, we need compiler-rt instead of
> libgcc-initial.
>
> Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
> ---
>  meta/recipes-core/musl/musl_git.bb | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
> index 06b0e060d015..2b307482c7aa 100644
> --- a/meta/recipes-core/musl/musl_git.bb
> +++ b/meta/recipes-core/musl/musl_git.bb
> @@ -23,7 +23,7 @@ PROVIDES += "virtual/libc virtual/libiconv virtual/libintl virtual/crypt"
>
>  DEPENDS = "virtual/${TARGET_PREFIX}binutils \
>             virtual/${TARGET_PREFIX}gcc \
> -           libgcc-initial \
> +           ${DEPENDS_COMPILER_RT} \
>             linux-libc-headers \
>             bsd-headers \
>             libssp-nonshared \
> @@ -31,6 +31,9 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils \
>  GLIBC_LDSO = "${@get_glibc_loader(d)}"
>  MUSL_LDSO_ARCH = "${@get_musl_loader_arch(d)}"
>
> +DEPENDS_COMPILER_RT = "libgcc-initial"
> +DEPENDS_COMPILER_RT:toolchain-clang = "${@bb.utils.contains('COMPILER_RT', 'libgcc', 'libgcc-initial', 'compiler-rt', d)}"
> +
>  export CROSS_COMPILE="${TARGET_PREFIX}"
>
>  LDFLAGS += "-Wl,-soname,libc.so"
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#160029): https://lists.openembedded.org/g/openembedded-core/message/160029
> Mute This Topic: https://lists.openembedded.org/mt/87977893/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

Patch

diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index 06b0e060d015..2b307482c7aa 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -23,7 +23,7 @@  PROVIDES += "virtual/libc virtual/libiconv virtual/libintl virtual/crypt"
 
 DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            virtual/${TARGET_PREFIX}gcc \
-           libgcc-initial \
+           ${DEPENDS_COMPILER_RT} \
            linux-libc-headers \
            bsd-headers \
            libssp-nonshared \
@@ -31,6 +31,9 @@  DEPENDS = "virtual/${TARGET_PREFIX}binutils \
 GLIBC_LDSO = "${@get_glibc_loader(d)}"
 MUSL_LDSO_ARCH = "${@get_musl_loader_arch(d)}"
 
+DEPENDS_COMPILER_RT = "libgcc-initial"
+DEPENDS_COMPILER_RT:toolchain-clang = "${@bb.utils.contains('COMPILER_RT', 'libgcc', 'libgcc-initial', 'compiler-rt', d)}"
+
 export CROSS_COMPILE="${TARGET_PREFIX}"
 
 LDFLAGS += "-Wl,-soname,libc.so"