From 56d370e0084511d9f9d706d0bcf2e3375b46ca25 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 21 Feb 2007 13:26:38 +0000 Subject: A lot of cleanups as well as minor API changes. Ported some changes from 1.2 to here. --- m4/ChangeLog | 6 ++++++ m4/Makefile.am | 1 + m4/noexecstack.m4 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 m4/Makefile.am create mode 100644 m4/noexecstack.m4 (limited to 'm4') diff --git a/m4/ChangeLog b/m4/ChangeLog index 4a033dc7..6a76f5a6 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2007-02-20 Werner Koch + + * Makefile.am: New. + + * noexecstack.m4: New. Taken from gnupg 1.4 + 2006-10-11 Marcus Brinkmann * fallback.m4: Removed again. diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 00000000..ca65d10a --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = libtool.m4 onceonly.m4 socklen.m4 sys_socket_h.m4 noexecstack.m4 diff --git a/m4/noexecstack.m4 b/m4/noexecstack.m4 new file mode 100644 index 00000000..629e3513 --- /dev/null +++ b/m4/noexecstack.m4 @@ -0,0 +1,55 @@ +# noexecstack.m4 +dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +dnl Checks whether the stack can be marked nonexecutable by passing an +dnl option to the C-compiler when acting on .s files. Returns that +dnl option in NOEXECSTACK_FLAGS. +dnl This macro is adapted from one found in GLIBC-2.3.5. +AC_DEFUN([CL_AS_NOEXECSTACK],[ +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AM_PROG_AS]) + +AC_MSG_CHECKING([whether non excutable stack support is requested]) +AC_ARG_ENABLE(noexecstack, + AC_HELP_STRING([--enable-noexecstack], + [enable non executable stack support (gcc only)]), + noexecstack_support=$enableval, noexecstack_support=no) +AC_MSG_RESULT($noexecstack_support) + +AC_CACHE_CHECK([whether assembler supports --noexecstack option], +cl_cv_as_noexecstack, [dnl + cat > conftest.c </dev/null]) \ + && grep -q .note.GNU-stack conftest.s \ + && AC_TRY_COMMAND([${CCAS} $CCASFLAGS $CPPFLAGS -Wa,--noexecstack + -c -o conftest.o conftest.s >/dev/null]) + then + cl_cv_as_noexecstack=yes + else + cl_cv_as_noexecstack=no + fi + rm -f conftest*]) + if test "$noexecstack_support" = yes -a "$cl_cv_as_noexecstack" = yes; then + NOEXECSTACK_FLAGS="-Wa,--noexecstack" + else + NOEXECSTACK_FLAGS= + fi + AC_SUBST(NOEXECSTACK_FLAGS) +]) -- cgit v1.2.1