Bug 410237 - [dolphin] : link failure with the LLVM 5 toolchain
Summary: [dolphin] : link failure with the LLVM 5 toolchain
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 19.04.3
Platform: Compiled Sources Linux
: NOR critical
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-26 16:50 UTC by RJVB
Modified: 2019-11-12 16:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
CMake incantation and execution environment (2.43 KB, text/plain)
2019-07-26 16:50 UTC, RJVB
Details
CMakeCache.txt (63.34 KB, text/plain)
2019-07-26 16:51 UTC, RJVB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2019-07-26 16:50:38 UTC
Created attachment 121744 [details]
CMake incantation and execution environment

SUMMARY
I configured dolphin 19.04.3 for building with the LLVM 5 toolchain (clang++-5 but also llvm-ar-5 and llvm-nm-5 as far as that's relevant).

For some reason this led to a link failure:
```
[100%] Linking CXX executable ../bin/dolphin
cd /opt/local/var/lnxports/build/_opt_local_site-ports_kf5_kf5-dolphin/kf5-dolphin/work/build/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/dolphin.dir/link.txt --verbose=ON
:info:build /opt/local/bin/clang++-mp-5.0  -O3 -g -DNDEBUG -isystem/opt/local/include -std=c++11 -m64 -std=c++0x -fno-operator-names -fno-exceptions -DQT_NO_EXCEPTIONS -Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time -pedantic  -Wzero-as-null-pointer-constant  -Wl,--enable-new-dtags -Wl,--enable-new-dtags -Wl,-rpath,/opt/local/lib -Wl,-rpath,/opt/local/libexec/qt5/lib -rdynamic CMakeFiles/dolphin.dir/dolphin_autogen/mocs_compilation.cpp.o CMakeFiles/dolphin.dir/dolphin_dummy.cpp.o  -o ../bin/dolphin -Wl,-rpath,/opt/local/lib/x86_64-linux-gnu ../bin/libkdeinit5_dolphin.so
make[2]: Leaving directory `/opt/local/var/lnxports/build/_opt_local_site-ports_kf5_kf5-dolphin/kf5-dolphin/work/build'
[100%] Built target dolphinsearchboxtest
../bin/libkdeinit5_dolphin.so: undefined reference to `DolphinViewActionHandler::createDirectoryTriggered()'
../bin/libkdeinit5_dolphin.so: undefined reference to `DolphinView::tabRequested(QUrl const&, DolphinTabWidget::TabPlacement)'
../bin/libkdeinit5_dolphin.so: undefined reference to `KItemModelBase::onSortRoleChanged(QByteArray const&, QByteArray const&, bool)'
../bin/libkdeinit5_dolphin.so: undefined reference to `KItemListController::indexCloseToMousePressedPosition() const'
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
make[2]: *** [bin/dolphin] Error 1
make[2]: Leaving directory `/opt/local/var/lnxports/build/_opt_local_site-ports_kf5_kf5-dolphin/kf5-dolphin/work/build'
make[1]: *** [src/CMakeFiles/dolphin.dir/all] Error 2
m
```


STEPS TO REPRODUCE
1. Configure as outlined in the attachments
2. invoke make

OBSERVED RESULT
The error above.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kernel 4.14.
KDE Frameworks Version: 5.60.0
Qt Version: 5.9.8

ADDITIONAL INFORMATION
Explicitly linking in libdolphinprivate solves the issue, in src/CMakeLists.txt :

target_link_libraries(dolphin
    dolphinprivate
)
Comment 1 RJVB 2019-07-26 16:51:46 UTC
Created attachment 121745 [details]
CMakeCache.txt
Comment 2 Elvis Angelaccio 2019-07-28 10:33:40 UTC
(In reply to RJVB from comment #0)
> Explicitly linking in libdolphinprivate solves the issue, in
> src/CMakeLists.txt :
> 
> target_link_libraries(dolphin
>     dolphinprivate
> )

Can you submit a patch on phabricator?
Comment 3 RJVB 2019-11-12 16:49:05 UTC
Git commit 83dc0afe4670a31656bd05604fe26ab407b3af8e by René Bertin.
Committed on 12/11/2019 at 16:47.
Pushed by rjvbb into branch 'master'.

make link with LLVM

This patch fixes a link failure when building with the LLVM toolchain
which does not discover the dependency on or pull in the private dolphin
library when linking dolphin itself.
Differential Revision: https://phabricator.kde.org/D22802

M  +3    -2    src/CMakeLists.txt

https://commits.kde.org/dolphin/83dc0afe4670a31656bd05604fe26ab407b3af8e