Package: picolibc-aarch64-linux-gnu
Version: 1.7.2-2
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu impish

Hi Keith,

Recent versions of picolibc are failing to migrate into the Ubuntu release
because the new(ish) aarch64 autopkgtest fails on Ubuntu:

[...]
autopkgtest [19:05:54]: test command3: [-----------------------
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: 
/usr/lib/picolibc/aarch64-linux-gnu/lib/../lib/libc.a(stack_protector.c.o): in 
function `__stack_chk_fail_weak':
./aarch64-linux-gnu/../../../newlib/libc/ssp/stack_protector.c:54: undefined 
reference to `_exit'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: 
/usr/lib/picolibc/aarch64-linux-gnu/lib/../lib/libc.a(puts.c.o): in function 
`puts':
./aarch64-linux-gnu/../../../newlib/libc/tinystdio/puts.c:41: undefined 
reference to `__iob'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: 
./aarch64-linux-gnu/../../../newlib/libc/tinystdio/puts.c:41: undefined 
reference to `__iob'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: 
/usr/lib/picolibc/aarch64-linux-gnu/lib/../lib/libc.a(signal.c.o): in function 
`raise':
./aarch64-linux-gnu/../../../newlib/libc/signal/signal.c:131: undefined 
reference to `getpid'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: 
./aarch64-linux-gnu/../../../newlib/libc/signal/signal.c:131: undefined 
reference to `kill'
collect2: error: ld returned 1 exit status
[...]

  (https://autopkgtest.ubuntu.com/packages/p/picolibc/impish/amd64)

I believe the issue is that, unlike other architectures, the aarch64 support
is using gcc-aarch64-linux-gnu instead of a compiler that uses a libc-less
target by default, and makes an incorrect assumption that in its default
configuration it will not generate references to glibc.  This happens to
work for the autopkgtest test case on Debian, but fails on Ubuntu (from the
output, probably related at least in part to the additional security
hardening features that are turned on in Ubuntu gcc by default).

The following compile command succeeds:

aarch64-linux-gnu-gcc -ffreestanding --specs=picolibc.specs -o 
/tmp/touch-aarch64 debian/tests/touch.c -lm

So perhaps picolibc.specs just needs to include the equivalent of
-ffreestanding in order to be portable.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org

Attachment: signature.asc
Description: PGP signature

Reply via email to