Buildfailure on openSUSE, if built with "--no-undefined -Wl"
sfalken opened this issue · 6 comments
Expected Behavior
When using the following CMake flag, it should successfully build:
-DCMAKE_SHARED_LINKER_FLAGS=" -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now"
Current Behavior
Building with -DCMAKE_SHARED_LINKER_FLAGS=" -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" results in broken build:
https://susepaste.org/81371193
Possible Solution
Pass -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now" to CMake results in successful build
Steps to Reproduce (for bugs)
Build with "--no-undefined -Wl"
Context
Building latest released sources for distribution within openSUSE
System Information
- Distribution & Version: openSUSE Tumbleweed & openSUSE Leap 15.4
- Kernel: 5.19.2 (Tumbleweed) / 5.14.21 (Leap 15.4)
- Qt Version: 5.15.5 (Tumbleweed) / 5.15.2 (Leap 15.4)
- libqtxdg Version: 3.9.1 (Tumbleweed) / 3.8.0 (Leap 15.4)
- lxqt-build-tools Version: 0.11.0 (Tumbleweed) / 0.10.0 (Leap 15.4)
- Package version: 2.4.0
I haven't investigated it, but I confirm the build failure under Arch/Manjaro too.
EDIT: It's because of --no-undefined
.
The problem can be solved by making extedit
static:
diff -ruNp screengrab-orig/src/modules/extedit/CMakeLists.txt screengrab/src/modules/extedit/CMakeLists.txt
--- screengrab-orig/src/modules/extedit/CMakeLists.txt
+++ screengrab/src/modules/extedit/CMakeLists.txt
@@ -24,12 +24,10 @@ qt5_translation_loader(extedit_QM_LOADER
)
add_library(extedit
- SHARED
+ STATIC
${extedit_SRC}
${extedit_QMS}
${extedit_QM_LOADER}
)
-set_property (TARGET extedit PROPERTY SOVERSION 1.0.0)
-install(TARGETS extedit DESTINATION ${SG_LIBDIR})
target_link_libraries(extedit Qt5::Widgets Qt5::X11Extras Qt5Xdg)
Since I have no idea why it was a shared library, I'm not sure that this is the best solution. Screengrab seems to work fine with it though.
I neither know why qkeysequencewidget
has an option for making it a shared library, although it's OFF
by default.
The code of screengrab has always seemed strange to me...
openSUSE generally has a "no static libraries" policy in their packaging, but if that's how the thing is supposed to work, I can make the case for it, and see if the Factory maintainers are fine with it.
To be honest, I see no reason for having libraries here, but I respect the choices of the original authors anywhere in LXQt, as far as they cause no problem.
Anyway, qkeysequencewidget
has been static from start.
The code of screengrab needs to be reorganized. qkeysequencewidget
isn't needed when Qt has QKeySequenceEdit
(although it was needed when the code was written), and the single-instance mode has a problem.
As for this issue, I think extedit
was a fake shared library; --no-undefined
just revealed that. Waiting for a counterargument by LXQt devs....
Aye, it's not a huge deal for us, it's just one of our "Packaging Guidelines" there can be exceptions where they make sense.
The difference for packaging is only that there will be no ".so" files; nothing more.