Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug #157
Browse files Browse the repository at this point in the history
[patch tweaked to handle older nasm, which doesn't support :function syntax]

------- Comment #5 From Mike Frysinger 2006-05-22 01:24 [reply] -------
Created an attachment (id=132) [edit]
libsdl-hidden-nasm.patch

here's the patch i posted here:
http://www.libsdl.org/pipermail/sdl/2006-March/073618.html

this will hide the symbols dynamically if the build nasm/yasm supports the
hidden stuff ... in other words, this patch should be safe with both older and
new versions of nasm/yasm
  • Loading branch information
slouken committed Jun 21, 2006
1 parent 75bef3a commit 8c97260
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 35 deletions.
18 changes: 15 additions & 3 deletions configure.in
Expand Up @@ -596,11 +596,14 @@ 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
AC_PATH_PROG(NASM, nasm)
if test x$NASM != x -a x$NASM != x'"$NASM"'; then
AC_PATH_PROG(NASM, yasm)
if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
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
if test x"$NASMFLAGS" = x; then
case $ARCH in
win32)
NASMFLAGS="-f win32"
Expand All @@ -613,6 +616,15 @@ AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes
;;
esac
fi
NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"

dnl See if hidden visibility is supported
echo 'GLOBAL _bar:function hidden' > nasm_vis.asm
if $NASM $NASMFLAGS nasm_vis.asm -o nasm_vis.o >&AS_MESSAGE_LOG_FD ; then
NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
fi
rm -f nasm_vis.asm nasm_vis.o

AC_SUBST(NASM)
AC_SUBST(NASMFLAGS)

Expand Down
9 changes: 9 additions & 0 deletions src/hermes/common.asm
@@ -0,0 +1,9 @@
; Some common macros for hermes nasm code

%macro SDL_FUNC 1
%ifdef HIDDEN_VISIBILITY
GLOBAL %1:function hidden
%else
GLOBAL %1
%endif
%endmacro
6 changes: 4 additions & 2 deletions src/hermes/mmx_main.asm
Expand Up @@ -9,8 +9,10 @@

BITS 32

GLOBAL _ConvertMMX
GLOBAL _mmxreturn
%include "common.asm"

SDL_FUNC _ConvertMMX
SDL_FUNC _mmxreturn

SECTION .text
Expand Down
11 changes: 6 additions & 5 deletions src/hermes/mmxp2_32.asm
Expand Up @@ -20,12 +20,13 @@

BITS 32

%include "common.asm"
GLOBAL _ConvertMMXpII32_24RGB888
GLOBAL _ConvertMMXpII32_16RGB565
GLOBAL _ConvertMMXpII32_16BGR565
GLOBAL _ConvertMMXpII32_16RGB555
GLOBAL _ConvertMMXpII32_16BGR555
SDL_FUNC _ConvertMMXpII32_24RGB888
SDL_FUNC _ConvertMMXpII32_16RGB565
SDL_FUNC _ConvertMMXpII32_16BGR565
SDL_FUNC _ConvertMMXpII32_16RGB555
SDL_FUNC _ConvertMMXpII32_16BGR555

EXTERN _mmxreturn
Expand Down
8 changes: 5 additions & 3 deletions src/hermes/x86_main.asm
Expand Up @@ -11,10 +11,12 @@

BITS 32

GLOBAL _ConvertX86
GLOBAL _x86return
%include "common.asm"

SDL_FUNC _ConvertX86
SDL_FUNC _x86return
GLOBAL _Hermes_X86_CPU
SDL_FUNC _Hermes_X86_CPU

SECTION .text
Expand Down
17 changes: 6 additions & 11 deletions src/hermes/x86p_16.asm
Expand Up @@ -10,19 +10,14 @@
; Used with permission.
;

BITS 32

GLOBAL _ConvertX86p16_32RGB888
GLOBAL _ConvertX86p16_32BGR888
GLOBAL _ConvertX86p16_32RGBA888
GLOBAL _ConvertX86p16_32BGRA888
GLOBAL _ConvertX86p16_24RGB888
GLOBAL _ConvertX86p16_24BGR888
GLOBAL _ConvertX86p16_16BGR565
GLOBAL _ConvertX86p16_16RGB555
GLOBAL _ConvertX86p16_16BGR555
GLOBAL _ConvertX86p16_8RGB332
%include "common.asm"

SDL_FUNC _ConvertX86p16_16BGR565
SDL_FUNC _ConvertX86p16_16RGB555
SDL_FUNC _ConvertX86p16_16BGR555
SDL_FUNC _ConvertX86p16_8RGB332

EXTERN _ConvertX86
EXTERN _x86return
Expand Down
23 changes: 12 additions & 11 deletions src/hermes/x86p_32.asm
Expand Up @@ -9,19 +9,20 @@
; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
;

BITS 32

GLOBAL _ConvertX86p32_32BGR888
GLOBAL _ConvertX86p32_32RGBA888
GLOBAL _ConvertX86p32_32BGRA888
GLOBAL _ConvertX86p32_24RGB888
GLOBAL _ConvertX86p32_24BGR888
GLOBAL _ConvertX86p32_16RGB565
GLOBAL _ConvertX86p32_16BGR565
GLOBAL _ConvertX86p32_16RGB555
GLOBAL _ConvertX86p32_16BGR555
GLOBAL _ConvertX86p32_8RGB332
%include "common.asm"

SDL_FUNC _ConvertX86p32_32BGR888
SDL_FUNC _ConvertX86p32_32RGBA888
SDL_FUNC _ConvertX86p32_32BGRA888
SDL_FUNC _ConvertX86p32_24RGB888
SDL_FUNC _ConvertX86p32_24BGR888
SDL_FUNC _ConvertX86p32_16RGB565
SDL_FUNC _ConvertX86p32_16BGR565
SDL_FUNC _ConvertX86p32_16RGB555
SDL_FUNC _ConvertX86p32_16BGR555
SDL_FUNC _ConvertX86p32_8RGB332

EXTERN _x86return
Expand Down

0 comments on commit 8c97260

Please sign in to comment.