Skip to content

Commit

Permalink
Build fips_shared_support.c as part of libcrypto
Browse files Browse the repository at this point in the history
This aligns with the generated build, where fips_shared_support.c is
part of crypto_sources, not the delocated part.

It is conceptually part of bcm, but our generated builds currently
only separate on basis of delocated/partial-linked vs. not delocated.

Bug: 542
Change-Id: Ib8de3fb0a7778c9000c3b4fca978d43cb9a29d12
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67267
Reviewed-by: Adam Langley <[email protected]>
Reviewed-by: Bob Beck <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
(cherry picked from commit ae719ab057a7db33a388fd52ea30397273036d63)
  • Loading branch information
davidben authored and nebeid committed Jan 3, 2025
1 parent d9e7533 commit 54c9001
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
9 changes: 4 additions & 5 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,10 @@ add_subdirectory(fipsmodule)
if(FIPS_DELOCATE OR FIPS_SHARED)
SET_SOURCE_FILES_PROPERTIES(fipsmodule/${BCM_NAME} PROPERTIES EXTERNAL_OBJECT true)
SET_SOURCE_FILES_PROPERTIES(fipsmodule/${BCM_NAME} PROPERTIES GENERATED true)

set(
CRYPTO_FIPS_OBJECTS

fipsmodule/${BCM_NAME}
set(CRYPTO_FIPS_OBJECTS fipsmodule/${BCM_NAME}
)
else()
set(CRYPTO_FIPS_OBJECTS $<TARGET_OBJECTS:fipsmodule>)
endif()

if(ARCH STREQUAL "arm")
Expand Down Expand Up @@ -439,6 +437,7 @@ add_library(
evp_extra/scrypt.c
evp_extra/sign.c
ex_data.c
fipsmodule/fips_shared_support.c
hpke/hpke.c
hrss/hrss.c
kyber/kyber512r3_ref.c
Expand Down
29 changes: 3 additions & 26 deletions crypto/fipsmodule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,7 @@ if(FIPS_DELOCATE)
enable_language(ASM)
endif()

add_library(
bcm_c_generated_asm

STATIC

bcm.c
)
add_library(bcm_c_generated_asm STATIC bcm.c)
target_compile_definitions(bcm_c_generated_asm PRIVATE BORINGSSL_IMPLEMENTATION)

add_dependencies(bcm_c_generated_asm boringssl_prefix_symbols)
Expand Down Expand Up @@ -414,13 +408,7 @@ if(FIPS_DELOCATE)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/bcm-delocated.S PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl -mavx512ifma")
endif()

add_library(
bcm_hashunset

STATIC

bcm-delocated.S
)
add_library(bcm_hashunset STATIC bcm-delocated.S)
target_compile_definitions(bcm_hashunset PRIVATE BORINGSSL_IMPLEMENTATION)

add_dependencies(bcm_hashunset boringssl_prefix_symbols)
Expand Down Expand Up @@ -450,7 +438,6 @@ if(FIPS_DELOCATE)

OBJECT

fips_shared_support.c
cpucap/cpucap.c
)
target_compile_definitions(fipsmodule PRIVATE BORINGSSL_IMPLEMENTATION)
Expand All @@ -470,7 +457,6 @@ elseif(FIPS_SHARED)

OBJECT

fips_shared_support.c
cpucap/cpucap.c
)
target_compile_definitions(fipsmodule PRIVATE BORINGSSL_IMPLEMENTATION)
Expand All @@ -479,15 +465,7 @@ elseif(FIPS_SHARED)
target_include_directories(fipsmodule BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include)
target_include_directories(fipsmodule PRIVATE ${PROJECT_SOURCE_DIR}/include)

add_library(
bcm_library

STATIC

bcm.c

${BCM_ASM_SOURCES}
)
add_library(bcm_library STATIC bcm.c ${BCM_ASM_SOURCES} )
target_compile_definitions(bcm_library PRIVATE BORINGSSL_IMPLEMENTATION)
target_include_directories(bcm_library PRIVATE ${PROJECT_SOURCE_DIR}/include)

Expand Down Expand Up @@ -591,7 +569,6 @@ else()
OBJECT

bcm.c
fips_shared_support.c
cpucap/cpucap.c

${BCM_ASM_SOURCES}
Expand Down

0 comments on commit 54c9001

Please sign in to comment.