File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -250,9 +250,13 @@ function(duckdb_add_library target_name)
250250endfunction ()
251251
252252function (duckdb_link_extensions target_name )
253- # Link to the DuckDB static library and extensions
254- target_link_libraries (${target_name}
255- PRIVATE duckdb_generated_extension_loader )
253+ # Link to the DuckDB static library and extensions We use WHOLE_ARCHIVE
254+ # because duckdb_static calls LoadAllExtensions which is defined in the
255+ # extension loader. Without this, linkers (especially on Linux with
256+ # --as-needed) may drop the extension loader before seeing the reference.
257+ target_link_libraries (
258+ ${target_name}
259+ PRIVATE "$<LINK_LIBRARY :WHOLE_ARCHIVE ,duckdb_generated_extension_loader >" )
256260 if (BUILD_EXTENSIONS)
257261 message (STATUS "Linking DuckDB extensions:" )
258262 foreach (ext IN LISTS BUILD_EXTENSIONS)
You can’t perform that action at this time.
0 commit comments