aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gmp/gmp-4.2.2/02_noexec-stack.diff
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/gmp/gmp-4.2.2/02_noexec-stack.diff
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/gmp/gmp-4.2.2/02_noexec-stack.diff')
-rw-r--r--recipes/gmp/gmp-4.2.2/02_noexec-stack.diff74
1 files changed, 74 insertions, 0 deletions
diff --git a/recipes/gmp/gmp-4.2.2/02_noexec-stack.diff b/recipes/gmp/gmp-4.2.2/02_noexec-stack.diff
new file mode 100644
index 0000000000..613589e347
--- /dev/null
+++ b/recipes/gmp/gmp-4.2.2/02_noexec-stack.diff
@@ -0,0 +1,74 @@
+Index: acinclude.m4
+===================================================================
+RCS file: /cvsroot/pkg-gmp/gmp/acinclude.m4,v
+retrieving revision 1.3
+diff -u -b -B -r1.3 acinclude.m4
+--- gmp-4.2.2.orig/acinclude.m4 14 Apr 2006 22:48:55 -0000 1.3
++++ gmp-4.2.2/acinclude.m4 15 Apr 2006 06:11:48 -0000
+@@ -1613,6 +1613,34 @@
+ ])
+
+
++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],[
++dnl AC_REQUIRE([AC_PROG_CC]) GMP uses something else
++AC_CACHE_CHECK([whether assembler supports --noexecstack option],
++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)
++])
++
++
+ dnl GMP_ASM_LABEL_SUFFIX
+ dnl --------------------
+ dnl : - is usual.
+Index: configure.in
+===================================================================
+RCS file: /cvsroot/pkg-gmp/gmp/configure.in,v
+retrieving revision 1.3
+diff -u -b -B -r1.3 configure.in
+--- gmp-4.2.2.orig/configure.in 14 Apr 2006 22:48:55 -0000 1.3
++++ gmp-4.2.2/configure.in 15 Apr 2006 06:11:49 -0000
+@@ -2024,6 +2024,8 @@
+ # Automake ansi2knr support.
+ AM_C_PROTOTYPES
+
++CL_AS_NOEXECSTACK
++
+ GMP_PROG_AR
+ GMP_PROG_NM
+
+Index: mpn/Makeasm.am
+===================================================================
+RCS file: /cvsroot/pkg-gmp/gmp/mpn/Makeasm.am,v
+retrieving revision 1.5
+diff -u -b -B -r1.5 Makeasm.am
+--- gmp-4.2.2.orig/mpn/Makeasm.am 14 Apr 2006 22:48:59 -0000 1.5
++++ gmp-4.2.2/mpn/Makeasm.am 15 Apr 2006 06:11:49 -0000
+@@ -24,7 +24,7 @@
+ # COMPILE minus CC.
+ #
+ COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS)
+
+ # Flags used for preprocessing (in ansi2knr rules).
+ #