Add static build & add -Bsymbolic for loadable extension#402
Open
YuweiXiao wants to merge 4 commits intoduckdb:mainfrom
Open
Add static build & add -Bsymbolic for loadable extension#402YuweiXiao wants to merge 4 commits intoduckdb:mainfrom
-Bsymbolic for loadable extension#402YuweiXiao wants to merge 4 commits intoduckdb:mainfrom
Conversation
Author
|
this PR shall solve #366 |
Collaborator
|
Hi, thanks for the PR! I'll close and reopen it to run the CI. On the contents of the PR - I wonder whether we need to pass the |
Collaborator
|
Despite passing on CI the build fails on newer GCC with the following: Suggested fix: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61f141e..68fc2f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -217,6 +217,7 @@ if(NOT WIN32 AND NOT APPLE)
endif()
target_link_libraries(${LOADABLE_EXTENSION_NAME} ${OPENSSL_LIBRARIES})
+set_property(TARGET ${EXTENSION_NAME} PROPERTY C_STANDARD 99)
set_property(TARGET ${LOADABLE_EXTENSION_NAME} PROPERTY C_STANDARD 99)
if(WIN32 |
Author
|
@staticlibs Hi Alex, thanks for the review. Comment addressed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
-Bsymbolicfor loadable extension buildWhen
postgres_scanneris loaded inside a PostgreSQL backend (e.g., via pg_duckdb), the connection to postgres may fail with:The cause: postgres_scanner statically compiles libpq with
-DFRONTEND=1, so function in libpq, i.e.,pg_link_canary_is_frontend(), would validate if it is running under FRONTEND during connection startup. However, on ELF systems, the dynamic linker resolves the function symbol to the PostgreSQL backend's version, which is not FRONTEND, leading to connection failure.By adding
-Bsymbolic, we enforce postgres_scanner to bind internal symbol references within the extension.