Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creation of shared library for libTink #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chaudhryusama
Copy link

This commit enable to cross compile the libTink by creating a shared library.

@morambro morambro self-assigned this May 26, 2023
@morambro morambro added the enhancement New feature or request label May 26, 2023
URL https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz
SHA256 bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
)
endif()
# Rapidjson is a header-only library with no explicit target. Here we create one.
add_library(rapidjson INTERFACE)
target_include_directories(rapidjson INTERFACE "${rapidjson_SOURCE_DIR}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this variable populated when TINK_USE_INSTALLED_RAPIDJSON=ON?

@@ -110,7 +110,7 @@ if (NOT TARGET crypto)
"$<BUILD_INTERFACE:${boringssl_SOURCE_DIR}/src/include>")
else()
# Support for ED25519 was added from 1.1.1.
find_package(OpenSSL 1.1.1 REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving 1.1.1 here provides a lower bound for OpenSSL which is what we want. I my understanding correct?

tink_cc_library(
NAME cc
SRCS
set(TINK_PUBLIC_APIS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TINK_PUBLIC_API_HDRS?

${TINK_PUBLIC_APIS}
DEPS
${TINK_PUBLIC_API_DEPS}
PUBLIC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: PUBLIC should be aligned with DEPS

target_link_libraries(tink
PRIVATE
-Wl,--whole-archive
${TINK_PUBLIC_API_DEPS}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this, would the tink target include (and export) absl?

This commit enable to cross compile the libTink
by creating a shared library.

Signed-off-by: Muhammad Usama <[email protected]>
@jayprakashkumar1
Copy link

jayprakashkumar1 commented Mar 25, 2024

@chaudhryusama @morambro
I have tried this building creation of shared library for libtink.
I am getting following error in step
cmake --build .

I have cloned this: https://github.com/chaudhryusama/tink-cc

My Cmake command:
$ cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DTINK_BUILD_SHARED_LIB=ON
$ cmake --build .

[ 83%] Linking CXX shared library libtink.dylib
**clang: error: invalid linker name in argument '-fuse-ld=gold'**
make[2]: *** [tink/libtink.2.1.1.dylib] Error 1
make[1]: *** [tink/CMakeFiles/tink.dir/all] Error 2
make: *** [all] Error 2
(base) itadmin@ITs-MacBook-Pro build %

Platform: macOS 14.2 MacBook Pro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants