DEVEL15-autoconf-strip-debug-options-sanity-20071112
authorKevin McBride <klm@endpoint.com>
Mon, 12 Nov 2007 18:28:30 +0000 (18:28 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 12 Nov 2007 18:28:30 +0000 (18:28 +0000)
To prevent stripping, specify the '--disable-strip-binaries' option on
the ./configure command line. fileserver and volserver are never stripped.

When --enable-debug is specified, binaries will not be stripped by default.

(cherry picked from commit 8593c52c2787587110865287937750e51c48afa5)

12 files changed:
Makefile.in
README
acinclude.m4
src/cf/osconf.m4
src/config/Makefile.config.in
src/kauth/Makefile.in
src/log/Makefile.in
src/platform/DARWIN/Makefile.in
src/sys/Makefile.in
src/tsalvaged/Makefile.in
src/venus/Makefile.in
src/vol/Makefile.in

index 0f7d3ba..88145c9 100644 (file)
@@ -414,7 +414,7 @@ ptserver_depinstall: pinstall rxgen comerr
        ${COMPILE_PART1} ptserver ${COMPILE_DEPINSTALL}
 
 ${DEST}/bin/dedebug: dedebug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 
 #
diff --git a/README b/README
index a5cc1f1..0d3c04e 100644 (file)
--- a/README
+++ b/README
@@ -71,6 +71,30 @@ A. Creating the proper directory structure.
       or insecure software included with OpenAFS. See README.OBSOLETE and
       README.SECURITY for more details.
 
+      There is an option to control whether or not binaries are stripped
+      of their symbol table information.  All binaries, except for the
+      'fileserver' and 'volserver' executables, are stripped by default.
+
+      To prevent stripping, specify the '--disable-strip-binaries' option on
+      the ./configure command line.
+
+      This option works alongside the existing --enable-debug option to
+      control how binaries are produced.  When --enable-debug is specified,
+      binaries will not be stripped.  This behavior can be modified by
+      using different combinations of --enable-debug and --enable (or
+      --disable)-strip-binaries.  One can, for example, compile binaries for
+      debug and strip them anyway.  Alternatively, one can compile without
+      debug and force the binaries to not be stripped.  Note that these
+      combinations are not necessarily useful.
+
+      If neither of these options is specified, the default will be to build
+      non-debug binaries that are stripped (with the exceptions noted above,
+      which are never stripped at present).  Specifying --enable-debug also
+      turns on --disable-strip-binaries.  These are the most useful settings.
+
+      The two binaries noted above, 'fileserver' and 'volserver' will never
+      be stripped, regardless of any options given to configure.
+
   There are two modes for directory path handling: "Transarc mode" and "default mode":
   - In Transarc mode, we retain compatibility with Transarc/IBM AFS tools
     by putting client configuaration files in /usr/vice/etc, and server
index b7408f3..3346fdd 100644 (file)
@@ -72,6 +72,9 @@ AC_ARG_ENABLE(optimize-kernel,
 AC_ARG_ENABLE(debug,
 [  --enable-debug                      enable compilation of the user space code with debugging information (defaults to disabled)],, enable_debug="no"
 )
+AC_ARG_ENABLE(strip-binaries,
+[  --disable-strip-binaries             disable stripping of symbol information from binaries (defaults to enabled)],, enable_strip_binaries="maybe"
+)
 AC_ARG_ENABLE(optimize,
 [  --disable-optimize                  disable optimization for compilation of the user space code (defaults to enabled)],, enable_optimize="yes"
 )
index 1ca888a..a7ee6d4 100644 (file)
@@ -18,6 +18,8 @@ KERN_OPTMZ=-O
 DBG=-g
 OPTMZ=-O
 LWP_DBG=-g
+NO_STRIP_BIN=-ns
+NO_STRIP_KRB=-ns
 LWP_OPTMZ=-O
 PAM_DBG=-g
 PAM_OPTMZ=
@@ -1051,6 +1053,8 @@ fi
 
 if test "x$enable_debug" = "xno"; then
   DBG=
+  NO_STRIP_BIN=
+  NO_STRIP_KRB=-s
 fi
 
 if test "x$enable_optimize" = "xno"; then
@@ -1065,6 +1069,19 @@ if test "x$enable_optimize_lwp" = "xno"; then
   LWP_OPTMZ=
 fi
 
+if test "x$enable_strip_binaries" != "xno"; then
+  if test "x$enable_strip_binaries" = "xmaybe" -a "x$enable_debug" = "xyes"; then
+    NO_STRIP_BIN=-ns
+    NO_STRIP_KRB=-ns
+  else
+    NO_STRIP_BIN=
+    NO_STRIP_KRB=-s
+  fi
+else
+  NO_STRIP_BIN=-ns
+  NO_STRIP_KRB=-ns
+fi
+
 AC_SUBST(CCXPG2)
 AC_SUBST(CCOBJ)
 AC_SUBST(AFSD_LIBS)
@@ -1085,6 +1102,8 @@ AC_SUBST(MT_CC)
 AC_SUBST(MT_CFLAGS)
 AC_SUBST(MT_LIBS)
 AC_SUBST(MV)
+AC_SUBST(NO_STRIP_BIN)
+AC_SUBST(NO_STRIP_KRB)
 AC_SUBST(OPTMZ)
 AC_SUBST(PAM_CFLAGS)
 AC_SUBST(PAM_LIBS)
index a6bc889..47ff05e 100644 (file)
@@ -58,6 +58,8 @@ MT_CC = @MT_CC@
 MT_CFLAGS = @MT_CFLAGS@
 MT_LIBS = @MT_LIBS@
 MV = @MV@
+NO_STRIP_BIN = @NO_STRIP_BIN@
+NO_STRIP_KRB = @NO_STRIP_KRB@
 OPTMZ = @OPTMZ@
 PAM_CFLAGS = @PAM_CFLAGS@
 PAM_LIBS = @PAM_LIBS@
@@ -116,7 +118,7 @@ KERNELDIR = ../libafs
 # Build helper apps
 #
 COMPILE_ET = ${TOP_OBJDIR}/src/comerr/compile_et
-INSTALL = ${TOP_OBJDIR}/src/pinstall/pinstall
+INSTALL = ${TOP_OBJDIR}/src/pinstall/pinstall ${NO_STRIP_BIN}
 INSTALLex = ${INSTALL} -m 755
 RXGEN = ${TOP_OBJDIR}/src/rxgen/rxgen
 SHELL = /bin/sh
index e244a04..773251f 100644 (file)
@@ -249,37 +249,37 @@ install: \
        ${DESTDIR}${includedir}/afs/kaport.h
 
 ${DESTDIR}${afssrvlibexecdir}/kaserver: kaserver
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${sbindir}/kas: kas
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${sbindir}/kpwvalid: kpwvalid
        ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/kas: kas
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/kpwvalid: kpwvalid
        ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/klog: klog
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/klog.krb: klog.krb
-       ${INSTALL} -s $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DESTDIR}${afssrvbindir}/klog: klog
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvbindir}/klog.krb: klog.krb
-       ${INSTALL} -s $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DESTDIR}${bindir}/knfs: knfs
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/kpasswd: kpasswd
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/kpwvalid: kpwvalid
        ${INSTALL} $? $@
@@ -294,7 +294,7 @@ ${DESTDIR}${afssrvsbindir}/kadb_check: rebuild
        ${INSTALL} -f $? $@
 
 ${DESTDIR}${afssrvsbindir}/kdb: kdb
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/ka-forwarder: ka-forwarder
        ${INSTALL} $? $@
@@ -331,25 +331,25 @@ dest: \
        ${DEST}/include/afs/kaport.h
 
 ${DEST}/root.server/usr/afs/bin/kaserver: kaserver
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/etc/kas ${DEST}/root.server/usr/afs/bin/kas: kas 
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/kpwvalid ${DEST}/etc/kpwvalid ${DEST}/root.server/usr/afs/bin/kpwvalid: kpwvalid 
        ${INSTALL} $? $@
 
 ${DEST}/bin/klog ${DEST}/root.server/usr/afs/bin/klog: klog 
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/klog.krb ${DEST}/root.server/usr/afs/bin/klog.krb: klog.krb 
-       ${INSTALL} -s $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DEST}/bin/knfs: knfs 
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/kpasswd: kpasswd 
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/lib/afs/libkauth.a: libkauth.a 
        ${INSTALL} $? $@
@@ -361,7 +361,7 @@ ${DEST}/etc/kadb_check: rebuild
        ${INSTALL} -f $? $@
 
 ${DEST}/etc/kdb: kdb 
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/root.server/usr/afs/bin/ka-forwarder: ka-forwarder
        ${INSTALL} $? $@
index f649caf..92b6692 100644 (file)
@@ -76,13 +76,13 @@ ${DEST}/bin/tokens: tokens
        ${INSTALL} $? $@
 
 ${DEST}/bin/tokens.krb: tokens.krb
-       ${INSTALL} $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DEST}/root.server/usr/afs/bin/tokens: tokens
        ${INSTALL} $? $@
 
 ${DEST}/root.server/usr/afs/bin/tokens.krb: tokens.krb
-       ${INSTALL} $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DEST}/etc/kseal: kseal
        ${INSTALL} $? $@
@@ -105,13 +105,13 @@ ${DESTDIR}${bindir}/tokens: tokens
        ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/tokens.krb: tokens.krb
-       ${INSTALL} $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DESTDIR}${afssrvbindir}/tokens: tokens
        ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvbindir}/tokens.krb: tokens.krb
-       ${INSTALL} $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DESTDIR}${sbindir}/kseal: kseal
        ${INSTALL} $? $@
index 66af080..0212714 100644 (file)
@@ -21,10 +21,10 @@ dest: \
        ${DEST}/etc/afssettings
 
 ${DESTDIR}${sbindir}/afssettings: afssettings
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/etc/afssettings: afssettings
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 clean:
        $(RM) -f *.o core afssettings AFS_component_version_number.c 
index e7c2efd..f204176 100644 (file)
@@ -310,16 +310,16 @@ ${DESTDIR}${libdir}/${LIBAFSSETPAG_DARWIN}: ${LIBAFSSETPAG_DARWIN}
                ${DESTDIR}${libdir}/libafssetpag.${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR}.${SHLIB_SUFFIX} ;; \
 
 ${DESTDIR}${sbindir}/rmtsysd: rmtsysd
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${includedir}/afs/afssyscalls.h: afssyscalls.h
        ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/pagsh: pagsh
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/pagsh.krb: pagsh.krb
-       ${INSTALL} -s $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 ${DESTDIR}${includedir}/afs/afs.exp: afs.exp
        @set -x; case ${SYS_NAME} in \
@@ -361,13 +361,13 @@ ${DEST}/include/afs/afssyscalls.h: afssyscalls.h
        ${INSTALL} $? $@
 
 ${DEST}/etc/rmtsysd: rmtsysd
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/pagsh: pagsh
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/pagsh.krb: pagsh.krb
-       ${INSTALL} -s $? $@
+       ${INSTALL} ${NO_STRIP_KRB} $? $@
 
 #
 # Misc targets
index 1f4ccc6..382e725 100644 (file)
@@ -176,10 +176,10 @@ ${DEST}/root.server/usr/afs/bin/salvageserver: salvageserver
        ${INSTALL} -ns $? $@
 
 ${DEST}/root.server/usr/afs/bin/fssync-debug: fssync-debug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/root.server/usr/afs/bin/salvsync-debug: salvsync-debug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 install: ${INSTALL_TARGS}
 
@@ -192,9 +192,9 @@ ${DESTDIR}${afssrvlibexecdir}/salvageserver: salvageserver
        ${INSTALL} -ns $? $@
 
 ${DESTDIR}${afssrvsbindir}/fssync-debug: fssync-debug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/salvsync-debug: salvsync-debug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 dest: ${DEST_TARGS}
index fb61ccf..876992d 100644 (file)
@@ -52,22 +52,22 @@ cacheout: cacheout.o
 cacheout.o: cacheout.c
 
 ${DEST}/bin/fs ${DEST}/root.server/usr/afs/bin/fs: fs
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/livesys: livesys
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/up: up
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/etc/fstrace: fstrace
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/cmdebug: cmdebug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/bin/dedebug: dedebug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 
 up.o: up.c AFS_component_version_number.c
@@ -283,29 +283,29 @@ ${DEST}/etc/kdump: kdump-build
                ln -fs kdump.IP20 ${DEST}/etc/kdump.IP22; \
                ln -fs kdump.IP20 ${DEST}/etc/kdump.IP32; \
                for f in kdump.IP??; \
-                       do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \
+                       do ${INSTALL} $$f ${DEST}/etc/$$f || exit $$? ; \
                done ;; \
        sun*_5[789] | sun*_510 ) \
                ${INSTALLex} -f ${srcdir}/kdump.sh.solaris7 ${DEST}/etc/kdump; \
-               ${INSTALL} -s -f ${srcdir}/kdump ${DEST}/etc/kdump32;; \
+               ${INSTALL} -f ${srcdir}/kdump ${DEST}/etc/kdump32;; \
        *alpha_linux* ) \
                ${INSTALLex} -f ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
-               ${INSTALL} -s kdump-alpha_linux-${LINUX_VERSION} $@ ;; \
+               ${INSTALL} kdump-alpha_linux-${LINUX_VERSION} $@ ;; \
        *linux* ) \
                ${INSTALLex} -f ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
-               ${INSTALL} -s kdump-linux-${LINUX_VERSION} $@-${LINUX_VERSION} ;; \
+               ${INSTALL} kdump-linux-${LINUX_VERSION} $@-${LINUX_VERSION} ;; \
        hp_ux11* ) \
                ${INSTALLex} -f ${srcdir}/kdump.sh.hp_ux11 ${DEST}/etc/kdump; \
-               ${INSTALL} -s -f $? $@;; \
+               ${INSTALL} -f $? $@;; \
        *nbsd*) \
                ;; \
        *) \
-               ${INSTALL} -s $? $@ ;; \
+               ${INSTALL} $? $@ ;; \
        esac
 
 ${DEST}/etc/kdump64: kdump-build
        if [ -f kdump64 ]; then \
-               ${INSTALL} -s kdump64 $@; \
+               ${INSTALL} kdump64 $@; \
        fi
 
 
@@ -335,25 +335,25 @@ test:
 include ../config/Makefile.version
 
 ${DESTDIR}${bindir}/fs: fs
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/livesys: livesys
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvbindir}/fs: fs
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/up: up
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${sbindir}/fstrace: fstrace
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/cmdebug: cmdebug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${bindir}/dedebug: dedebug
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${sbindir}/kdump: kdump-build
        -set -x; \
@@ -364,24 +364,24 @@ ${DESTDIR}${sbindir}/kdump: kdump-build
                ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP22; \
                ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP32; \
                for f in kdump.IP??; \
-                       do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
+                       do ${INSTALL} $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
                done ;; \
        sun*_5[789] | sun*_510 ) \
                ${INSTALLex} -f kdump.sh.solaris7 ${DESTDIR}${sbindir}/kdump32; \
-               ${INSTALL} -s -f $? $@;; \
+               ${INSTALL} -f $? $@;; \
        *linux* ) \
                ${INSTALLex} -f kdump.sh.linux ${DESTDIR}${sbindir}/kdump; \
-               ${INSTALL} -s $? $@ ;; \
+               ${INSTALL} $? $@ ;; \
        hp_ux11* ) \
                ${INSTALLex} -f kdump.sh.hp_ux11 ${DESTDIR}${sbindir}/kdump; \
-               ${INSTALL} -s -f $? $@;; \
+               ${INSTALL} -f $? $@;; \
        *) \
-               ${INSTALL} -s $? $@ ;; \
+               ${INSTALL} $? $@ ;; \
        esac
 
 ${DESTDIR}${sbindir}/kdump64: kdump-build
        if [ -f kdump64 ]; then \
-               ${INSTALL} -s kdump64 $@; \
+               ${INSTALL} kdump64 $@; \
        fi
 
 dest: \
index abc7e1e..820293c 100644 (file)
@@ -73,14 +73,14 @@ install: \
        ${DESTDIR}${includedir}/afs/namei_ops.h
 
 ${DEST}/root.server/usr/afs/bin/salvager: salvager 
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/root.server/usr/afs/bin/volinfo: volinfo
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/root.server/usr/afs/bin/fssync-debug: fssync-debug
        if test "@DEMAND_ATTACH@" = "no"; then \
-               ${INSTALL} -s $? $@ ; \
+               ${INSTALL} $? $@ ; \
        fi
 
 ${DEST}/lib/afs/vlib.a: vlib.a
@@ -90,22 +90,22 @@ ${DEST}/lib/afs/libvlib.a: vlib.a
        ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/fs_conv_dux40D:  fs_conv_dux40D
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/xfs_size_check:  xfs_size_check
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/fs_conv_sol26:  fs_conv_sol26
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 $(DEST)/root.server/usr/afs/bin/fs_conv_dux40D:  fs_conv_dux40D
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 $(DEST)/root.server/usr/afs/bin/xfs_size_check:  xfs_size_check
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 $(DEST)/root.server/usr/afs/bin/fs_conv_sol26:  fs_conv_sol26
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DEST}/include/afs/nfs.h: nfs.h
        ${INSTALL} $? $@
@@ -231,14 +231,14 @@ ${TOP_LIBDIR}/libvlib.a: vlib.a
        ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvlibexecdir}/salvager: salvager
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/volinfo: volinfo
-       ${INSTALL} -s $? $@
+       ${INSTALL} $? $@
 
 ${DESTDIR}${afssrvsbindir}/fssync-debug: fssync-debug
        if test "@DEMAND_ATTACH@" = "no" ; then \
-               ${INSTALL} -s $? $@ ; \
+               ${INSTALL} $? $@ ; \
        fi
 
 ${DESTDIR}${includedir}/afs/nfs.h: nfs.h