[SCM] Samba Shared Repository - branch master updated

Björn Jacke bjacke at samba.org
Tue Jul 20 05:49:07 MDT 2010


The branch, master has been updated
       via  2a8399f... s3: check for explicit external lib bug in ld's as-needed code
       via  0994430... s3: add configure swtich to manually disable as-needed
       via  fa4dec3... Revert "s3: Don't use as-needed"
      from  4581902... s3-dcerpc: Unifiy cli_pipe_auth_data and pipe_auth_data

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2a8399f7ce676e7e4fa70e8f8f04ba2876350695
Author: Björn Jacke <bj at sernet.de>
Date:   Tue Jul 20 13:39:59 2010 +0200

    s3: check for explicit external lib bug in ld's as-needed code
    
    Second part of fix for bug #7561
    
    Based on test provided by Olaf Flebbe.

commit 09944302a195a3571dde29e3f77134a7542e1077
Author: Björn Jacke <bj at sernet.de>
Date:   Tue Jul 20 13:35:03 2010 +0200

    s3: add configure swtich to manually disable as-needed
    
    first part fix for bug #7561
    
    based on earlier patch from metze

commit fa4dec31cf3bc37ff86fde722b1fa85d1ab1f0c6
Author: Björn Jacke <bj at sernet.de>
Date:   Tue Jul 20 11:13:51 2010 +0200

    Revert "s3: Don't use as-needed"
    
    This reverts commit b9835a1f9d8b81e4121a01a190dffaefe67cbe5c.

-----------------------------------------------------------------------

Summary of changes:
 source3/configure.in |   73 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index 43119fb..541dbe9 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1799,6 +1799,79 @@ fi
 
 AC_MSG_RESULT($BLDSHARED)
 
+AC_ARG_ENABLE(as-needed,
+	[AS_HELP_STRING([--enable-as-needed],
+	[Turn on as-needed support if available (default=auto)])])
+if test "x$enable_as_needed" != xno; then
+    saved_before_as_needed_ldflags="$LDFLAGS"
+    for flags in "-Wl,--as-needed" "-Wl,-z,ignore" "-z ignore" ; do
+	saved_ldflags="$LDFLAGS"
+	AC_MSG_CHECKING([if $flags works])
+	LDFLAGS="$flags $saved_ldflags"
+	AC_TRY_LINK([],[],
+		[AC_MSG_RESULT([yes])
+		LD_AS_NEEDED_FLAG=$flags
+		ld_as_needed_flag_found=yes],
+		AC_MSG_RESULT([no]))
+	LDFLAGS="$LD_AS_NEEDED_FLAG $saved_ldflags"
+	test x"$ld_as_needed_flag_found" = xyes && break
+    done
+fi
+
+if test x$ld_as_needed_flag_found = xyes ; then
+# check if ld has bug described in https://bugzilla.samba.org/show_bug.cgi?id=7209#c17
+	AC_MSG_CHECKING([if $LD_AS_NEEDED_FLAG has explicit external libs bug])
+cat > conftest_shb.c <<END
+void b() {}
+END
+cat > conftest_sha.c <<END
+extern void b();
+void a() {
+	b();
+}
+END
+cat > conftest.c <<END
+extern void a();
+int main() {
+	a();
+}
+END
+
+	AC_TRY_COMMAND([$CC $CPPFLAGS $CFLAGS $PICFLAG -c -o conftest_sha.o conftest_sha.c 1>&AS_MESSAGE_LOG_FD 2>&1])
+	AC_TRY_COMMAND([$CC $CPPFLAGS $CFLAGS $PICFLAG -c -o conftest_shb.o conftest_shb.c 1>&AS_MESSAGE_LOG_FD 2>&1])
+	TESTCMD="`eval echo \"$SHLD $LDSHFLAGS $PICFLAG\"`"
+	AC_TRY_COMMAND([$TESTCMD -o libconftest_shb.$SHLIBEXT conftest_shb.o 1>&AS_MESSAGE_LOG_FD 2>&1])
+	AC_TRY_COMMAND([$TESTCMD -o libconftest_sha.$SHLIBEXT conftest_sha.o 1>&AS_MESSAGE_LOG_FD 2>&1])
+	if AC_TRY_COMMAND([$CC -o conftest conftest.c $LDFLAGS -L. -lconftest_sha -lconftest_shb 1>&AS_MESSAGE_LOG_FD 2>&1])
+	then
+		AC_MSG_RESULT([no])
+	else
+		ld_as_needed_flag_found=no
+		LDFLAGS="$saved_before_as_needed_ldflags"
+		AC_MSG_RESULT([yes])
+	fi
+	rm conftest* libconftest*
+fi
+
+# check if we have to disable LD_AS_NEEDED_FLAG:
+# On some systems for a veriety of reasons linking with
+# -Wl,--as-needed -lreadline -lncurses fails
+# we have to retest, if these combination is detected before.
+# Bugzilla #7209
+
+if test x$ac_cv_lib_readline_rl_callback_handler_install = xyes ; then
+	if test x$ld_as_needed_flag_found = xyes ; then
+		AC_MSG_CHECKING([if $LD_AS_NEEDED_FLAG works with readline])
+		# try if check no fails
+		save_LIBS=$LIBS
+		LIBS="$LIBS $TERMLIBS"
+		AC_TRY_LINK([], [rl_callback_handler_install();], [AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no]); LDFLAGS="$saved_before_as_needed_ldflags"])
+		LIBS="$save_LIBS"
+        fi
+fi
+
+
+
 # for historical reasons almost all linkers don't complain about unresolved
 # symbols in shared libs. Except for the internal samba modules we want to get
 # errors when we produce a shared lib with unresolved symbols. On some


-- 
Samba Shared Repository


More information about the samba-cvs mailing list