From 4095fd7de10dffa3e1fa4a14ea77b04ccebf588f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 22 Jun 2024 15:30:54 +1100 Subject: [PATCH] avoid gcc linker tripping over -nostdlib++ --- recipe/meta.yaml | 2 ++ ...001-Support-legacy-standalone-builds.patch | 2 +- ...02-Fix-ABI-compatibility-with-system.patch | 2 +- ...003-custom-error-message-for-old-sdk.patch | 2 +- ...ve-workaround-for-C11-features-on-co.patch | 2 +- ...AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch | 2 +- ...age-for-libunwind-to-avoid-running-i.patch | 32 +++++++++++++++++++ 7 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 recipe/patches/0006-set-CXX-as-language-for-libunwind-to-avoid-running-i.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 56a5dc5..28768cd 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -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 diff --git a/recipe/patches/0001-Support-legacy-standalone-builds.patch b/recipe/patches/0001-Support-legacy-standalone-builds.patch index 8914f94..fdc9ff5 100644 --- a/recipe/patches/0001-Support-legacy-standalone-builds.patch +++ b/recipe/patches/0001-Support-legacy-standalone-builds.patch @@ -1,7 +1,7 @@ From bf0dac8954fed53dcc579ccf564dd011e11616b2 Mon Sep 17 00:00:00 2001 From: Isuru Fernando 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 +++++++++++++++++ diff --git a/recipe/patches/0002-Fix-ABI-compatibility-with-system.patch b/recipe/patches/0002-Fix-ABI-compatibility-with-system.patch index abd02b2..52338b1 100644 --- a/recipe/patches/0002-Fix-ABI-compatibility-with-system.patch +++ b/recipe/patches/0002-Fix-ABI-compatibility-with-system.patch @@ -1,7 +1,7 @@ From b1113a136e91b0788e2fa28e578142e45016eae9 Mon Sep 17 00:00:00 2001 From: Isuru Fernando 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 ++++++++-------- diff --git a/recipe/patches/0003-custom-error-message-for-old-sdk.patch b/recipe/patches/0003-custom-error-message-for-old-sdk.patch index 987b89b..c36671a 100644 --- a/recipe/patches/0003-custom-error-message-for-old-sdk.patch +++ b/recipe/patches/0003-custom-error-message-for-old-sdk.patch @@ -1,7 +1,7 @@ From 7e2722ee435b20f9445be40ace0f5298126ae23c Mon Sep 17 00:00:00 2001 From: Isuru Fernando 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 --- diff --git a/recipe/patches/0004-Revert-libc-Remove-workaround-for-C11-features-on-co.patch b/recipe/patches/0004-Revert-libc-Remove-workaround-for-C11-features-on-co.patch index ef3a2d5..47d6fef 100644 --- a/recipe/patches/0004-Revert-libc-Remove-workaround-for-C11-features-on-co.patch +++ b/recipe/patches/0004-Revert-libc-Remove-workaround-for-C11-features-on-co.patch @@ -1,7 +1,7 @@ From 1e69aea47bc666836672f1da1c4f8d6a515e8689 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" 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. diff --git a/recipe/patches/0005-disable-_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch b/recipe/patches/0005-disable-_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch index 06e181f..b102bf8 100644 --- a/recipe/patches/0005-disable-_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch +++ b/recipe/patches/0005-disable-_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch @@ -1,7 +1,7 @@ From 5499430ec91578805ae0ca5fd5c994f29e41b01d Mon Sep 17 00:00:00 2001 From: "H. Vetinari" 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 diff --git a/recipe/patches/0006-set-CXX-as-language-for-libunwind-to-avoid-running-i.patch b/recipe/patches/0006-set-CXX-as-language-for-libunwind-to-avoid-running-i.patch new file mode 100644 index 0000000..b0b89fd --- /dev/null +++ b/recipe/patches/0006-set-CXX-as-language-for-libunwind-to-avoid-running-i.patch @@ -0,0 +1,32 @@ +From 7d1809e27c49dadf14b791cdc93a1ea58a2d8def Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +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}" + ) +