void-packages/srcpkgs/SDL/patches/SDL-1.2.14-nasm-2.09-compat...

101 lines
3.1 KiB
Diff

From 0d8a1536a20cc834273789ae4251bff226a2a54c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 24 Feb 2011 15:49:35 +0100
Subject: [PATCH] nasm 2.09 compatibility
nasm-2.09 makes `elf' alias to `elf32', thus __OUTPUT_FORMAT__ macro
becomes `elf32' instead of `elf' (on x86). Unmatched macro value causes
omitting .note.GNU-stack marker and creates ELFs with executable stack.
This is unneeded and attracts security policies like SELinux.
---
configure.in | 4 ++--
src/hermes/mmx_main.asm | 2 +-
src/hermes/mmxp2_32.asm | 2 +-
src/hermes/x86_main.asm | 2 +-
src/hermes/x86p_16.asm | 2 +-
src/hermes/x86p_32.asm | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/configure.in b/configure.in
index a7e9b18..04f212b 100644
--- a/configure.in
+++ b/configure.in
@@ -740,12 +740,12 @@ AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes
NASMFLAGS="-f macho"
;;
*)
- NASMFLAGS="-f elf"
+ NASMFLAGS="-f elf32"
;;
esac
fi
- echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
+ echo "%ifidn __OUTPUT_FORMAT__,elf32" > unquoted-sections
echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
echo "%endif" >> unquoted-sections
CompileNASM unquoted-sections || NASM=""
diff --git a/src/hermes/mmx_main.asm b/src/hermes/mmx_main.asm
index c3886d6..00032b9 100644
--- a/src/hermes/mmx_main.asm
+++ b/src/hermes/mmx_main.asm
@@ -69,6 +69,6 @@ endconvert:
ret
-%ifidn __OUTPUT_FORMAT__,elf
+%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
diff --git a/src/hermes/mmxp2_32.asm b/src/hermes/mmxp2_32.asm
index d2d31ec..b7c1eeb 100644
--- a/src/hermes/mmxp2_32.asm
+++ b/src/hermes/mmxp2_32.asm
@@ -400,6 +400,6 @@ _convert_bgr555_cheat:
.L4:
retn
-%ifidn __OUTPUT_FORMAT__,elf
+%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
diff --git a/src/hermes/x86_main.asm b/src/hermes/x86_main.asm
index e78bf8f..f7dd3db 100644
--- a/src/hermes/x86_main.asm
+++ b/src/hermes/x86_main.asm
@@ -70,6 +70,6 @@ endconvert:
-%ifidn __OUTPUT_FORMAT__,elf
+%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
diff --git a/src/hermes/x86p_16.asm b/src/hermes/x86p_16.asm
index e35c75d..fcb6f5a 100644
--- a/src/hermes/x86p_16.asm
+++ b/src/hermes/x86p_16.asm
@@ -485,6 +485,6 @@ _ConvertX86p16_8RGB332:
.L7 pop ebp
retn
-%ifidn __OUTPUT_FORMAT__,elf
+%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
diff --git a/src/hermes/x86p_32.asm b/src/hermes/x86p_32.asm
index 4446c1c..819157f 100644
--- a/src/hermes/x86p_32.asm
+++ b/src/hermes/x86p_32.asm
@@ -1040,6 +1040,6 @@ _ConvertX86p32_8RGB332:
.L4:
retn
-%ifidn __OUTPUT_FORMAT__,elf
+%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
--
1.7.4