1
1

improves makefile

Este cometimento está contido em:
Henry Case 2021-06-22 01:10:08 +01:00
ascendente 6d3550454a
cometimento d9344d6956
3 ficheiros modificados com 40 adições e 10 eliminações

Ver ficheiro

@ -1,14 +1,40 @@
include(ExternalProject)
find_program(MAKE_PROGRAM make)
string (REPLACE " " "$<SEMICOLON>" LLVM_PROJECT_TARGETS "libcxx libcxxabi")
set(PREFIX ${CMAKE_CURRENT_BINARY_DIR}/3rd/llvm-project)
set(LLVM_LIB_CXX
${PREFIX}/usr/local/lib/libc++${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LLVM_LIB_CXXABI
${PREFIX}/usr/local/lib/libc++abi${CMAKE_STATIC_LIBRARY_SUFFIX})
ExternalProject_Add(
llvm-project
GIT_REPOSITORY https://github.com/llvm/llvm-project.git
GIT_TAG llvmorg-12.0.0
GIT_SHALLOW TRUE
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=${LLVM_PROJECT_TARGETS} -DLLVM_USE_SANITIZER=MemoryWithOrigins -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm-project/llvm
BUILD_COMMAND make cxx cxxabi
BUILD_COMMAND ${MAKE_PROGRAM} cxx cxxabi
INSTALL_COMMAND DESTDIR=${PREFIX} make install-cxx-headers install-cxx install-cxxabi
COMMENT "Building memcheck instrumented libc++ and libc++abi"
PREFIX ${PREFIX}
)
add_library(
cxx SHARED IMPORTED GLOBAL)
add_library(
cxxabi SHARED IMPORTED GLOBAL)
add_dependencies(
cxx
llvm-project)
add_dependencies(
cxxabi
llvm-project)
set_target_properties(
cxx PROPERTIES IMPORTED_LOCATION ${LLVM_LIB_CXX})
set_target_properties(
cxxabi PROPERTIES IMPORTED_LOCATION ${LLVM_LIB_CXXABI})
set_property(GLOBAL PROPERTY llvmproject_build_install_dir_property ${PREFIX}/usr/local)

Ver ficheiro

@ -19,7 +19,7 @@ if(MEMSAN)
if(ADDRSAN)
message(FATAL_ERROR "Can't use MSAN and ASAN")
endif()
include(.cmake/libstd-memcheck.mk)
include(.cmake/libstd-memory_sanitizer.mk)
# LLVM project location
set(LLVM_PRJ ${CMAKE_CURRENT_BINARY_DIR}/3rd/llvm-project)
@ -27,7 +27,7 @@ if(MEMSAN)
set(LLVM_PRJ_INC ${LLVM_PRJ}/usr/local/include)
# Add memory sanitizer instrumented libraries
set(CMAKE_ARGS_MEMCHECK_LIB "-stdlib=libc++ -L${LLVM_PRJ_LIB} -lc++abi -Wl,-rpath,${LLVM_PRJ_LIB}")
set(CMAKE_ARGS_MEMCHECK_LIB "-stdlib=libc++")
set(CMAKE_ARGS_MEMCHECK_INC "-isystem -I${LLVM_PRJ_INC} -I${LLVM_PRJ_INC}/c++/v1")
set(CMAKE_ARGS_MEMCHECK_FLAGS "-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -Wno-unused-command-line-argument")
set(EXTRA_CXX_FLAGS "${CMAKE_ARGS_MEMCHECK_FLAGS} ${CMAKE_ARGS_MEMCHECK_LIB} ${CMAKE_ARGS_MEMCHECK_INC} -DPQC_MEMSAN_BUILD")
@ -43,6 +43,7 @@ ExternalProject_Add(
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/3rd/gtest
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/3rd/gtest -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${EXTRA_CXX_FLAGS} -DCMAKE_C_FLAGS=${EXTRA_CXX_FLAGS} -Dgtest_disable_pthreads=ON
)
add_dependencies(gtest_project cxx cxxabi)
FetchContent_Declare(
gbench
@ -270,7 +271,6 @@ add_subdirectory(src/sign/sphincs/sphincs-sha256-256s-simple/avx2)
add_subdirectory(src/sign/sphincs/sphincs-sha256-256f-robust/avx2)
add_subdirectory(src/sign/sphincs/sphincs-sha256-256f-simple/avx2)
add_subdirectory(src/sign/sphincs/sphincs-sha256-256s-robust/avx2)
# KEMs
add_subdirectory(src/kem/kyber/kyber512/avx2)
add_subdirectory(src/kem/kyber/kyber768/avx2)
@ -348,6 +348,8 @@ add_executable(
target_link_libraries(
ut
cxx
cxxabi
gtest
gtest_main
pqc_s)

Ver ficheiro

@ -4,15 +4,17 @@ include_directories(${PROJECT_SOURCE_DIR}/3rd/gbench/include)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../3rd/gbench/lib)
add_executable(
bench
kyber.cc
bench
kyber.cc
)
target_link_libraries(
bench
bench
pqc
benchmark
benchmark_main
pqc
benchmark
benchmark_main
cxx
cxxabi
)