ssanthosh243 / semicomplete

Automatically exported from code.google.com/p/semicomplete
0 stars 0 forks source link

[xdotool] Compilation fails with the --as-needed linker flag #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Try compiling with: `LDFLAGS="-Wl,--as-needed" make'

What is the expected output? What do you see instead?

The expected outcome is a successful compilation. Instead, I get linking
errors like:

./libxdo.so: undefined reference to `XTestFakeRelativeMotionEvent'
./libxdo.so: undefined reference to `XFree'
./libxdo.so: undefined reference to `XTestFakeKeyEvent'
./libxdo.so: undefined reference to `XStringToKeysym'
./libxdo.so: undefined reference to `XConfigureWindow'
./libxdo.so: undefined reference to `XAllocClassHint'

What version of the product are you using? On what operating system?

xdotool 1.20100302.2708 on Arch Linux.

Please provide any additional information below.

Gentoo has some great documentation [1] on the reason the compilation with
--as-needed is failing. The section that applies in this situation is
called "Importance of linking order". It basically says that the libraries
we link to, need to come after the object files that use functions from
them. So, in the libxdo.so rule, we need to put "$(LIBS)" at the end.

----
[1] http://www.gentoo.org/proj/en/qa/asneeded.xml#doc_chap2_sect6

Original issue reported on code.google.com by foutrelis@gmail.com on 2 Mar 2010 at 5:47

GoogleCodeExporter commented 9 years ago
Thanks for the report!

Fixed in r2712; release here:
http://semicomplete.googlecode.com/files/xdotool-1.20100302.2713.tar.gz

Original comment by jls.semi...@gmail.com on 2 Mar 2010 at 7:33