diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | Makefile.in | 33 | ||||
-rw-r--r-- | aclocal.m4 | 38 | ||||
-rwxr-xr-x | configure | 85 | ||||
-rw-r--r-- | configure.ac | 23 | ||||
-rw-r--r-- | doc/Makefile.in | 5 |
7 files changed, 143 insertions, 55 deletions
@@ -1,3 +1,11 @@ +2008-05-01 Frank Ch. Eigler <fche@elastic.org> + + PR 6474 + * configure.ac (--enable-pie): Add default option. + * Makefile.am (stap* binaries): Use -fpie/-z relro/-z now as + applicable. + * configure, aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. + 2008-04-30 Masami Hiramatsu <mhiramat@redhat.com> PR 6008 diff --git a/Makefile.am b/Makefile.am index dd53d87f..4eb1335b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -63,10 +63,10 @@ git_version.h: stap_CXXFLAGS = $(AM_CXXFLAGS) stap_CPPFLAGS = $(AM_CPPFLAGS) -stap_LDFLAGS = $(AM_LDFLAGS) - +stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ +staprun_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ stapio_CPPFLAGS = $(AM_CPPFLAGS) -stapio_LDFLAGS = $(AM_LDFLAGS) +stapio_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ if BUILD_ELFUTILS # This tells automake's "make distcheck" what we need to compile. diff --git a/Makefile.in b/Makefile.in index 66dc43ec..8ff882b4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -118,7 +118,7 @@ am_staprun_OBJECTS = staprun-staprun.$(OBJEXT) \ staprun-common.$(OBJEXT) staprun-cap.$(OBJEXT) staprun_OBJECTS = $(am_staprun_OBJECTS) staprun_DEPENDENCIES = -staprun_LINK = $(CCLD) $(staprun_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ +staprun_LINK = $(CCLD) $(staprun_CFLAGS) $(CFLAGS) $(staprun_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -209,6 +209,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PIELDFLAGS = @PIELDFLAGS@ PROCFLAGS = @PROCFLAGS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ @@ -294,9 +295,10 @@ CLEANFILES = git_version.h $(am__append_6) $(pkglibexec_PROGRAMS) GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh stap_CXXFLAGS = $(AM_CXXFLAGS) stap_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_1) -stap_LDFLAGS = $(AM_LDFLAGS) $(am__append_2) +stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(am__append_2) +staprun_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ stapio_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_3) -stapio_LDFLAGS = $(AM_LDFLAGS) $(am__append_4) +stapio_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(am__append_4) # This tells automake's "make distcheck" what we need to compile. @BUILD_ELFUTILS_TRUE@DISTCHECK_CONFIGURE_FLAGS = --with-elfutils=$(elfutils_abs_srcdir) @@ -1148,8 +1150,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -1174,8 +1176,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -1185,12 +1187,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -1263,10 +1266,6 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) - dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -1294,8 +1293,6 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -1465,7 +1462,7 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 clean-binPROGRAMS clean-generic clean-local \ clean-noinstPROGRAMS clean-pkglibexecPROGRAMS ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ + dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,15 +11,12 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, -[m4_warning([this file was generated for autoconf 2.61. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -34,7 +31,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,10 +47,8 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -348,7 +343,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -396,13 +391,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. +# 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 13 +# serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -507,17 +502,16 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. -_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $_am_arg | $_am_arg:* ) + $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -878,7 +872,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) @@ -705,6 +705,7 @@ EGREP U ANSI2KNR RANLIB +PIELDFLAGS sqlite3_LIBS staplog_CPPFLAGS BUILD_CRASHMOD_TRUE @@ -1324,6 +1325,7 @@ Optional Features: location). --enable-prologues make -P prologue-searching default --disable-ssp disable gcc stack-protector + --disable-pie disable position-independent-executable --enable-sqlite build with sqlite support --enable-crash[=DIRECTORY] enable crash extension (default is disabled). @@ -6007,6 +6009,67 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +# Check whether --enable-pie was given. +if test "${enable_pie+set}" = set; then + enableval=$enable_pie; +fi + +if test "x$enable_pie" != xno; then + + save_CFLAGS="$CFLAGS" + save_CXXFLAGS="$CXXFLAGS" + save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS -fpie" + CXXFLAGS="$CXXFLAGS -fpie" + LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now" + cat >conftest.$ac_ext <<_ACEOF +void main () {} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + { echo "$as_me:$LINENO: Compiling with gcc pie et al." >&5 +echo "$as_me: Compiling with gcc pie et al." >&6;} + # LDFLAGS is special since it may be passed down to bundled-elfutils, + # and interfere with the .so's built therein + PIELDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now" + LDFLAGS="$save_LDFLAGS" + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + { echo "$as_me:$LINENO: Compiler does not support -pie et al." >&5 +echo "$as_me: Compiler does not support -pie et al." >&6;} + CFLAGS="$save_CFLAGS" + CXXFLAGS="$save_CXXFLAGS" + PIELDFLAGS="" + LDFLAGS="$save_LDFLAGS" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + # Check whether --enable-sqlite was given. if test "${enable_sqlite+set}" = set; then enableval=$enable_sqlite; @@ -7613,12 +7676,12 @@ EGREP!$EGREP$ac_delim U!$U$ac_delim ANSI2KNR!$ANSI2KNR$ac_delim RANLIB!$RANLIB$ac_delim +PIELDFLAGS!$PIELDFLAGS$ac_delim sqlite3_LIBS!$sqlite3_LIBS$ac_delim staplog_CPPFLAGS!$staplog_CPPFLAGS$ac_delim BUILD_CRASHMOD_TRUE!$BUILD_CRASHMOD_TRUE$ac_delim BUILD_CRASHMOD_FALSE!$BUILD_CRASHMOD_FALSE$ac_delim have_latex!$have_latex$ac_delim -have_dvips!$have_dvips$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -7660,6 +7723,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +have_dvips!$have_dvips$ac_delim have_ps2pdf!$have_ps2pdf$ac_delim have_latex2html!$have_latex2html$ac_delim BUILD_DOCS_TRUE!$BUILD_DOCS_TRUE$ac_delim @@ -7676,7 +7740,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -8077,21 +8141,22 @@ echo "$as_me: $ac_file is unchanged" >&6;} fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. +_am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $ac_file | $ac_file:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| . 2>/dev/null || -echo X$ac_file | +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8128,7 +8193,7 @@ echo "$as_me: executing $ac_file commands" >&6;} # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ diff --git a/configure.ac b/configure.ac index 51ed83a7..4d0a4263 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,29 @@ AS_IF([test "x$enable_ssp" != xno],[ CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS"])]) +AC_ARG_ENABLE([pie], + [AS_HELP_STRING([--disable-pie], [disable position-independent-executable])]) +AS_IF([test "x$enable_pie" != xno],[ + save_CFLAGS="$CFLAGS" + save_CXXFLAGS="$CXXFLAGS" + save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS -fpie" + CXXFLAGS="$CXXFLAGS -fpie" + LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now" + AC_LINK_IFELSE([void main () {}], [ + AC_MSG_NOTICE([Compiling with gcc pie et al.]) + # LDFLAGS is special since it may be passed down to bundled-elfutils, + # and interfere with the .so's built therein + PIELDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now" + LDFLAGS="$save_LDFLAGS" + ],[ + AC_MSG_NOTICE([Compiler does not support -pie et al.]) + CFLAGS="$save_CFLAGS" + CXXFLAGS="$save_CXXFLAGS" + PIELDFLAGS="" + LDFLAGS="$save_LDFLAGS"])]) +AC_SUBST(PIELDFLAGS) + dnl Handle optional sqlite support. If enabled/disabled by the user, dnl do the right thing. If not specified by the user, use it if dnl present. diff --git a/doc/Makefile.in b/doc/Makefile.in index efad693b..a2700d3c 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -88,6 +88,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PIELDFLAGS = @PIELDFLAGS@ PROCFLAGS = @PROCFLAGS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ |