Open yuuch opened 1 month ago
This looks like a Meson bug, we should be honoring the Meson global configuration for pic based on the Meson b_staticpic
option, which helps to ensure that all subprojects and are built with the same PIC-ness as the superproject is.
This looks like a larger issue that we don't look at the builtin options inside CMake at all. This makes me wonder how we're not running into more of these issues...
This looks like a larger issue that we don't look at the builtin options inside CMake at all. This makes me wonder how we're not running into more of these issues...
Yes, there are lots of things to do, if you want to consider all the builtin options inside CMake.
Describe the bug My project requires the use of duckdb, which is compiled using CMake. My project is built using Meson, but when I try to compile it using Meson on my Linux system, it throws an error:
"Can't link non-PIC static library 'duckdb_static' into shared library duckdb. "
I have tried to use cmake to compile duckdb alone, it works well. I read the CMake files for duckdb, and it has set(CMAKE_POSITION_INDEPENDENT_CODE ON) enabled for global PIC, so I think this might be a Meson bug. I read the generated meson.build for duckdb, the duckdb_static is not pic. generated meson.build
Then, I read through the Meson code and found that it defaults to enabling PIC for OBJECT targets. So, I'm wondering if it's possible to also enable PIC for STATIC targets in Meson? On my machine, I modify the meson code ,it works well now, so can i pull request to this project?
To Reproduce here is the directory structure:
meson.build file:
Expected behavior compile success
system parameters Ubuntu 22.04 meson master