From 4c23bb5984413d88e70587cfebb642f329ccebbc Mon Sep 17 00:00:00 2001 From: Kevin McBride Date: Mon, 12 Nov 2007 18:31:17 +0000 Subject: [PATCH] STABLE14-autoconf-strip-debug-options-sanity-20071112 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) --- Makefile.in | 2 +- README | 24 +++++++++++++++++ acinclude.m4 | 3 +++ src/cf/osconf.m4 | 19 +++++++++++++ src/config/Makefile.config.in | 4 ++- src/kauth/Makefile.in | 34 +++++++++++------------ src/log/Makefile.in | 8 +++--- src/platform/DARWIN/Makefile.in | 4 +-- src/sys/Makefile.in | 12 ++++----- src/venus/Makefile.in | 48 ++++++++++++++++----------------- src/vol/Makefile.in | 20 +++++++------- 11 files changed, 113 insertions(+), 65 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7ccd9fcd08..428acb9035 100644 --- a/Makefile.in +++ b/Makefile.in @@ -396,7 +396,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 c7fdff82df..5c263db1d2 100644 --- a/README +++ b/README @@ -68,6 +68,30 @@ A. Creating the proper directory structure. or insecure software included with OpenAFS. See README.obsolete and README.insecure 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 diff --git a/acinclude.m4 b/acinclude.m4 index 7789cbc1ac..83346e95c7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -70,6 +70,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" ) diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index a21bb52b25..4e52e2307d 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -18,6 +18,8 @@ DBG=-g OPTMZ=-O LWP_DBG=-g LWP_OPTMZ=-O +NO_STRIP_BIN=-ns +NO_STRIP_KRB=-ns dnl standard programs AC_PROG_RANLIB @@ -1013,6 +1015,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 @@ -1027,6 +1031,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) @@ -1047,6 +1064,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) diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index 13d6e9849e..5d7c32fc2d 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -57,6 +57,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@ @@ -113,7 +115,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 diff --git a/src/kauth/Makefile.in b/src/kauth/Makefile.in index e244a04c86..773251fdd3 100644 --- a/src/kauth/Makefile.in +++ b/src/kauth/Makefile.in @@ -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} $? $@ diff --git a/src/log/Makefile.in b/src/log/Makefile.in index f649caf6e3..92b6692d74 100644 --- a/src/log/Makefile.in +++ b/src/log/Makefile.in @@ -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} $? $@ diff --git a/src/platform/DARWIN/Makefile.in b/src/platform/DARWIN/Makefile.in index 66af0801fa..0212714b28 100644 --- a/src/platform/DARWIN/Makefile.in +++ b/src/platform/DARWIN/Makefile.in @@ -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 diff --git a/src/sys/Makefile.in b/src/sys/Makefile.in index 1e1a86ccb9..3c7b25848a 100644 --- a/src/sys/Makefile.in +++ b/src/sys/Makefile.in @@ -232,16 +232,16 @@ ${DESTDIR}${libdir}/afs/libsys.a: libsys.a ${INSTALL} $? $@ ${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 \ @@ -277,13 +277,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 diff --git a/src/venus/Makefile.in b/src/venus/Makefile.in index edb9133fc4..2a59d1faea 100644 --- a/src/venus/Makefile.in +++ b/src/venus/Makefile.in @@ -52,19 +52,19 @@ 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} $? $@ @@ -276,29 +276,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 @@ -328,22 +328,22 @@ 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}${sbindir}/kdump: kdump-build -set -x; \ @@ -354,24 +354,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: \ diff --git a/src/vol/Makefile.in b/src/vol/Makefile.in index 081c646d55..a7ebc8f38b 100644 --- a/src/vol/Makefile.in +++ b/src/vol/Makefile.in @@ -67,10 +67,10 @@ 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}/lib/afs/vlib.a: vlib.a ${INSTALL} $? $@ @@ -79,22 +79,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} $? $@ @@ -209,10 +209,10 @@ ${TOP_LIBDIR}/libvlib.a: vlib.a ${INSTALL} $? $@ ${DESTDIR}${afssrvlibexecdir}/salvager: salvager - ${INSTALL} -s $? $@ + ${INSTALL} $? $@ ${DESTDIR}${afssrvsbindir}/volinfo: volinfo - ${INSTALL} -s $? $@ + ${INSTALL} $? $@ ${DESTDIR}${includedir}/afs/nfs.h: nfs.h ${INSTALL} $? $@