git: ce1070f1121f - main - security/nflib: Remove NATIVE option
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 07 Aug 2023 06:44:55 UTC
The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=ce1070f1121f0d062dcf393bdc42f39d15438e13 commit ce1070f1121f0d062dcf393bdc42f39d15438e13 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2023-08-07 06:42:51 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2023-08-07 06:44:53 +0000 security/nflib: Remove NATIVE option Let CPUTYPE handle native optimizations. PR: 272702 Reported by: diizzy@ --- security/nflib/Makefile | 6 +----- security/nflib/files/patch-CMakeCompilers.txt | 11 +++++++++++ security/nflib/files/patch-CMakeLists.txt | 11 ++++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/security/nflib/Makefile b/security/nflib/Makefile index 6b821c36d14c..686d3f61c5e5 100644 --- a/security/nflib/Makefile +++ b/security/nflib/Makefile @@ -2,7 +2,7 @@ PORTNAME= nflib DISTVERSIONPREFIX= v DISTVERSION= 1.0.0-23 DISTVERSIONSUFFIX= -g5cf40ed -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= security math MAINTAINER= yuri@FreeBSD.org @@ -28,10 +28,6 @@ USE_LDCONFIG= yes CMAKE_ON= NFL_OPTIMIZED -OPTIONS_DEFINE= NATIVE - -NATIVE_DESC= Build with native optimizations (-march=native) - post-patch-NATIVE-off: @${REINPLACE_CMD} -e 's|-march=native|| ; s|-mtune=native||' ${WRKSRC}/CMakeLists.txt ${WRKSRC}/CMakeCompilers.txt diff --git a/security/nflib/files/patch-CMakeCompilers.txt b/security/nflib/files/patch-CMakeCompilers.txt new file mode 100644 index 000000000000..7448594f4a83 --- /dev/null +++ b/security/nflib/files/patch-CMakeCompilers.txt @@ -0,0 +1,11 @@ +--- CMakeCompilers.txt.orig 2023-08-07 06:26:47 UTC ++++ CMakeCompilers.txt +@@ -16,7 +16,7 @@ endif() + # optimization flags support + if(CMAKE_BUILD_TYPE MATCHES Release) + set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3") +- foreach(FLAG -march=native -mtune=native -funroll-loops) ++ foreach(FLAG -funroll-loops) + string(REGEX REPLACE -= _ FLAG_ID ${FLAG}) + string(TOUPPER ${FLAG_ID} FLAG_ID) + CHECK_CXX_COMPILER_FLAG(${FLAG} COMPILER_SUPPORTS${FLAG_ID}) diff --git a/security/nflib/files/patch-CMakeLists.txt b/security/nflib/files/patch-CMakeLists.txt index 66188024ab0b..67616fe75fb4 100644 --- a/security/nflib/files/patch-CMakeLists.txt +++ b/security/nflib/files/patch-CMakeLists.txt @@ -1,5 +1,14 @@ ---- CMakeLists.txt.orig 2020-02-22 22:31:07 UTC +--- CMakeLists.txt.orig 2019-11-18 12:19:53 UTC +++ CMakeLists.txt +@@ -12,7 +12,7 @@ if(NFL_OPTIMIZED) + + include(CheckCXXSourceCompiles) + set(CMAKE_CXX_FLAGS_OLD ${CMAKE_CXX_FLAGS}) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") ++ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + + check_cxx_source_compiles("#include <immintrin.h>\nint main() { return 0;}" NFLLIB_USE_AVX) + check_cxx_source_compiles("#include <pmmintrin.h>\nint main() { return 0;}" NFLLIB_USE_SSE) @@ -64,4 +64,6 @@ install(FILES ${NFLLIB_HDRS_3} DESTINATION include/nfl install(FILES ${NFLLIB_HDRS_4} DESTINATION include/nfl/opt/arch) install(FILES ${NFLLIB_PRNG_HDRS} DESTINATION include/nfl/prng)