diff options
author | Matoro Mahri <matoro@users.noreply.github.com> | 2023-07-08 23:23:27 -0400 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-07-09 05:46:25 +0100 |
commit | b3d94642a52b8a887c3ae1c249275ba1fb1da2cf (patch) | |
tree | e1be5a3b8ddb10d5ddfdc11245bd6518a17748fe /sci-mathematics/flint | |
parent | sys-apps/nvme-cli: drop redundant src_install (diff) | |
download | gentoo-b3d94642a52b8a887c3ae1c249275ba1fb1da2cf.tar.gz gentoo-b3d94642a52b8a887c3ae1c249275ba1fb1da2cf.tar.bz2 gentoo-b3d94642a52b8a887c3ae1c249275ba1fb1da2cf.zip |
sci-mathematics/flint: remove hardcoded CFLAGS
Bug: https://bugs.gentoo.org/909738
Signed-off-by: Matoro Mahri <matoro@users.noreply.github.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-mathematics/flint')
-rw-r--r-- | sci-mathematics/flint/files/flint-2.9.0-remove-hardcoded-CFLAGS.patch | 69 | ||||
-rw-r--r-- | sci-mathematics/flint/flint-2.9.0.ebuild | 1 |
2 files changed, 70 insertions, 0 deletions
diff --git a/sci-mathematics/flint/files/flint-2.9.0-remove-hardcoded-CFLAGS.patch b/sci-mathematics/flint/files/flint-2.9.0-remove-hardcoded-CFLAGS.patch new file mode 100644 index 000000000000..b057ea207bbd --- /dev/null +++ b/sci-mathematics/flint/files/flint-2.9.0-remove-hardcoded-CFLAGS.patch @@ -0,0 +1,69 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9784633c4..641ab9ed4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,5 @@ + cmake_minimum_required(VERSION 3.9) + +-include(CheckIPOSupported) + include(CheckIncludeFiles) + include(CheckFunctionExists) + include(CheckPrototypeDefinition) +@@ -126,13 +125,6 @@ with open(join('${CMAKE_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: + ) + configure_file(${CMAKE_BINARY_DIR}/CPimport.h.in ${CMAKE_BINARY_DIR}/CPimport.h COPYONLY) + +-# Setup for flint-config.h +-check_c_compiler_flag("-mpopcnt" HAS_FLAG_MPOPCNT) +-check_c_compiler_flag("-funroll-loops" HAS_FLAG_UNROLL_LOOPS) +- +-if(HAS_FLAG_MPOPCNT) +- set(CMAKE_REQUIRED_FLAGS "-mpopcnt") +-endif() + # Testing __builtin_popcountl... + check_c_source_runs([[int main(int argc, char ** argv) { + #if defined(_WIN64) +@@ -141,7 +133,6 @@ check_c_source_runs([[int main(int argc, char ** argv) { + return __builtin_popcountl(argc) == 100; + #endif + }]] FLINT_USES_POPCNT) +-unset(CMAKE_REQUIRED_FLAGS) + + # fenv configuration + check_c_source_compiles([[#include <fenv.h> +@@ -250,13 +241,6 @@ if(BUILD_SHARED_LIBS AND WIN32) + target_compile_definitions(flint PUBLIC "MSC_USE_DLL") + endif() + +-if (HAS_FLAG_MPOPCNT) +- target_compile_options(flint PUBLIC "-mpopcnt") +-endif() +-if (HAS_FLAG_UNROLL_LOOPS) +- target_compile_options(flint PUBLIC "-funroll-loops") +-endif() +- + # Versioning + + set_target_properties(flint PROPERTIES +@@ -279,21 +263,6 @@ elseif (WIN32) + set_target_properties(flint PROPERTIES RUNTIME_OUTPUT_NAME "flint-${FLINT_MAJOR}") + endif() + +-if(NOT DEFINED IPO_SUPPORTED) +- message(STATUS "Checking for IPO") +- check_ipo_supported(RESULT ipo_supported LANGUAGES C) +- if(ipo_supported) +- message(STATUS "Checking for IPO - found") +- else() +- message(STATUS "Checking for IPO - not found") +- endif() +- set(IPO_SUPPORTED ${ipo_supported} CACHE INTERNAL "Introprocedural Optimization" FORCE) +-endif() +- +-if(IPO_SUPPORTED) +- set_target_properties(flint PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) +-endif() +- + if(NOT MSVC) + target_link_libraries(flint PUBLIC m) + endif() diff --git a/sci-mathematics/flint/flint-2.9.0.ebuild b/sci-mathematics/flint/flint-2.9.0.ebuild index 5a1fb677b0b8..494339dd488e 100644 --- a/sci-mathematics/flint/flint-2.9.0.ebuild +++ b/sci-mathematics/flint/flint-2.9.0.ebuild @@ -41,6 +41,7 @@ DEPEND="dev-libs/gmp:= RDEPEND="${DEPEND}" S="${WORKDIR}/flint2-${PV}" +PATCHES=( "${FILESDIR}/${PN}-2.9.0-remove-hardcoded-CFLAGS.patch" ) src_prepare() { # https://github.com/wbhart/flint2/issues/1140 |