Skip to content

Declare the SDKs' libcurl and OpenSSL as their link dependencies - #19

Merged
nalinigans merged 1 commit into
mainfrom
tf_sdk_link_deps
Oct 21, 2026
Merged

nalinigans merged 1 commit into
mainfrom
tf_sdk_link_deps

Conversation

@tfenne

@tfenne tfenne commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

When TileDB builds the AWS SDK or google-cloud-cpp itself, it links their static libraries through imported targets that didn't declare that they need libcurl and OpenSSL. CMake puts a library on a link line once, after whatever declares a dependency on it, so with static OpenSSL libcrypto could come before google-cloud-cpp's libraries. #17 listed libcurl and OpenSSL after the SDKs in tiledb_static's link libraries for that, but the order of that list doesn't decide where CMake puts them: in GenomicsDB's distributable build with GCC, OpenSSL lands right after azure-storage-lite, which also uses it, ahead of the SDKs, and GNU ld leaves google-cloud-cpp's reference to BIO_f_base64 unresolved: the test programs fail to link, and the shared library links with the symbol undefined, to fail when GCS code first calls it. With the SDKs already built, the AWS SDK's own CMake targets happen to pull OpenSSL in after them, which is why it shows only in clean builds.

The imported targets now declare libcurl and OpenSSL as their link dependencies, so CMake puts them after the SDKs.

Tested with GenomicsDB's distributable build, SDKs built from scratch, on Linux aarch64 with GCC 15.2 and clang 21 and on macOS arm64 with Apple clang 21: everything links and GenomicsDB's C++ tests pass. Without this change, GCC's link of GenomicsDB's library with -Wl,--no-undefined fails on BIO_f_base64.

When TileDB builds the AWS SDK or google-cloud-cpp itself, it links their
static libraries through imported targets that did not say they need
libcurl and OpenSSL. CMake puts a library on a link line once, after
whatever declares a dependency on it, so with static OpenSSL libcrypto
could come before google-cloud-cpp, and GNU ld then left its reference
to BIO_f_base64 unresolved: executables linking tiledb_static failed to
link, and shared libraries linked with the symbol undefined. Listing
libcurl and OpenSSL after the SDKs in tiledb_static's link libraries did
not place them after the SDKs. The imported targets now declare them as
their link dependencies.
@tfenne
tfenne requested a review from nalinigans October 17, 2026 15:39

@nalinigans nalinigans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@nalinigans
nalinigans merged commit 87541c8 into main Oct 21, 2026
18 of 19 checks passed
@nalinigans
nalinigans deleted the tf_sdk_link_deps branch October 21, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants