Skip to content

Commit

Permalink
try something to fix unreproducable error
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Yang committed Jun 13, 2024
1 parent a61d352 commit 34f9521
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
8 changes: 5 additions & 3 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ if(GO_EXECUTABLE)
else()
file(COPY ${GENERATE_CODE_ROOT}/err_data.c DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
endif()
add_library(generated_err_data OBJECT err_data.c)
target_include_directories(generated_err_data PRIVATE ${PROJECT_SOURCE_DIR}/include)
if(FIPS)
add_library(generated_err_data OBJECT err_data.c)
target_include_directories(generated_err_data PRIVATE ${PROJECT_SOURCE_DIR}/include)
endif()

set(DILITHIUM_SOURCES)
if(ENABLE_DILITHIUM)
Expand Down Expand Up @@ -617,7 +619,7 @@ if(FIPS_SHARED)
-p $<TARGET_FILE:crypto> -o $<TARGET_FILE:crypto> ${INJECT_HASH_APPLE_FLAG}
DEPENDS inject_hash
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
)
else()
add_custom_command(
TARGET crypto POST_BUILD
Expand Down
34 changes: 18 additions & 16 deletions crypto/fips_hashing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
add_definitions(-DOPENSSL_NO_ASM=1)
remove_definitions(-DBORINGSSL_FIPS -DFIPS_ENTROPY_SOURCE_JITTER_CPU -DFIPS_ENTROPY_SOURCE_PASSIVE)
if(FIPS AND APPLE)
add_definitions(-DOPENSSL_NO_ASM=1)
remove_definitions(-DBORINGSSL_FIPS -DFIPS_ENTROPY_SOURCE_JITTER_CPU -DFIPS_ENTROPY_SOURCE_PASSIVE)

add_library(
fips_hashing

STATIC
add_library(
fips_hashing
STATIC

fips_hashing.c
fips_hashing.c

../mem.c
../thread_none.c
../thread_pthread.c
../mem.c
../thread_none.c
../thread_pthread.c

../err/err.c
../decrepit/ripemd/ripemd.c
)
../err/err.c
$<TARGET_OBJECTS:generated_err_data>
../decrepit/ripemd/ripemd.c
)

SET_TARGET_PROPERTIES(fips_hashing PROPERTIES LINKER_LANGUAGE C)
target_include_directories(fips_hashing PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
target_link_libraries(fips_hashing generated_err_data)
SET_TARGET_PROPERTIES(fips_hashing PROPERTIES LINKER_LANGUAGE C)
target_include_directories(fips_hashing PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
endif()

0 comments on commit 34f9521

Please sign in to comment.