Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id D5AE7225B19 for <~alpine/devel@lists.alpinelinux.org>; Tue, 18 Mar 2025 21:43:02 +0000 (UTC) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 87A1C240101 for <~alpine/devel@lists.alpinelinux.org>; Tue, 18 Mar 2025 22:43:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1742334181; bh=C2jl5zzi2myIh5HiaBdgEdTgBIk6c24gGQqHYoiCCng=; h=Mime-Version:Content-Transfer-Encoding:Content-Type:Date: Message-Id:Subject:From:To:From; b=HXS47zxPF43xOl2FaBLy2N91XVYQ3jJ/hiqq4Na3IQNjEbveF1U5g6pxz58c2mbaf KI9nRB4nLRPtoFMTM7XGx8Ux6/CDLoJm/c4Rhcja1eQH3bmzxm1h8MieCkkQKTL4Pn 61zT27obTNrbUyKTY0KZ/KebIqdE0PAdB1ZM7eaCCdBCRVZGsSjxdT1nqwTwlM3ay4 1x/5YNdWT8mF4UkSesVRP9rrRFKNjugrI06vNteY+lTC4NU2u53Z0GTaq6y/N+Lamg rECktxOTiWonT17647TDFBEYHp6sMxeLhG/Qmp22ejb9AdCLtnDzUVb/TbH0WZtccP QRzmvLDblG7zQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4ZHQLY0Shkz6v08; Tue, 18 Mar 2025 22:43:01 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 18 Mar 2025 21:43:00 +0000 Message-Id: Subject: Re: stack smashing protection? From: "Sertonix" To: "Jim Pryor" , <~alpine/devel@lists.alpinelinux.org> References: <30674376-d675-4c1d-96ef-7afb88a0dabb@app.fastmail.com> In-Reply-To: <30674376-d675-4c1d-96ef-7afb88a0dabb@app.fastmail.com> On Tue Mar 18, 2025 at 9:59 PM CET, Jim Pryor wrote: > I'm building some binaries on an ARMv7 build of Alpine, and getting error= s about the symbol `__stack_chk_fail` being missing. > > Adding `-fno-stack-protector` to my build command solves the issue. > > But I wonder if there's a way to get stack protection? I notice that when= I do `nm -D /usr/lib/libc.so | grep __stack_chk_fail` I get the output: > > ``` > 0003cc48 T __stack_chk_fail > ``` > > So the symbol is there, just not getting linked. > > I tried adding each of these to my build command, but none of them seemed= to fix the issue (that is, let me build without disabling stack protection= ): > > * -Wl,--whole-archive -lssp_nonshared -Wl,--no-whole-archive > * -static-libgcc > * -Wl,--as-needed -lc > > Is there something else I should be trying? Do you have any small command that can reproduce the issue? I tried gcc -o main main.c -fstack-protector-all with a simple test file and it build fine.