[SDL/f14/master] Adapt to nasm-2.09

Petr Pisar ppisar at fedoraproject.org
Fri Feb 25 09:33:40 UTC 2011


commit 26b86f5cbd928b051cd3433844509b3113596669
Author: Petr Písař <ppisar at redhat.com>
Date:   Thu Feb 24 18:16:23 2011 +0100

    Adapt to nasm-2.09
    
    nasm has changed and statred to generate ELFs without GNU-stack header
    leading to library marked as having executable stack.

 SDL-1.2.14-nasm-2.09-compat.patch |  100 +++++++++++++++++++++++++++++++++++++
 SDL.spec                          |    8 +++-
 2 files changed, 107 insertions(+), 1 deletions(-)
---
diff --git a/SDL-1.2.14-nasm-2.09-compat.patch b/SDL-1.2.14-nasm-2.09-compat.patch
new file mode 100644
index 0000000..f85ef38
--- /dev/null
+++ b/SDL-1.2.14-nasm-2.09-compat.patch
@@ -0,0 +1,100 @@
+From 0d8a1536a20cc834273789ae4251bff226a2a54c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at 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
+
diff --git a/SDL.spec b/SDL.spec
index 99e0de6..e8ce43f 100644
--- a/SDL.spec
+++ b/SDL.spec
@@ -1,7 +1,7 @@
 Summary: A cross-platform multimedia library
 Name: SDL
 Version: 1.2.14
-Release: 9%{?dist}
+Release: 10%{?dist}
 # Source: http://www.libsdl.org/release/%%{name}-%%{version}.tar.gz
 # To create the repackaged archive use ./repackage.sh %%{version}
 Source0: %{name}-%{version}_repackaged.tar.gz
@@ -22,6 +22,8 @@ Patch5: SDL-1.2.14-x11_grab_down_button.patch
 Patch6: SDL-1.2.14-linux_2.6_joystick.patch
 # Do not call memcpy() on overlapping areas, in upstream, sdl1090, rh669844
 Patch7: SDL-1.2.14-SDL_BlitCopyOverlap_memcpy.patch
+# nasm-2.09 aliased elf to elf32, in upstream, sdl1152, rh678818
+Patch8: SDL-1.2.14-nasm-2.09-compat.patch
 
 URL: http://www.libsdl.org/
 License: LGPLv2+
@@ -83,6 +85,7 @@ static SDL applications.
 %patch5 -p1 -b .x11_grab_down_button
 %patch6 -p1 -b .linux_2.6_joystick
 %patch7 -p1 -b .SDL_BlitCopyOverlap_memcpy
+%patch8 -p1 -b .nasm209
 for F in CREDITS; do 
     iconv -f iso8859-1 -t utf-8 < "$F" > "${F}.utf"
     touch --reference "$F" "${F}.utf"
@@ -145,6 +148,9 @@ rm -rf %{buildroot}
 %{_libdir}/lib*.a
 
 %changelog
+* Thu Feb 24 2011 Petr Pisar <ppisar at redhat.com> - 1.2.14-10
+- Adapt to nasm-2.09 (bug #678818)
+
 * Fri Feb 18 2011 Petr Pisar <ppisar at redhat.com> - 1.2.14-9
 - Do not call memcpy() on overlapping areas (bug #669844)
 - Make intradependecies architecture specific


More information about the scm-commits mailing list