Bug 313763 - Compiling with clang 3.2 results in broken libraries
Summary: Compiling with clang 3.2 results in broken libraries
Status: RESOLVED FIXED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: 4.9
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on: 300429
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-23 14:21 UTC by Thomas Berger
Modified: 2013-08-21 10:46 UTC (History)
9 users (show)

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


Attachments
Additional symbols exportet by clang libplasma.so (27.63 KB, text/plain)
2013-02-08 12:30 UTC, Thomas Berger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Berger 2013-01-23 14:21:21 UTC
widgetexplorer, activitymanager and notifications does not work, because of non-existent property onClicked. 

Reproducible: Always

Steps to Reproduce:
1. try to add a widget
1. try to use activities
Actual Results:  
The toolbars are empty, no action possible

Expected Results:  
See some widgets to add or activites
Comment 1 Thomas Berger 2013-01-23 18:59:07 UTC
Full error message:

    plasma-desktop(15671)/libplasma Plasma::DeclarativeWidgetPrivate::errorPrint: "file:///usr/share/apps/plasma/packages/org.kde.desktop.widgetexplorer/contents/ui/main.qml
    Error loading QML file.
    51: Cannot assign to non-existent property "onClicked"
Comment 2 Thomas Berger 2013-02-01 15:26:17 UTC
Compiling with clang results in undefined or missing symbols in some libraries. 
This happens with "-02" and higher.
Comment 3 Christoph Feck 2013-02-07 23:51:58 UTC
Thomas, why did you reassign the bug? If this is a general KDE problem, do you have more detail what goes wrong?
Comment 4 Thomas Berger 2013-02-08 08:25:17 UTC
Trying to fix the problem by recompiling the plasma libraries results in a recursive missing symbols problem.

I had to rebuild kdelibs and some other basic packages to resolve this problems. So i reassigned to KDE.

I will take a deeper look these days.
Comment 5 Thomas Berger 2013-02-08 12:30:10 UTC
Created attachment 77009 [details]
Additional symbols exportet by clang libplasma.so

I have started to check the differences in the resulting so files, if kde is build with clang.

It's wired, as there are much more symbols exported. I could not find the differences right now, that causing this. Both builds was made with the default gentoo ebuild, and differenct compilers.
Comment 6 HonestQiao 2013-02-12 12:58:08 UTC
Unfortunately, I met the same problem.

uname:
FreeBSD x201i.honestqiao.com 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r246581: Sat Feb  9 16:17:47 CST 2013     root@x201i.honestqiao.com:/usr/obj/usr/src/sys/HonestQiaoKernel10  amd64

clang:
FreeBSD clang version 3.2 (tags/RELEASE_32/final 170710) 20121221

Activites:
ControllerWindow::resizeEvent QSize(-1, -1) 
plasma-desktop(2062)/libplasma Plasma::DeclarativeWidgetPrivate::errorPrint: "f
ile:///usr/local/share/apps/plasma/packages/org.kde.desktop.activitymanager/con
tents/ui/main.qml
Error loading QML file.
60: Cannot assign to non-existent property "onClicked"
" 
QDeclarativeComponent: Component is not ready
plasma-desktop(2062)/libplasma Plasma::DeclarativeWidgetPrivate::errorPrint: "f
ile:///usr/local/share/apps/plasma/packages/org.kde.desktop.activitymanager/con
tents/ui/main.qml
Error loading QML file.
60: Cannot assign to non-existent property "onClicked"
" 
kwin(2057) KWin::Client::readUserTimeMapTimestamp: User timestamp, ASN: 1886772
kwin(2057) KWin::Client::readUserTimeMapTimestamp: User timestamp, final: 'ID: 
29367304 ;WMCLASS: "plasma-desktop" : "plasma-desktop" ;Caption: "plasma-deskto
p" ' : 1886772
kwin(2057) KWin::Workspace::allowClientActivation: Activation: No client active
, allowing
kwin(2057) KWin::Workspace::updateClientArea: screens:  1 desktops:  2
kwin(2057) KWin::Workspace::updateClientArea: Done.




Widgets:
ControllerWindow::resizeEvent QSize(-1, -1) 
plasma-desktop(2062)/libplasma Plasma::DeclarativeWidgetPrivate::errorPrint: "f
ile:///usr/local/share/apps/plasma/packages/org.kde.desktop.widgetexplorer/cont
ents/ui/main.qml
Error loading QML file.
51: Cannot assign to non-existent property "onClicked"
" 
QDeclarativeComponent: Component is not ready
plasma-desktop(2062)/libplasma Plasma::DeclarativeWidgetPrivate::errorPrint: "f
ile:///usr/local/share/apps/plasma/packages/org.kde.desktop.widgetexplorer/cont
ents/ui/main.qml
Error loading QML file.
51: Cannot assign to non-existent property "onClicked"
" 
kwin(2057) KWin::Client::readUserTimeMapTimestamp: User timestamp, ASN: 2110642
kwin(2057) KWin::Client::readUserTimeMapTimestamp: User timestamp, final: 'ID: 
29368626 ;WMCLASS: "plasma-desktop" : "plasma-desktop" ;Caption: "plasma-deskto
p" ' : 2110642
kwin(2057) KWin::Workspace::allowClientActivation: Activation: No client active
, allowing
kwin(2057) KWin::Workspace::updateClientArea: screens:  1 desktops:  2
kwin(2057) KWin::Workspace::updateClientArea: Done.
Comment 7 Alberto Villa 2013-06-06 11:01:26 UTC
The additional symbols issue is explained in 300429. I confirm that instructing Clang to set -fvisibility=hidden in FindKDE4Internals.cmake and rebuilding kdelibs and all dependent packages fixes the issue.

