From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58F08385840D; Wed, 24 Apr 2024 17:50:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58F08385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713981032; bh=ZBF6IJW1oGmOg9TA4+00rUuha28txTsD1ywoJVVC3FI=; h=From:To:Subject:Date:From; b=cUwJPYXK5UWFQ0E7Z6/wf1a3PzAaFW+jg0I5HpCcJLKwfrGRm+WRxkBPH8+83DI/W Kpak9WYX3dYK5VFqt+WtXcJaHhoyUqnlBIFMaqkizw70qdp/emOtYAlbarj8GCwn7Z puBoucJ/wN7TxRHVWCKMP8imqOBXL33ikMHoQtgk= From: "emaste at freebsd dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/114839] New: g++-linked FreeBSD static binaries abort upon exception Date: Wed, 24 Apr 2024 17:50:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: driver X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: emaste at freebsd dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114839 Bug ID: 114839 Summary: g++-linked FreeBSD static binaries abort upon exception Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: emaste at freebsd dot org Target Milestone: --- When compiling and statically linking a binary on FreeBSD with GCC the EH_F= RAME segment is omitted, and then libgcc's exception unwinder aborts when it can= not find the EH_FRAME segment. See FreeBSD bug report https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278551 for full details= and history. >From -dumpspecs it looks like (assuming I understand correctly) that --eh-frame-header is not passed when static is specified: ... *link: %{!static|static-pie:--eh-frame-hdr} %{m32:-m elf_i386_fbsd}%{!m32:-m elf_x86_64_fbsd} %{p:%nconsider using '-pg' instead of '-p' with gprof(1)= }=20=20 %{v:-V} %{assert*} %{R*} %{rpath*} %{defsym*} %{shared:-Bshareable %{h*} %{soname*}} %{!shared: %{!static: %{rdynamic:-export-dyna= mic} -dynamic-linker %(fbsd_dynamic_linker) } %{static:-Bstatic}}=20=20 %{symbolic:-Bsymbolic}=