libmidori-core.so lacks linking to -lX11 for 2 symbols from it, XFree() and XGetWindowProperty()

Bug #1299515 reported by Samuli Suominen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Midori Web Browser
Fix Released
Undecided
Unassigned

Bug Description

Since functions are used from libX11 in midori/sokoke.c, the -lX11 should be linked against. Currently the CMakeLists.txt
is checking if libX11 exists, but then it fails to do anything with it!

Linking C executable midori
cd /var/tmp/portage/www-client/midori-0.5.7/work/midori-0.5.7_build/midori && /usr/bin/cmake -E cmake_link_script CMakeFiles/midori.dir/link.txt --verbose=1
make[2]: Leaving directory '/var/tmp/portage/www-client/midori-0.5.7/work/midori-0.5.7_build'
make -f tests/CMakeFiles/actions.dir/build.make tests/CMakeFiles/actions.dir/build
/usr/bin/x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -frecord-gcc-switches -Wimplicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu CMakeFiles/midori.dir/main.c.o -o midori -rdynamic libmidori-core.so.0.0.0 libmidori-core-vala.a -lxml2 -lsqlite3 -lgmodule-2.0 -lsoup-gnome-2.4 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lXss -lnotify -lgdk_pixbuf-2.0 -lwebkitgtk-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype -ljavascriptcoregtk-1.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lXss -lnotify -lgdk_pixbuf-2.0 -lwebkitgtk-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype -ljavascriptcoregtk-1.0 -Wl,-rpath,/var/tmp/portage/www-client/midori-0.5.7/work/midori-0.5.7_build/midori:
../midori/libmidori-core.so.0.0.0: error: undefined reference to 'XGetWindowProperty'
../midori/libmidori-core.so.0.0.0: error: undefined reference to 'XFree'
collect2: error: ld returned 1 exit status

The problem can be reproduced with the binutils 2.24's ld gold linker and -Wl,--as-needed LDFLAGS, because it's stricker linker, and correctly so. The problem is in midori's side.

The attached patch fixes the problem

Related branches

Revision history for this message
Samuli Suominen (ssuominen) wrote :
Revision history for this message
Samuli Suominen (ssuominen) wrote :

I forgot to say that the bug is in latest release, 0.5.7

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Thanks for the fix. Would you be willing to change this patch into a branch and proposing to merge it with lp:midori? That way it could be automatically commited.

Revision history for this message
Samuli Suominen (ssuominen) wrote :

I'm not an active launchpad user, or an experienced mercurial user, so that would be a learning curve, and thus, take some time, with uploading the keys and everything...

I can't promise anything, but I'll try to find time, but honestly, I'd prefer if someone just grab it, small change...

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Ok then. We will do it for you.
But if you happen to have some other bigger patches in the future bzr branch is a preffered way ;)
Thanks again.

Changed in midori:
status: New → Fix Committed
Cris Dywan (kalikiana)
Changed in midori:
status: Fix Committed → Fix Released
Revision history for this message
Samuli Suominen (ssuominen) wrote :

I appericiate it. 0.5.8 builds fine without any patches now :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.