MDEV-35462: fix - compiler flags for RocksDB still need PIC#5217
MDEV-35462: fix - compiler flags for RocksDB still need PIC#5217grooverdan wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the CMake build configuration for RocksDB by enabling position-independent code (POSITION_INDEPENDENT_CODE ON) for the rocksdblib target. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
vaintroub
left a comment
There was a problem hiding this comment.
Actually, fPIC should have been handled by ADD_CONVENIENCE_LIBRARY, this thing was there alone for that purpose, to compile static libraries with shared libraries flags. and predates corresponding CMake property. but worked ok so far, and this is why we do not recompile mysys or strings for embedded shared library.
e00a6f8 to
bf360e1
Compare
There was a problem hiding this comment.
I would not do tpool_embedded, but rather compile it with PIC. I'd even prefer SET_TARGET_PROPERTIES(POSITION_INDEPENDENT_CODE) to the dated ADD_CONVENIENCE_LIBRARY contraption. Either always (my preference), or if WITH_EMBEDDED_SERVER is set or Innodb is compiled as dynamic plugin (it links directly to tpool, so it does need PIC in this case)
I do not think tpool with PIC will have register pressure or much impact of GOT redirection, and this won't have any noticeable impact on performance, it is rather heavy on system and library calls, so PIC here won't have much impact, even on systems where PIC means overhead.
Historically, "embedded" convention, and "recompile for embedded" is that : only libraries that depend on EMBEDDED_LIBRARY preprocessor symbol get their "_embedded" counterparts. Because then the ABI is different, sizeof(THD) varies and this is the main reason. There is no THD in tpool, it is kept clean of such things, by design :) Other code, that could be used in shared libraries, was compiled with PIC
…Lists.txt (fix) -fPIC was erronously removed in 526f076. Replaced with the POSITION_INDEPENDENT_CODE target property.
bf360e1 to
6f791f3
Compare
|
Leaving the full cleanup of PIC on #5250. For now, lets just get the build working again (aocc worker highlighted the problem) |
vaintroub
left a comment
There was a problem hiding this comment.
For the purpose of fixing the build, OK
-fPIC was incorrectly removed in 526f076.
As the rocksdb static library is dynamicly linked to the rocksdb storage engine, position independent code is required.