mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
r23689: Squashed commit of the following:
commit 0d4bbd197198a94bf4e29e0ccd175a40a60097f3 Author: Gerald (Jerry) Carter <jerry@samba.org> Date: Mon Jul 2 20:08:19 2007 -0500 Introduce GNU ld linker export-script for hiding non-public symbols in shared libraries. Based on initial patch from Julien Cristau <jcristau@debian.org> and suggestions from James Peach <jpeach@samba.org>. Currently the libsmbsharemodes libraries still exports *. Signed off on my Derrell as well.
This commit is contained in:
parent
f3bb102c24
commit
c42cf731b4
@ -21,6 +21,12 @@ LIBS=@LIBS@
|
||||
CC=@CC@
|
||||
SHLD=@SHLD@
|
||||
|
||||
## Dynamic shared libraries build settings
|
||||
DSO_EXPORTS_CMD=-Wl,--version-script,exports/`basename $@ | sed 's/@SHLIBEXT@$$/syms/'`
|
||||
DSO_EXPORTS=@DSO_EXPORTS@
|
||||
SONAME_VER=`grep ^$@ $(srcdir)/library-versions | cut -d: -f2`
|
||||
SHLD_DSO = $(SHLD) $(LDSHFLAGS) $(DSO_EXPORTS)
|
||||
|
||||
# Add $(DEVELOPER_CFLAGS) to $(CFLAGS) to enable extra compiler
|
||||
# (GCC) warnings. This is done automtically for --enable-developer
|
||||
# and --enable-krb5developer.
|
||||
@ -125,20 +131,9 @@ LOCKDIR = @lockdir@
|
||||
PIDDIR = @piddir@
|
||||
|
||||
LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
|
||||
LIBSMBCLIENT_MAJOR=0
|
||||
LIBSMBCLIENT_MINOR=1
|
||||
|
||||
LIBMSRPC=bin/libmsrpc.a @LIBMSRPC_SHARED@
|
||||
LIBMSRPC_MAJOR=0
|
||||
LIBMSRPC_MINOR=1
|
||||
|
||||
LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
|
||||
LIBSMBSHAREMODES_MAJOR=0
|
||||
LIBSMBSHAREMODES_MINOR=2
|
||||
|
||||
LIBADDNS=bin/libaddns.a @LIBADDNS_SHARED@
|
||||
LIBADDNS_MAJOR=0
|
||||
LIBADDNS_MINOR=1
|
||||
|
||||
FLAGS1 = $(CFLAGS) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS)
|
||||
FLAGS2 =
|
||||
@ -1357,9 +1352,9 @@ bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@
|
||||
|
||||
bin/libaddns.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
|
||||
@echo Linking libaddns shared library $@
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(LIBADDNS_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
@$(SHLD_DSO) -o $@ $(LIBADDNS_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
$(KRB5LIBS) $(UUID_LIBS)\
|
||||
@SONAMEFLAG@`basename $@`.$(LIBADDNS_MAJOR)
|
||||
@SONAMEFLAG@`basename $@`.$(SONAME_VER)
|
||||
|
||||
bin/libaddns.a: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
|
||||
@echo Linking libaddns non-shared library $@
|
||||
@ -1367,9 +1362,9 @@ bin/libaddns.a: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
|
||||
|
||||
bin/libsmbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
|
||||
@echo Linking libsmbclient shared library $@
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
@$(SHLD_DSO) -o $@ $(LIBSMBCLIENT_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
$(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
|
||||
@SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
|
||||
@SONAMEFLAG@`basename $@`.$(SONAME_VER)
|
||||
|
||||
bin/libsmbclient.a: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
|
||||
@echo Linking libsmbclient non-shared library $@
|
||||
@ -1377,9 +1372,9 @@ bin/libsmbclient.a: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
|
||||
|
||||
bin/libsmbsharemodes.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ)
|
||||
@echo Linking libsmbsharemodes shared library $@
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBSHAREMODES_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
@$(SHLD_DSO) -o $@ $(LIBSMBSHAREMODES_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
$(KRB5LIBS) $(LDAP_LIBS) \
|
||||
@SONAMEFLAG@`basename $@`.$(LIBSMBSHAREMODES_MAJOR)
|
||||
@SONAMEFLAG@`basename $@`.$(SONAME_VER)
|
||||
|
||||
bin/libsmbsharemodes.a: $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ)
|
||||
@echo Linking libsmbsharemodes non-shared library $@
|
||||
@ -1387,8 +1382,8 @@ bin/libsmbsharemodes.a: $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ)
|
||||
|
||||
bin/libmsrpc.@SHLIBEXT@: $(BINARY_PREREQS) $(CAC_OBJ)
|
||||
@echo Linking libmsrpc shared library $@
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(CAC_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
@SONAMEFLAG@`basename $@`.$(LIBMSRPC_MAJOR)
|
||||
@$(SHLD_DSO) -o $@ $(CAC_OBJ) $(LDFLAGS) $(LIBS) \
|
||||
@SONAMEFLAG@`basename $@`.$(SONAME_VER)
|
||||
|
||||
bin/libmsrpc.a: $(BINARY_PREREQS) $(CAC_OBJ)
|
||||
@echo Linking libmsrpc non-shared library $@
|
||||
|
@ -283,6 +283,7 @@ AC_SUBST(LDSHFLAGS)
|
||||
AC_SUBST(MODULE_EXPORTS)
|
||||
AC_SUBST(SONAMEFLAG)
|
||||
AC_SUBST(SHLD)
|
||||
AC_SUBST(DSO_EXPORTS)
|
||||
AC_SUBST(HOST_OS)
|
||||
AC_SUBST(PICFLAG)
|
||||
AC_SUBST(PIE_CFLAGS)
|
||||
@ -545,6 +546,9 @@ if test "$ac_cv_prog_gnu_ld" = "yes"; then
|
||||
if test "$ac_cv_gnu_ld_date" -lt 20030217; then
|
||||
ac_cv_gnu_ld_no_default_allow_shlib_undefined=yes
|
||||
fi
|
||||
if test "$ac_cv_gnu_ld_date" -gt 20030101; then
|
||||
ac_cv_gnu_ld_version_script=yes
|
||||
fi
|
||||
else
|
||||
AC_MSG_CHECKING(GNU ld release version)
|
||||
changequote(,)dnl
|
||||
@ -560,6 +564,9 @@ if test "$ac_cv_prog_gnu_ld" = "yes"; then
|
||||
if test "$ac_cv_gnu_ld_vernr_major" -lt 2 || test "$ac_cv_gnu_ld_vernr_minor" -lt 14; then
|
||||
ac_cv_gnu_ld_no_default_allow_shlib_undefined=yes
|
||||
fi
|
||||
if test "$ac_cv_gnu_ld_vernr_major" -gt 2 || test "$ac_cv_gnu_l= d_vernr_major"=2 && test "$ac_cv_gnu_ld_vernr_minor" -ge 12; then
|
||||
ac_cv_gnu_ld_version_script=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -1839,7 +1846,7 @@ SONAMEFLAG="#"
|
||||
SHLD="\${CC} \${CFLAGS}"
|
||||
PICFLAG="${PIE_CFLAGS}"
|
||||
SHLIBEXT="so"
|
||||
|
||||
DSO_EXPORTS=""
|
||||
|
||||
# this bit needs to be modified for each OS that supports share libs
|
||||
# You need to specify how to create a shared library and
|
||||
@ -2037,6 +2044,10 @@ if test "$enable_shared" != "yes"; then
|
||||
BLDSHARED=false
|
||||
fi
|
||||
|
||||
if test "$enable_shared" = yes -a "${ac_cv_gnu_ld_version_script}" = yes; then
|
||||
DSO_EXPORTS=\$\(DSO_EXPORTS_CMD\)
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT($BLDSHARED)
|
||||
|
||||
AC_MSG_CHECKING([LDFLAGS])
|
||||
@ -6469,7 +6480,7 @@ AC_SUBST(builddir)
|
||||
SMBD_LIBS="$samba_dmapi_libs"
|
||||
AC_SUBST(SMBD_LIBS)
|
||||
|
||||
AC_OUTPUT(Makefile script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh)
|
||||
AC_OUTPUT(Makefile library-versions script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh)
|
||||
|
||||
#################################################
|
||||
# Print very concise instructions on building/use
|
||||
|
4
source/exports/libsmbclient.syms
Normal file
4
source/exports/libsmbclient.syms
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
global: smbc_*;
|
||||
local: *;
|
||||
};
|
3
source/exports/libsmbsharemodes.syms
Normal file
3
source/exports/libsmbsharemodes.syms
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
global: *;
|
||||
};
|
9
source/library-versions.in
Normal file
9
source/library-versions.in
Normal file
@ -0,0 +1,9 @@
|
||||
##
|
||||
## Basic script for defining the major and minor librrary revision numbers
|
||||
## Makefile_target:major:minor
|
||||
##
|
||||
bin/libsmbclient.@SHLIBEXT@:0:1
|
||||
bin/libsmbsharemodes.@SHLIBEXT@:0:2
|
||||
bin/libaddns.@SHLIBEXT@:0:1
|
||||
bin/libmsrpc.@SHLIBEXT@:0:1
|
||||
|
Loading…
Reference in New Issue
Block a user