Skip to content

Commit

Permalink
wafsamba: use private extentions also for bundled public libraries
Browse files Browse the repository at this point in the history
Playing tricks with redefining libraries, which may also be installed in
the system with the same version, isn't really a good thing.
It may work in some cases, but there are so many things which may go
wrong. So if we build a library as private/bundled library we should
change the soname of the library.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780

Signed-off-by: Stefan Metzmacher <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
  • Loading branch information
metze-samba committed Nov 30, 2021
1 parent 43b90da commit da7c41e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 1 addition & 8 deletions buildtools/wafsamba/samba_bundled.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@
from waflib.Configure import conf
from wafsamba import samba_utils

def PRIVATE_NAME(bld, name, private_extension):
def PRIVATE_NAME(bld, name):
'''possibly rename a library to include a bundled extension'''

# we now use the same private name for libraries as the public name.
# see http://git.samba.org/?p=tridge/junkcode.git;a=tree;f=shlib for a
# demonstration that this is the right thing to do
# also see http://lists.samba.org/archive/samba-technical/2011-January/075816.html
if private_extension:
return name

extension = bld.env.PRIVATE_EXTENSION

if extension and name.startswith('%s' % extension):
Expand Down
6 changes: 1 addition & 5 deletions buildtools/wafsamba/wafsamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def SAMBA_LIBRARY(bld, libname, source,
pyembed=False,
pyext=False,
target_type='LIBRARY',
bundled_extension=False,
bundled_name=None,
link_name=None,
abi_directory=None,
Expand Down Expand Up @@ -232,10 +231,7 @@ def SAMBA_LIBRARY(bld, libname, source,
bundled_name = libname.replace('_', '-')
else:
assert (private_library == True and realname is None)
if abi_directory or vnum or soname:
bundled_extension=True
bundled_name = PRIVATE_NAME(bld, libname.replace('_', '-'),
bundled_extension)
bundled_name = PRIVATE_NAME(bld, libname.replace('_', '-'))

ldflags = TO_LIST(ldflags)
if bld.env['ENABLE_RELRO'] is True:
Expand Down

0 comments on commit da7c41e

Please sign in to comment.