⛏️ index : buildtools.git

author Trung Nguyen <trungnt282910@gmail.com> 2022-07-06 23:57:55.0 +07:00:00
committer waddlesplash <waddlesplash@gmail.com> 2022-07-07 15:02:22.0 +00:00:00
commit
0665c85caf7a0fcf53a6bfd4622050944285b49f [patch]
tree
52c26d8e7737a0f981fcea484dc5e926186df885
parent
493aaad4dc61224ff101425c283a36960fb6841b
download
0665c85caf7a0fcf53a6bfd4622050944285b49f.tar.gz

gcc: Pass --eh-frame-hdr to linker by default

This creates a PT_EH_FRAME section in Haiku binaries,
allowing 3rd party unwind libraries (libunwind) to obtain
frame information for unwind procedures.

Change-Id: If475909d182bcac11024ebbc8220456733330fe8
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/5434
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

Diff

 gcc/gcc/config/haiku.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/gcc/config/haiku.h b/gcc/gcc/config/haiku.h
index 316d384..37adf40 100644
--- a/gcc/gcc/config/haiku.h
+++ a/gcc/gcc/config/haiku.h
@@ -67,6 +67,12 @@
#define USE_LD_AS_NEEDED 1
#endif

/* Pass --eh-frame-hdr to provide a PT_EH_FRAME section, allowing unwind 
   libraries to get frame information. */
#if defined(HAVE_LD_EH_FRAME_HDR)

#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
#endif

#undef  STARTFILE_SPEC
#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s"