ARM-software / LLVM-embedded-toolchain-for-Arm

A project dedicated to building LLVM toolchain for Arm and AArch64 embedded targets.
Apache License 2.0
419 stars 98 forks source link

Provide libnosys.a for newlib compatibility #556

Open nolange opened 1 week ago

nolange commented 1 week ago

Many projects use GROUP(-lnosys) in their ldscript, this allows to lazily pull in some no-op stubs. Taking it out will cause trouble if newlib still should be usable. (picolib already has libg.a for probably similar reasons)

this is what I had to do to fix the issue for me:

#!/bin/sh
PREFIX=${1:-/opt/arm-clang}
TEMPFILE=$(mktemp); trap "rm -f $TEMPFILE" 0

"${PREFIX}"/bin/llvm-ar qc $TEMPFILE && "${PREFIX}"/bin/llvm-ranlib $TEMPFILE

for d in "${PREFIX}"/lib/clang-runtimes/arm-none-eabi/*/lib; do
    install -m644 $TEMPFILE "$d"/libnosys.a
done
voltur01 commented 1 week ago

Hi, the libg.a example suggests that this belongs to https://github.com/picolibc/picolibc project itself - would you like to raise it as an issue there to discuss?

nolange commented 1 week ago

Ok: https://github.com/picolibc/picolibc/issues/876