Skip to content

Commit

Permalink
Merge pull request #26 from AntelopeIO/fixlto
Browse files Browse the repository at this point in the history
refactor assembly usage to separate file to avoid current undefined behavior; fixes LTO builds
  • Loading branch information
spoonincode authored Feb 11, 2025
2 parents 6b718d1 + 98b367d commit 472a13f
Show file tree
Hide file tree
Showing 4 changed files with 1,325 additions and 1,343 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ jobs:
- cfg: {name: 'gcc10', runson: 'ubuntu-latest', container: 'debian:bullseye'}
- cfg: {name: 'gcc11', runson: 'ubuntu-latest', container: 'ubuntu:jammy'}
- cfg: {name: 'gcc12', runson: 'ubuntu-latest', container: 'debian:bookworm'}
- cfg: {name: 'gcc13', runson: 'ubuntu-latest', container: 'ubuntu:noble'}
- cfg: {name: 'gcc-arch', runson: 'ubuntu-latest', container: 'archlinux'}
- cfg: {name: 'clang-arch', runson: 'ubuntu-latest', container: 'archlinux',
cmake: '-DCMAKE_CXX_COMPILER=clang++'}
- cfg: {name: 'clang-lto-arch', runson: 'ubuntu-latest', container: 'archlinux',
cmake: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=On'}
- cfg: {name: 'clang-libc++-arch', runson: 'ubuntu-latest', container: 'archlinux',
cmake: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-stdlib=libc++'}
- cfg: {name: 'clang-UBSAN-arch', runson: 'ubuntu-latest', container: 'archlinux',
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT CMAKE_BUILD_TYPE A
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

project(bls12-381 VERSION 1.0.0)
project(bls12-381 VERSION 1.0.0 LANGUAGES CXX ASM)

file(GLOB BLS12-381_SOURCES CONFIGURE_DEPENDS src/*.cpp)
file(GLOB BLS12-381_HEADERS CONFIGURE_DEPENDS include/bls12-381/*.hpp)
Expand All @@ -15,6 +15,11 @@ target_include_directories(bls12-381 PUBLIC include)
set_target_properties(bls12-381 PROPERTIES PUBLIC_HEADER "${BLS12-381_HEADERS}")
target_compile_features(bls12-381 PUBLIC cxx_std_20)

if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
target_sources(bls12-381 PRIVATE src/arithmetic.s)
set_source_files_properties(src/arithmetic.s PROPERTIES COMPILE_FLAGS "-Wno-unused-command-line-argument")
endif()

# the tests
enable_testing()
add_subdirectory(test)
Expand Down
Loading

0 comments on commit 472a13f

Please sign in to comment.