diff options
author | Michel Zou | 2020-11-02 20:01:01 +0100 |
---|---|---|
committer | Michel Zou | 2020-11-02 20:01:01 +0100 |
commit | 7e6bee98ab048edf5d2784638fe7301845d6c682 (patch) | |
tree | 17e91ec2729a02a842e91202353f87697bdc69d0 | |
parent | 3918d1e348fa469792a8a4d75c7af513a603d591 (diff) | |
download | aur-7e6bee98ab048edf5d2784638fe7301845d6c682.tar.gz |
PR69.patch
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | PR69.patch | 91 |
3 files changed, 96 insertions, 3 deletions
@@ -13,7 +13,9 @@ pkgbase = mingw-w64-hdf5 options = !buildflags options = staticlibs source = https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2 + source = PR69.patch sha256sums = 97906268640a6e9ce0cde703d5a71c9ac3092eded729591279bf2e3ca9765f61 + sha256sums = SKIP pkgname = mingw-w64-hdf5 @@ -8,8 +8,8 @@ license=('custom') depends=('mingw-w64-crt' 'mingw-w64-zlib') makedepends=('mingw-w64-cmake' 'mingw-w64-wine') options=('!strip' '!buildflags' 'staticlibs') -source=("https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${pkgver:0:4}/hdf5-${pkgver/_/-}/src/hdf5-${pkgver/_/-}.tar.bz2") -sha256sums=('97906268640a6e9ce0cde703d5a71c9ac3092eded729591279bf2e3ca9765f61') +source=("https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${pkgver:0:4}/hdf5-${pkgver/_/-}/src/hdf5-${pkgver/_/-}.tar.bz2" PR69.patch) +sha256sums=('97906268640a6e9ce0cde703d5a71c9ac3092eded729591279bf2e3ca9765f61' SKIP) _architectures="i686-w64-mingw32 x86_64-w64-mingw32" @@ -27,7 +27,7 @@ prepare () { sed -i 's|_INSTALL_CMAKE_DIR cmake|_INSTALL_CMAKE_DIR share/cmake|g' config/cmake_ext_mod/HDFMacros.cmake # avoid static-libstdc++ - sed -i "s|if (MINGW)|if (0)|g" c++/src/CMakeLists.txt + patch -p1 -i "$srcdir/PR69.patch" } build() { diff --git a/PR69.patch b/PR69.patch new file mode 100644 index 000000000000..fe3fa549f276 --- /dev/null +++ b/PR69.patch @@ -0,0 +1,91 @@ +From 7259b5eb7ac291f00cc989a44c5fe4964759efaf Mon Sep 17 00:00:00 2001 +From: Michel Zou <xantares09@hotmail.com> +Date: Fri, 30 Oct 2020 10:44:24 +0100 +Subject: [PATCH] CMake: Add an option to opt-out static libgcc + +With sjlj exception model, statically link to libgcc/libstdc++ +prevents exceptions to be caught from other dynamic libraries. +--- + CMakeLists.txt | 2 ++ + c++/examples/CMakeLists.txt | 4 ++-- + c++/src/CMakeLists.txt | 2 +- + c++/test/CMakeLists.txt | 2 +- + config/cmake/cacheinit.cmake | 2 ++ + release_docs/INSTALL_CMake.txt | 1 + + release_docs/RELEASE.txt | 7 +++++++ + 7 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d0eebad8b0..dc2cf1af52 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -578,6 +578,8 @@ if (WIN32 OR MINGW) + add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1 _CRT_SECURE_NO_WARNINGS _CONSOLE) + endif () + ++option (HDF5_MINGW_STATIC_GCC_LIBS "Statically link libgcc/libstdc++" OFF) ++ + if (MSVC) + set (CMAKE_MFC_FLAG 0) + set (WIN_COMPILE_FLAGS "") +diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt +index 3035841095..c50315f6a5 100644 +--- a/c++/examples/CMakeLists.txt ++++ b/c++/examples/CMakeLists.txt +@@ -41,7 +41,7 @@ foreach (example ${examples}) + else () + TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) +- if (MINGW) ++ if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) + target_link_options (${HDF5_CPP_LIBSH_TARGET} + PRIVATE -static-libgcc -static-libstdc++ + ) +@@ -66,7 +66,7 @@ foreach (example ${tutr_examples}) + else () + TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) +- if (MINGW) ++ if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) + target_link_options (${HDF5_CPP_LIBSH_TARGET} + PRIVATE -static-libgcc -static-libstdc++ + ) +diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt +index 04822cf520..de2306e928 100644 +--- a/c++/src/CMakeLists.txt ++++ b/c++/src/CMakeLists.txt +@@ -117,7 +117,7 @@ if (BUILD_SHARED_LIBS) + target_link_libraries (${HDF5_CPP_LIBSH_TARGET} + PUBLIC ${HDF5_LIBSH_TARGET} + ) +- if (MINGW) ++ if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) + target_link_options (${HDF5_CPP_LIBSH_TARGET} + PRIVATE -static-libgcc -static-libstdc++ + ) +diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt +index 550b7eae8b..1255e39d3d 100644 +--- a/c++/test/CMakeLists.txt ++++ b/c++/test/CMakeLists.txt +@@ -49,7 +49,7 @@ if (NOT BUILD_SHARED_LIBS) + else () + TARGET_C_PROPERTIES (cpp_testhdf5 SHARED) + target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET}) +- if (MINGW) ++ if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) + target_link_options (${HDF5_CPP_LIBSH_TARGET} + PRIVATE -static-libgcc -static-libstdc++ + ) +diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake +index f8ab3a25d2..71c8b4a592 100644 +--- a/config/cmake/cacheinit.cmake ++++ b/config/cmake/cacheinit.cmake +@@ -40,6 +40,8 @@ set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) + + set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) + ++set (HDF5_MINGW_STATIC_GCC_LIBS ON CACHE BOOL "Statically link libgcc/libstdc++" FORCE) ++ + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) + set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) + |