RFC:

During the creation of the environment script for the canadian cross
SDK in toolchain-script.bbclass,
for a MUSL C library target, the OVERRIDES contains libc-glibc instead
of libc-musl.

OVERRIDES=task-generate-content:linux-musl:x86-64:pn-meta-environment-qemux86-64:qemuall:qemux86-64:nodistro:class-cross-canadian:libc-glibc:forcevariable

This can be easily inspected by adding these lines to the script
creation (Thanks to Richard for the suggestion on IRC).

        echo 'export TARGET_CC_ARCH=${TARGET_CC_ARCH}' >> $script
        echo 'export OVERRIDES=${OVERRIDES}' >> $script

This append at the top of toolchain-script.bbclass is thus without effect:
TARGET_CC_ARCH_append_libc-musl = " -mmusl"

This works:

TARGET_CC_ARCH_append_linux-musl = " -mmusl"

(notice linux instead of libc, as linux-musl stays present in OVERRIDES.)

I have a (minimal) test case here. Run make in the cloned repo.
https://github.com/likewise/oe-musl-sdk-cmake


Regards,
-- 
Leon

p.s. sorry for the HTML sig earlier.

-- 
Leon Woestenberg
[email protected]
T: +31 40 711 42 76
M: +31 6 472 30 372

Sidebranch Embedded Systems
Eindhoven, The Netherlands
http://www.sidebranch.com



On Mon, Aug 17, 2020 at 5:28 PM Leon Woestenberg via
lists.openembedded.org <[email protected]>
wrote:
>
> Hello all,
>
> Compared with a BitBake/CMake built of a C application, the SDK/CMake 
> approach lacks the "-mmusl" flag. The resulting binaries of the SDK do not 
> load on the target (wrong runtime linker/loader).
>
> Minimal test case here (dunfell), just run make will show PASS / FAIL for 
> BitBake and SDK approach:
>
> https://github.com/likewise/oe-musl-sdk-cmake
>
> Has something to do with TARGET_CC_ARCH not propagating, investigation 
> further...
>
>
> Regards,
>
> Leon.
> --
> --
> Leon Woestenberg
> [email protected]
> T: +31 40 711 42 76
> M: +31 6 472 30 372
>
> Sidebranch Embedded Systems
> Eindhoven, The Netherlands
> http://www.sidebranch.com
>
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#141646): 
https://lists.openembedded.org/g/openembedded-core/message/141646
Mute This Topic: https://lists.openembedded.org/mt/76245876/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to