[PATCH] fix various build problems

Michael Adam obnox at samba.org
Tue Oct 28 11:28:19 MDT 2014


Hi,

We have a certain group of problems with our build:

These show up when certain FOO-config programs
(like cups-config or python-config) report library
paths for ldflags (-L/some/path) which are actually
standard lib paths for the system. pkg-config
does NOT do that by default, but the above two do.

Then what happens is that in the linking phase,
a too old version of a library which is installed
in that standard libpath is chosen instead of the
newer one that was reported by pkg-config.

A typical example is a new version of tdb, that
e.g. supports robust mutexs. A test is running

./script/autobuild.py samba-ctdb on a system
that supports robust mutexes. This test first
installs tdb into the prefix and then
configures and builds samba against this.
Linking fails.

Another example is bug
https://bugzilla.samba.org/show_bug.cgi?id=10515
which prevents builds on FreeBSD to succeed under
certain circumstances.

Attached is a patch to fix this problem.
It does so by filtering out the standard directories.
It uses ${CC} -print-search-dirs to build
the list of standard lib dirs. At least gcc and clang
support this.

The patch may need some more changes, because it
currently touches wafadmin to filter the standard paths.

Doing it in wafsamba would be more complicated because
one would need to parse and dissect the LINKFLAGS
again. The wafadmin code can act on the pure paths.
And I'd need to find a proper place to do it.

But I wanted to share this patch for testing
and feedback now that I have really spent a lot of
time on it. A first hack that was system-specific
dates back to June and was done together with Metze,
who also showed -print-search-dirs to me ...

Comments please! :-)

Thanks, Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-TODO-build-fix-issue-with-standard-libpaths-introduc.patch
Type: text/x-diff
Size: 6065 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141028/505f751f/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141028/505f751f/attachment.pgp>


More information about the samba-technical mailing list