Bug 9557 - build succeeds, but binaries don't run
build succeeds, but binaries don't run
Product: Samba 4.0
Classification: Unclassified
Component: Build
: P5 critical
: ---
Assigned To: Björn Jacke
Samba QA Contact
: 10432 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2013-01-12 01:06 UTC by BHuntsman
Modified: 2016-02-23 21:14 UTC (History)
7 users (show)

See Also:

patch from master to fix missing symbols (1.28 KB, patch)
2013-03-22 16:15 UTC, Christian Ambach
ambi: review+
metze: review+
Proposed patch (1.29 KB, patch)
2016-02-23 21:14 UTC, Guillaume Xavier Taillon
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description BHuntsman 2013-01-12 01:06:07 UTC
AIX 6.1, fresh build specifically for development
XL C 12.1

The build system says that 'make' is successful.
The build system also says that 'make install' is successful.

Binaries are being installed into /opt/samba-4.0.0.

The resultant binaries will not run, however, as the following .so's are not copied into /opt/samba-4.0.0/lib:


If those items are manually copied, and LD_LIBRARY_PATH set, the smbd binary will produce the following output:

bash-3.2# /opt/samba-4.0.0/sbin/smbd -b
exec(): 0509-036 Cannot load program /opt/samba-4.0.0/sbin/smbd because of the following errors:
rtld: 0712-001 Symbol aixacl_to_smbacl was referenced
      from module /opt/samba-4.0.0/lib/private/libsmbd_base.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol aixacl_smb_to_aixacl was referenced
      from module /opt/samba-4.0.0/lib/private/libsmbd_base.so(), but a runtime definition
      of the symbol was not found.

So the following symbols are missing:


I'm opening this bug as these should be copied, and vfs_aixacl should be compiled statically on AIX.

As it is, the 4.0.0 stable does not run successfully when build on AIX.
Comment 1 BHuntsman 2013-01-31 22:22:43 UTC
This bug is also present in 4.0.1 and 4.0.2.
Comment 2 Christian Ambach 2013-02-01 17:10:06 UTC
This seems to be a problem with xlc (or the way the Samba build system uses it).

I can reproduce this on my AIX 6.1 machine, but I have to figure out how this is supposed to work with xlc.

The binaries are not properly linked (actually they are not linked to any of the Samba private libraries at all).

Using gcc however should work, as this is what is used in our buildfarm.
Comment 3 BHuntsman 2013-02-01 17:51:35 UTC
> Using gcc however should work, as this is what is used in our buildfarm.

In this case though we can not just fall back to GCC on AIX.  I hope we can determine a resolution that does not require Samba to be built under GCC only.

Please let me know if I can assist or provide additional information.
Comment 4 Christian Ambach 2013-03-22 16:15:57 UTC
Created attachment 8674 [details]
patch from master to fix missing symbols

Here is the patch from master that makes smbd run (but does not solve the library issue)
Comment 5 Christian Ambach 2013-03-22 16:20:25 UTC
I am still behind the problem with the libraries.

To me, the issue seems to be that AIX does not support the style of library versioning that the waf build expects.

from make install

* installing bin/default/lib/talloc/libtalloc.so as /data/prefix/v4-0-stable/lib/private/libtalloc.so.2.0.7
* symlink /data/prefix/v4-0-stable/lib/private/libtalloc.so.2 (-> libtalloc.so.2.0.7)

So we finally have (under $PREFIX)

bash-4.2# ls -al lib/private/libtalloc*
lrwxrwxrwx    1 root     system           18 Mar 18 17:06 lib/private/libtalloc.so.2 -> libtalloc.so.2.0.7
-rwxr-xr-x    1 root     system        44522 Mar 18 16:34 lib/private/libtalloc.so.2.0.7

while the binaries are linked to libtalloc.so:
# ldd sbin/smbd 2>&1 |grep talloc
Cannot find libtalloc.so 

AIX does not identify libtalloc.so.2 to be libtalloc.so

So it seems the waf build would either
1. need to install the libraries without version number or
2. link the binaries to the libs including the version number

Not sure if AIX is the only platform that is affected by this.
Comment 6 Stefan Metzmacher 2013-04-03 06:36:39 UTC
Comment on attachment 8674 [details]
patch from master to fix missing symbols

Looks good
Comment 7 Stefan Metzmacher 2013-04-03 06:37:40 UTC
Karolin, please pick the patch and reassign to ambi for the remaining issue.
Comment 8 Karolin Seeger 2013-04-07 19:51:50 UTC
Pushed to autobuild-v4-0-test.
Comment 9 Karolin Seeger 2013-04-08 06:49:34 UTC
Pushed to v4-0-test.
Closing out bug report.

Comment 10 Stefan Metzmacher 2013-04-15 06:50:01 UTC
Reopen for the 2nd problem
Comment 11 John Janosik 2013-11-19 21:32:37 UTC
I tried to compile Samba 4.1.0 on AIX with gcc so I could compare the library search path in the resulting binaries with what I'm getting in xlc, but that fails for me as well.  I opened bug https://bugzilla.samba.org/show_bug.cgi?id=10270 for that issue.  One part of the problem seems to be that waf is trying to detect rpath support via the -rpath option to the linker on AIX, but I can't find any version of ld on AIX that supports that.  I modified buildtools/wafadmin/Tools/xlc.py to use "-Wl,-bsvr4,-R%s" for the RPATH option and the rpath configure check is ok and I get working binaries in my install path.  However I don't get working binaries in the build tree so I suspect this isn't the right way to fix it.  Also for this testing I modified buildtools/wafsamba/samba_install.py:install_lib to create the dev symlink for private libraries if the platform is aix.

I could spend some more time on this to help but I would need some pointers on the right places to look.
Comment 12 Christian Ambach 2014-02-09 11:33:47 UTC
*** Bug 10432 has been marked as a duplicate of this bug. ***
Comment 13 Guillaume Xavier Taillon 2016-02-23 21:14:04 UTC
AIX Version: 7100-03-05-1524
XLC Version: 13.01.0003.0000
Samba Version: 4.3.5

Same problem. Fixed with by always "generating the dev link for non-bundled
libs" (see patch). $PREFIX/samba/lib and $PREFIX/samba/lib/private must be in LIBPATH.

Bug 10840 is probably a dup.
Comment 14 Guillaume Xavier Taillon 2016-02-23 21:14:50 UTC
Created attachment 11867 [details]
Proposed patch