NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: toolchain/58969: use of alloca is warning, not error, with -std=c11
> Date: Tue, 7 Jan 2025 11:17:21 +0100
> From: Jörg Sonnenberger <joerg%bec.de@localhost>
>
> On 1/7/25 7:10 AM, campbell+netbsd%mumble.net@localhost wrote:
> > While experimenting with switching the build to -std=c11 (https://mail-index.netbsd.org/tech-kern/2025/01/05/msg029919.html), I saw warnings fly by like this:
> >
> > /home/riastradh/netbsd/current/obj.riscv/tooldir/bin/../lib/gcc/riscv64--netbsd/12.4.0/../../../../riscv64--netbsd/bin/ld: /home/riastradh/netbsd/current/src/../obj.riscv/destdir.riscv/lib/libc.so: warning: Warning: reference to the libc supplied alloca(3); this most likely will not work. Please use the compiler provided version of alloca(3), by supplying the appropriate compiler flags (e.g. -std=gnu99).
>
> AFAICT there are bugs around per-symbol linker warnings in GNU ld where
> the warning is shown for dynamic libraries without anything in the
> current object files ever using them.
In this case, the warning is legitimate, because the files in libc
that _do_ use alloca -- execl.c, execle.c, execlp.c, and execvp.c --
need to be built with -std=gnu* in order to expose the real alloca,
not -std=c* which gives the broken stub reference, so compiling them
with -std=c11 broke them.
We need to make this mistake a build-breaking error, not a scroll-by
warning.
Home |
Main Index |
Thread Index |
Old Index