https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114839

            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_FRAME
segment is omitted, and then libgcc's exception unwinder aborts when it cannot
find the EH_FRAME segment. See FreeBSD bug report
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278551 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)}  
%{v:-V}   %{assert*} %{R*} %{rpath*} %{defsym*}   %{shared:-Bshareable %{h*}
%{soname*}}     %{!shared:       %{!static:         %{rdynamic:-export-dynamic}
    -dynamic-linker %(fbsd_dynamic_linker) }     %{static:-Bstatic}}  
%{symbolic:-Bsymbolic}

Reply via email to