Tested on FreeBSD 10 with Clang 3.3.
Comment 8 Kane 2013-06-10 17:15:52 UTC
I am also running into this problem.

uname -a
Linux maui-wowie 3.2.0-40-generic-tuxonice #64~ppa1-Ubuntu SMP Tue Apr 9 06:54:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

I can provide more info if you'd like, but it sounds like you already have it figured out.

"The additional symbols issue is explained in 300429. I confirm that instructing Clang to set -fvisibility=hidden in FindKDE4Internals.cmake and rebuilding kdelibs and all dependent packages fixes the issue." -  Alberto Villa

Is there any chance you could explain this further? If not it's cool.
Comment 9 Alberto Villa 2013-06-10 17:44:16 UTC
(In reply to comment #8)
> I can provide more info if you'd like, but it sounds like you already have
> it figured out.

No more info needed, thanks. I'll probably submit a patch very soon.

> "The additional symbols issue is explained in 300429. I confirm that
> instructing Clang to set -fvisibility=hidden in FindKDE4Internals.cmake and
> rebuilding kdelibs and all dependent packages fixes the issue." -  Alberto
> Villa
> 
> Is there any chance you could explain this further? If not it's cool.

As explained in https://bugs.kde.org/show_bug.cgi?id=300429, FindKDE4Internal only supports GCC, thus some flags get lost when compiling with Clang, especially visibility ones. This causes some problems when exporting the symbols of KDE libraries. The solution is to add Clang support to FindKDE4Internal.cmake, and I already have a patch I just need to cleanup.
Comment 10 Anthony Jenkins 2013-06-10 18:14:46 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > I can provide more info if you'd like, but it sounds like you already have
> > it figured out.
> 
> No more info needed, thanks. I'll probably submit a patch very soon.
> 
> > "The additional symbols issue is explained in 300429. I confirm that
> > instructing Clang to set -fvisibility=hidden in FindKDE4Internals.cmake and
> > rebuilding kdelibs and all dependent packages fixes the issue." -  Alberto
> > Villa
> > 
> > Is there any chance you could explain this further? If not it's cool.
> 
> As explained in https://bugs.kde.org/show_bug.cgi?id=300429,
> FindKDE4Internal only supports GCC, thus some flags get lost when compiling
> with Clang, especially visibility ones. This causes some problems when
> exporting the symbols of KDE libraries. The solution is to add Clang support
> to FindKDE4Internal.cmake, and I already have a patch I just need to cleanup.

I have the same issue (FreeBSD-10 (CURRENT), haven't been able to add widgets or activities in months.

Is a potential short-term workaround compiling plasma libs and dependencies with GCC instead of Clang?

Anthony Jenkins
Comment 11 Alberto Villa 2013-06-10 18:57:05 UTC
(In reply to comment #10)
> I have the same issue (FreeBSD-10 (CURRENT), haven't been able to add
> widgets or activities in months.
> 
> Is a potential short-term workaround compiling plasma libs and dependencies
> with GCC instead of Clang?

I think you'd have to rebuild kdelibs and most of its dependent ports, so my suggestion is to wait for the patch to reach the ports tree (a draft is already in area51), which will probably happen along with KDE 4.10.4 (not too far in the future).
Comment 12 Konrad Zemek 2013-07-02 18:07:00 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > I have the same issue (FreeBSD-10 (CURRENT), haven't been able to add
> > widgets or activities in months.
> > 
> > Is a potential short-term workaround compiling plasma libs and dependencies
> > with GCC instead of Clang?
> 
> I think you'd have to rebuild kdelibs and most of its dependent ports, so my
> suggestion is to wait for the patch to reach the ports tree (a draft is
> already in area51), which will probably happen along with KDE 4.10.4 (not
> too far in the future).

Hey Alberto, what is the status of your patch? I can see that FindKDE4Internal.cmake has not been modified in current kdelibs master.
Comment 13 Alberto Villa 2013-07-02 18:19:54 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > I think you'd have to rebuild kdelibs and most of its dependent ports, so my
> > suggestion is to wait for the patch to reach the ports tree (a draft is
> > already in area51), which will probably happen along with KDE 4.10.4 (not
> > too far in the future).
> 
> Hey Alberto, what is the status of your patch? I can see that
> FindKDE4Internal.cmake has not been modified in current kdelibs master.

We're testing a possible final version of the patch by Raphael Kubo da Costa; it should hit the ports tree in few days (we're waiting for a successful build of 4.10.4) and then will eventually be upstreamed by Raphael.
Comment 14 Raphael Kubo da Costa 2013-08-21 10:46:32 UTC
Better late than never...

I've just committed http://quickgit.kde.org/?p=kdelibs.git&a=commit&h=90cb7ba760584a8010afef65fa14e649195af6c6 (it should have posted a comment in this bug but I used the wrong email address to commit :-)

After commits 7148da9c94527ced3804c39662fa48756b091178 (present in 4.11.0) and 90cb7ba760584a8010afef65fa14e649195af6c6 (will be in 4.11.1), clang support should finally be in place, with proper visibility and all.