#2 Add riscv64 support
Merged 3 months ago by troycurtisjr. Opened 4 months ago by u2fsdgvkx1.
https://github.com/fedora-riscv/rapidfuzz-cpp f39-rv64  into  rawhide

Remove -march=native
David Abdurachmanov • 3 months ago  
rapidfuzz-cpp.spec
file modified
+2
@@ -24,6 +24,8 @@

  URL: %{forgeurl}

  Source: %{forgesource}

  

+ Patch0: remove-march-native.patch

+ 

  BuildRequires: cmake

  BuildRequires: doxygen

  BuildRequires: clang

remove-march-native.patch
file added
+25
@@ -0,0 +1,25 @@

+ diff --git a/bench/CMakeLists.txt b/bench/CMakeLists.txt

+ index 2fcee92..c51ce90 100644

+ --- a/bench/CMakeLists.txt

+ +++ b/bench/CMakeLists.txt

+ @@ -11,8 +11,6 @@ FetchContent_MakeAvailable(

+          googletest

+          googlebenchmark)

+  

+ -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")

+ -

+  function(rapidfuzz_add_benchmark NAME SOURCE)

+      add_executable(bench_${NAME} ${SOURCE})

+      target_link_libraries(bench_${NAME} PRIVATE ${PROJECT_NAME})

+ diff --git a/fuzzing/CMakeLists.txt b/fuzzing/CMakeLists.txt

+ index 64a8819..7964ce7 100644

+ --- a/fuzzing/CMakeLists.txt

+ +++ b/fuzzing/CMakeLists.txt

+ @@ -3,7 +3,7 @@ function(create_fuzzer fuzzer)

+      target_compile_features(fuzz_${fuzzer} PUBLIC cxx_std_17)

+      target_link_libraries(fuzz_${fuzzer} PRIVATE rapidfuzz::rapidfuzz)

+  

+ -    target_compile_options(fuzz_${fuzzer} PRIVATE -g -O1 -fsanitize=fuzzer,address -march=native)

+ +    target_compile_options(fuzz_${fuzzer} PRIVATE -g -O1 -fsanitize=fuzzer,address)

+      target_link_libraries(fuzz_${fuzzer} PRIVATE -fsanitize=fuzzer,address)

+  endfunction(create_fuzzer)

no initial comment

This change should have no %ifarch riscv64. Compiling with --march=native is wrong in general.

This also lacks Release: bump and changelog entry.

This change should have no %ifarch riscv64. Compiling with --march=native is wrong in general.

Yes, here's a similar package which removes -march=native universally:
https://src.fedoraproject.org/rpms/rapidjson/blob/rawhide/f/rapidjson.spec#_98

Note that it's even wrong on x86-64, since it will specialise the code for the Koji builder, which then might fail on the end user's machine.

rebased onto 00cd827

4 months ago

rebased onto 591b2bb

4 months ago

LGTM, let's see what the package maintainer thinks.

rebased onto c878c41

3 months ago

Pull-Request has been merged by troycurtisjr

3 months ago

Looks good. Sorry it took so long, I forgot that this rapidfuzz related package I was the primary on!