Browse Source

* m4/cc.m4 (CL_AS_NOEXECSTACK): New macro...

* configure.ac: ...used here for setting ASMFLAGS...
* src/Makefile.in: ...which are used here.
master
Richard Kreckel 20 years ago
parent
commit
126552d49e
  1. 6
      ChangeLog
  2. 2
      configure.ac
  3. 27
      m4/cc.m4
  4. 4
      src/Makefile.in

6
ChangeLog

@ -1,3 +1,9 @@
2005-08-15 Richard B. Kreckel <kreckel@ginac.de>
* m4/cc.m4 (CL_AS_NOEXECSTACK): New macro...
* configure.ac: ...used here for setting ASMFLAGS...
* src/Makefile.in: ...which are used here.
2005-08-02 Andreas Jochens <aj@andaco.de>
* include/cln/config.h.in: Add support for PowerPC 64 CPU.

2
configure.ac

@ -51,6 +51,8 @@ AC_PROG_CXXCPP
dnl sets variable CXXCPP
CL_AS_UNDERSCORE
dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
CL_AS_NOEXECSTACK
dnl sets variable ASMFLAGS
AC_PROG_RANLIB
dnl sets variable RANLIB
AC_PROG_INSTALL

27
m4/cc.m4

@ -40,3 +40,30 @@ if test "$ac_compiler_gnu" = yes; then
fi
fi
])
dnl Checks whether the stack can be marked nonexecutable by passing an option
dnl to the C-compiler when acting on .s files. Appends that option to ASFLAGS.
dnl This macro is adapted from one found in GLIBC-2.3.5.
AC_DEFUN([CL_AS_NOEXECSTACK],[
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([whether --noexecstack is desirable for .s files], cl_cv_as_noexecstack, [dnl
cat > conftest.c <<EOF
void foo() {}
EOF
if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS
-S -o conftest.s conftest.c >/dev/null]) \
&& grep -q .note.GNU-stack conftest.s \
&& AC_TRY_COMMAND([${CC} $CFLAGS $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 "$cl_cv_as_noexecstack" = yes; then
ASMFLAGS="$ASMFLAGS -Wa,--noexecstack"
fi
AC_SUBST(ASMFLAGS)
])

4
src/Makefile.in

@ -122,7 +122,7 @@ alls : $(FILES_S) $(ASMFILES_S)
allo : $(FILES_LO) $(ASMFILES_LO)
ASMFLAGS :=
ASMFLAGS := @ASMFLAGS@
ifeq (@AS_UNDERSCORE@,true)
ASMFLAGS += -DUNDERSCORE
endif
@ -185,7 +185,7 @@ $(ASMFILES_LO) : %.lo : %.s
|| COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
else
$(ASMFILES_LO) : %.lo : %.s
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(ASMFLAGS) $(TARGET_ARCH) -c $<
endif
endif

Loading…
Cancel
Save