summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-03-20 02:50:26 +0000
committerMike Frysinger <vapier@gentoo.org>2007-03-20 02:50:26 +0000
commitba6aec89126ab4eae118282d0a8a96b9d192d002 (patch)
tree1da583dfb9c2f526ae6ed9ea96482addeb23ee0a /media-libs/libsdl/files
parentgames-fps/cube removed from portage (diff)
downloadgentoo-2-ba6aec89126ab4eae118282d0a8a96b9d192d002.tar.gz
gentoo-2-ba6aec89126ab4eae118282d0a8a96b9d192d002.tar.bz2
gentoo-2-ba6aec89126ab4eae118282d0a8a96b9d192d002.zip
Add some more checks to make sure yasm is sane before using it #163053.
(Portage version: 2.1.2.2)
Diffstat (limited to 'media-libs/libsdl/files')
-rw-r--r--media-libs/libsdl/files/libsdl-1.2.11-yasm-checks.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/media-libs/libsdl/files/libsdl-1.2.11-yasm-checks.patch b/media-libs/libsdl/files/libsdl-1.2.11-yasm-checks.patch
new file mode 100644
index 000000000000..f4a470cf954d
--- /dev/null
+++ b/media-libs/libsdl/files/libsdl-1.2.11-yasm-checks.patch
@@ -0,0 +1,88 @@
+make sure the yasm we have supports all the required features
+
+http://bugs.gentoo.org/163053
+http://bugzilla.libsdl.org/show_bug.cgi?id=393
+
+Index: configure.in
+===================================================================
+--- configure.in (revision 2987)
++++ configure.in (working copy)
+@@ -640,38 +640,56 @@ CheckNASM()
+ AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
+ , enable_nasm=yes)
+ if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
++ CompileNASM()
++ {
++ # Usage: CompileNASM <filename>
++ AC_MSG_CHECKING(to see if $NASM supports $1)
++ if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
++ CompileNASM_ret="yes"
++ else
++ CompileNASM_ret="no"
++ fi
++ rm -f $1 $1.o
++ AC_MSG_RESULT($CompileNASM_ret)
++ test "$CompileNASM_ret" = "yes"
++ }
++
++ if test x"$NASMFLAGS" = x; then
++ case $ARCH in
++ win32)
++ NASMFLAGS="-f win32"
++ ;;
++ openbsd)
++ NASMFLAGS="-f aoutb"
++ ;;
++ macosx)
++ NASMFLAGS="-f macho"
++ ;;
++ *)
++ NASMFLAGS="-f elf"
++ ;;
++ esac
++ fi
++
+ AC_PATH_PROG(NASM, yasm)
++ echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
++ echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
++ echo "%endif" >> unquoted-sections
++ CompileNASM unquoted-sections || NASM=""
++
+ if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
++ $as_unset ac_cv_path_NASM
+ AC_PATH_PROG(NASM, nasm)
+ fi
+ if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
+ AC_DEFINE(SDL_HERMES_BLITTERS)
+ SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
+- if test x"$NASMFLAGS" = x; then
+- case $ARCH in
+- win32)
+- NASMFLAGS="-f win32"
+- ;;
+- openbsd)
+- NASMFLAGS="-f aoutb"
+- ;;
+- macosx)
+- NASMFLAGS="-f macho"
+- ;;
+- *)
+- NASMFLAGS="-f elf"
+- ;;
+- esac
+- fi
+ NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"
+
+ dnl See if hidden visibility is supported
+- echo "GLOBAL _bar:function hidden" > nasm_vis.asm
+- echo "_bar:" >>nasm_vis.asm
+- if $NASM $NASMFLAGS nasm_vis.asm -o nasm_vis.o >&AS_MESSAGE_LOG_FD 2>&1; then
+- NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
+- fi
+- rm -f nasm_vis.asm nasm_vis.o
++ echo "GLOBAL _bar:function hidden" > symbol-visibility
++ echo "_bar:" >> symbol-visibility
++ CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
+
+ AC_SUBST(NASM)
+ AC_SUBST(NASMFLAGS)