Skip to content

Commit

Permalink
avoid gcc linker tripping over -nostdlib++
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Jun 22, 2024
1 parent cb26ae9 commit 4095fd7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 5 deletions.
2 changes: 2 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ source:
- patches/0004-Revert-libc-Remove-workaround-for-C11-features-on-co.patch
# fix for https://github.com/llvm/llvm-project/issues/77653
- patches/0005-disable-_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch
# GCC's C linker does not understand -nostdlib++; needs CXX
- patches/0006-set-CXX-as-language-for-libunwind-to-avoid-running-i.patch

build:
number: 0
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/0001-Support-legacy-standalone-builds.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From bf0dac8954fed53dcc579ccf564dd011e11616b2 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Tue, 18 May 2021 19:51:28 -0500
Subject: [PATCH 1/5] Support legacy standalone builds
Subject: [PATCH 1/6] Support legacy standalone builds

---
libcxx/src/CMakeLists.txt | 17 +++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b1113a136e91b0788e2fa28e578142e45016eae9 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Tue, 13 Jul 2021 01:57:06 -0500
Subject: [PATCH 2/5] Fix ABI compatibility with system
Subject: [PATCH 2/6] Fix ABI compatibility with system

---
libcxx/src/locale.cpp | 16 ++++++++--------
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/0003-custom-error-message-for-old-sdk.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7e2722ee435b20f9445be40ace0f5298126ae23c Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Wed, 29 Dec 2021 19:28:35 -0800
Subject: [PATCH 3/5] custom error message for old sdk
Subject: [PATCH 3/6] custom error message for old sdk

Co-Authored-By: H. Vetinari <h.vetinari@gmx.com>
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1e69aea47bc666836672f1da1c4f8d6a515e8689 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Wed, 8 Feb 2023 16:44:15 +1100
Subject: [PATCH 4/5] Revert "[libc++] Remove workaround for C11 features on
Subject: [PATCH 4/6] Revert "[libc++] Remove workaround for C11 features on
compilers that don't support using_if_exists"

This reverts commit 21f73d5826fb5024a27eaacafadfa316f58949c5.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 5499430ec91578805ae0ca5fd5c994f29e41b01d Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 26 May 2024 22:04:04 +1100
Subject: [PATCH 5/5] disable _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
Subject: [PATCH 5/6] disable _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
unconditionally

https://github.com/llvm/llvm-project/issues/77653
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 7d1809e27c49dadf14b791cdc93a1ea58a2d8def Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 26 May 2024 13:01:28 +1100
Subject: [PATCH 6/6] set CXX as language for libunwind to avoid running into
unknown flags for CC

---
libunwind/src/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt
index 780430ba70ba..2cf2c8c0f1f7 100644
--- a/libunwind/src/CMakeLists.txt
+++ b/libunwind/src/CMakeLists.txt
@@ -168,7 +168,7 @@ if (LIBUNWIND_ENABLE_SHARED)
set_target_properties(unwind_shared
PROPERTIES
LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
- LINKER_LANGUAGE C
+ LINKER_LANGUAGE CXX
OUTPUT_NAME "${LIBUNWIND_SHARED_OUTPUT_NAME}"
VERSION "1.0"
SOVERSION "1"
@@ -214,7 +214,7 @@ if (LIBUNWIND_ENABLE_STATIC)
set_target_properties(unwind_static
PROPERTIES
LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
- LINKER_LANGUAGE C
+ LINKER_LANGUAGE CXX
OUTPUT_NAME "${LIBUNWIND_STATIC_OUTPUT_NAME}"
)

0 comments on commit 4095fd7

Please sign in to comment.