Skip to content

Commit

Permalink
fix kem template to prevent duplicate symbols in object files
Browse files Browse the repository at this point in the history
Signed-off-by: Pravek Sharma <[email protected]>
  • Loading branch information
praveksharma committed Apr 24, 2024
1 parent d0296d7 commit ba326c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
{%- if impl['name'] == scheme['default_implementation'] %}

if(OQS_ENABLE_LIBJADE_KEM_{{ family }}_{{ scheme['scheme_c'] }}{%- if 'alias_scheme' in scheme %} OR OQS_ENABLE_LIBJADE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}{%- endif %})
add_library(jasmin_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} OBJECT kem_{{ family }}_{{ scheme['scheme'] }}.c {% for source_file in impl['sources']|sort -%}{{ impl['upstream']['name'] }}_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }}/{{ source_file }}{%- if not loop.last %} {% endif -%}{%- endfor -%})
add_library(jasmin_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} OBJECT {% for source_file in impl['sources']|sort -%}{{ impl['upstream']['name'] }}_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }}/{{ source_file }}{%- if not loop.last %} {% endif -%}{%- endfor -%})
{%- if impl['compile_opts'] %}
target_compile_options(jasmin_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PUBLIC {{ impl['compile_opts'] }})
{%- endif -%}
Expand Down
4 changes: 2 additions & 2 deletions src/kem/kyber/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ endif()
##### OQS_COPY_FROM_LIBJADE_FRAGMENT_CMAKELISTS_START

if(OQS_ENABLE_LIBJADE_KEM_kyber_512)
add_library(jasmin_kyber_512_ref OBJECT kem_kyber_512.c libjade_kyber512_ref/api.c libjade_kyber512_ref/kem.S)
add_library(jasmin_kyber_512_ref OBJECT libjade_kyber512_ref/api.c libjade_kyber512_ref/kem.S)
target_include_directories(jasmin_kyber_512_ref PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libjade_kyber512_ref)
target_include_directories(jasmin_kyber_512_ref PRIVATE ${PROJECT_SOURCE_DIR}/src/common/libjade_shims)
set(_KYBER_OBJS ${_KYBER_OBJS} $<TARGET_OBJECTS:jasmin_kyber_512_ref>)
Expand All @@ -107,7 +107,7 @@ if(OQS_ENABLE_LIBJADE_KEM_kyber_512_avx2)
endif()

if(OQS_ENABLE_LIBJADE_KEM_kyber_768)
add_library(jasmin_kyber_768_ref OBJECT kem_kyber_768.c libjade_kyber768_ref/api.c libjade_kyber768_ref/kem.S)
add_library(jasmin_kyber_768_ref OBJECT libjade_kyber768_ref/api.c libjade_kyber768_ref/kem.S)
target_include_directories(jasmin_kyber_768_ref PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libjade_kyber768_ref)
target_include_directories(jasmin_kyber_768_ref PRIVATE ${PROJECT_SOURCE_DIR}/src/common/libjade_shims)
set(_KYBER_OBJS ${_KYBER_OBJS} $<TARGET_OBJECTS:jasmin_kyber_768_ref>)
Expand Down

0 comments on commit ba326c3

Please sign in to comment.