Bug #55215 -laio missing from embedded libs
Submitted: 13 Jul 2010 14:25 Modified: 20 Aug 2010 14:45
Reporter: Jonathan Perkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.5.5-m3, 5.6.99 OS:Linux
Assigned to: Jonathan Perkin CPU Architecture:Any

[13 Jul 2010 14:25] Jonathan Perkin
Description:
InnoDB in 5.5.5 introduced a dependancy on libaio when compiling on Linux.

However, mysql_config does not include '-laio' in the output for '--libmysqld-libs', resulting in linker errors, for example:

  usr/lib/mysql/libmysqld.a(os0file.c.o): In function `os_aio_linux_create_io_ctx':
 rpm/BUILD/mysql-5.5.5-m3/mysql-5.5.5-m3/storage/innobase/os/os0file.c:3125: undefined reference to `io_setup'

This appears to only affect libmysqld, libmysqlclient links ok.

How to repeat:
Build 5.5.5-m3 on Linux and try to link against libmysqld.

Suggested fix:
Something is missing in the CMake configuration to instruct -laio to be included in @LIBS@ or similar.
[13 Jul 2010 20:59] Sveta Smirnova
Thank you for the report.

Verified as described.
[14 Jul 2010 11:25] Vladislav Vaintroub
possible patch

Attachment: patch.diff (application/octet-stream, text), 3.43 KiB.

[14 Jul 2010 11:30] Vladislav Vaintroub
explanation of the patch attached:

We already use CMake's internal variables <target>_LIB_DEPENDS to calculate flags for the client library. This patch encapsulates the logic of converting LIB_DEPENDS to linker flags in a macro, and uses this macro to generate CLIENT_LIBS and LIBS for client rsp embedded libraries.

Also fixes inappropriate use of @LIBS@ for libs_r variable (that should be @CLIENT_LIBS@)
[14 Jul 2010 11:40] Vladislav Vaintroub
Applying the patch (to mysql-next-mr-bugfixing) would add -laio to the linker flags for mysqld, as expected.
...

       --libmysqld-libs [-L/usr/local/mysql/lib -lmysqld -lpthread -lm -lrt -lcrypt -ldl -laio]
[9 Aug 2010 13:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/115320

3078 Jonathan Perkin	2010-08-09
      Apply wlad's fix for bug#55215
[10 Aug 2010 14:12] Jonathan Perkin
Merged to *-bugfixing.
[16 Aug 2010 6:30] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@sun.com-20100816062701-qo9dpnk5tkt1pksb) (version source revid:alik@sun.com-20100816062603-xc16eftmv7rmktyq) (merge vers: 5.6.1-m4) (pib:20)
[16 Aug 2010 6:41] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100816062819-bluwgdq8q4xysmlg) (version source revid:alik@sun.com-20100816062612-enatdwnv809iw3s9) (pib:20)
[17 Aug 2010 10:54] MC Brown
A note has been added to the 5.6.1 changelog: 
      The <command>mysql_config</command> tool would not output the                                                                                        
      requirement for the <literal>aio</literal> library                                                                                                   
      for <literal>mysqld-libs</literal>.
[20 Aug 2010 14:45] MC Brown
Added to the 5.5.6 changelog