Skip to content

Instantly share code, notes, and snippets.

@oreo639
Created March 25, 2023 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oreo639/7c59c0576ecc4378dbebbe3c2730fdfe to your computer and use it in GitHub Desktop.
Save oreo639/7c59c0576ecc4378dbebbe3c2730fdfe to your computer and use it in GitHub Desktop.
diff --git a/srcpkgs/llvm15/patches/libcxx-armv67.patch b/srcpkgs/llvm15/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000..1dab312c83
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-arm.patch
@@ -0,0 +1,22 @@
+See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180
+Avoid the following undefined reference:
+
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__x() const [clone .localalias]':
+locale.cpp:(.text._ZNKSt3__120__time_get_c_storageIcE3__xEv+0xb4): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__X() const [clone .localalias]':
+
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,12 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIB
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+
++set(VOID_GCC_BUG_109180_WORKAROUND OFF CACHE BOOL "")
++
++if (VOID_GCC_BUG_109180_WORKAROUND)
++ set_source_files_properties(string.cpp PROPERTIES COMPILE_FLAGS -fno-inline)
++endif()
++
+ if (APPLE AND LLVM_USE_SANITIZER)
+ if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
+ ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index adad30265b..cf7bde85e4 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -151,6 +151,7 @@ pre_configure() {
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+ armv*) configure_args+=" -DVOID_GCC_BUG_109180_WORKAROUND=ON" ;;
esac
if [ "$CROSS_BUILD" ]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment