Fixed bug #157 SDL-1.3
authorSam Lantinga
Wed, 21 Jun 2006 07:57:59 +0000
branchSDL-1.3
changeset 1697393092a3ebf6
parent 1696 3695d3637045
child 1698 412149a1c756
Fixed bug #157
[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
configure.in
src/hermes/common.asm
src/hermes/mmx_main.asm
src/hermes/mmxp2_32.asm
src/hermes/x86_main.asm
src/hermes/x86p_16.asm
src/hermes/x86p_32.asm
     1.1 --- a/configure.in	Wed Jun 21 07:36:00 2006 +0000
     1.2 +++ b/configure.in	Wed Jun 21 07:57:59 2006 +0000
     1.3 @@ -596,11 +596,14 @@
     1.4  AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
     1.5                    , enable_nasm=yes)
     1.6      if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
     1.7 -        AC_PATH_PROG(NASM, nasm)
     1.8 -        if test x$NASM != x -a x$NASM != x'"$NASM"'; then
     1.9 +        AC_PATH_PROG(NASM, yasm)
    1.10 +        if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
    1.11 +            AC_PATH_PROG(NASM, nasm)
    1.12 +        fi
    1.13 +        if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
    1.14              AC_DEFINE(SDL_HERMES_BLITTERS)
    1.15              SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
    1.16 -            if test x$NASMFLAGS = x; then
    1.17 +            if test x"$NASMFLAGS" = x; then
    1.18                  case $ARCH in
    1.19                    win32)
    1.20                        NASMFLAGS="-f win32"
    1.21 @@ -613,6 +616,15 @@
    1.22                        ;;
    1.23                  esac
    1.24              fi
    1.25 +            NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"
    1.26 +
    1.27 +            dnl See if hidden visibility is supported
    1.28 +            echo 'GLOBAL _bar:function hidden' > nasm_vis.asm
    1.29 +            if $NASM $NASMFLAGS nasm_vis.asm -o nasm_vis.o >&AS_MESSAGE_LOG_FD ; then
    1.30 +                NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
    1.31 +            fi
    1.32 +            rm -f nasm_vis.asm nasm_vis.o
    1.33 +
    1.34              AC_SUBST(NASM)
    1.35              AC_SUBST(NASMFLAGS)
    1.36  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/hermes/common.asm	Wed Jun 21 07:57:59 2006 +0000
     2.3 @@ -0,0 +1,9 @@
     2.4 +; Some common macros for hermes nasm code
     2.5 +
     2.6 +%macro SDL_FUNC 1
     2.7 +%ifdef HIDDEN_VISIBILITY
     2.8 +GLOBAL %1:function hidden
     2.9 +%else
    2.10 +GLOBAL %1
    2.11 +%endif
    2.12 +%endmacro
     3.1 --- a/src/hermes/mmx_main.asm	Wed Jun 21 07:36:00 2006 +0000
     3.2 +++ b/src/hermes/mmx_main.asm	Wed Jun 21 07:57:59 2006 +0000
     3.3 @@ -9,8 +9,10 @@
     3.4  
     3.5  BITS 32
     3.6  
     3.7 -GLOBAL _ConvertMMX
     3.8 -GLOBAL _mmxreturn
     3.9 +%include "common.asm"
    3.10 +
    3.11 +SDL_FUNC _ConvertMMX
    3.12 +SDL_FUNC _mmxreturn
    3.13  
    3.14  SECTION .text
    3.15  		
     4.1 --- a/src/hermes/mmxp2_32.asm	Wed Jun 21 07:36:00 2006 +0000
     4.2 +++ b/src/hermes/mmxp2_32.asm	Wed Jun 21 07:57:59 2006 +0000
     4.3 @@ -20,12 +20,13 @@
     4.4  
     4.5  BITS 32
     4.6  
     4.7 +%include "common.asm"
     4.8  	
     4.9 -GLOBAL _ConvertMMXpII32_24RGB888
    4.10 -GLOBAL _ConvertMMXpII32_16RGB565
    4.11 -GLOBAL _ConvertMMXpII32_16BGR565
    4.12 -GLOBAL _ConvertMMXpII32_16RGB555
    4.13 -GLOBAL _ConvertMMXpII32_16BGR555
    4.14 +SDL_FUNC _ConvertMMXpII32_24RGB888
    4.15 +SDL_FUNC _ConvertMMXpII32_16RGB565
    4.16 +SDL_FUNC _ConvertMMXpII32_16BGR565
    4.17 +SDL_FUNC _ConvertMMXpII32_16RGB555
    4.18 +SDL_FUNC _ConvertMMXpII32_16BGR555
    4.19  
    4.20  EXTERN _mmxreturn
    4.21   
     5.1 --- a/src/hermes/x86_main.asm	Wed Jun 21 07:36:00 2006 +0000
     5.2 +++ b/src/hermes/x86_main.asm	Wed Jun 21 07:57:59 2006 +0000
     5.3 @@ -11,10 +11,12 @@
     5.4  
     5.5  BITS 32
     5.6  
     5.7 -GLOBAL _ConvertX86
     5.8 -GLOBAL _x86return
     5.9 +%include "common.asm"
    5.10 +
    5.11 +SDL_FUNC _ConvertX86
    5.12 +SDL_FUNC _x86return
    5.13  	
    5.14 -GLOBAL _Hermes_X86_CPU
    5.15 +SDL_FUNC _Hermes_X86_CPU
    5.16  
    5.17  SECTION .text
    5.18  		
     6.1 --- a/src/hermes/x86p_16.asm	Wed Jun 21 07:36:00 2006 +0000
     6.2 +++ b/src/hermes/x86p_16.asm	Wed Jun 21 07:57:59 2006 +0000
     6.3 @@ -10,19 +10,14 @@
     6.4  ; Used with permission.
     6.5  ; 
     6.6  
     6.7 -	
     6.8  BITS 32
     6.9  
    6.10 -GLOBAL _ConvertX86p16_32RGB888
    6.11 -GLOBAL _ConvertX86p16_32BGR888
    6.12 -GLOBAL _ConvertX86p16_32RGBA888
    6.13 -GLOBAL _ConvertX86p16_32BGRA888
    6.14 -GLOBAL _ConvertX86p16_24RGB888
    6.15 -GLOBAL _ConvertX86p16_24BGR888
    6.16 -GLOBAL _ConvertX86p16_16BGR565
    6.17 -GLOBAL _ConvertX86p16_16RGB555
    6.18 -GLOBAL _ConvertX86p16_16BGR555
    6.19 -GLOBAL _ConvertX86p16_8RGB332
    6.20 +%include "common.asm"
    6.21 +
    6.22 +SDL_FUNC _ConvertX86p16_16BGR565
    6.23 +SDL_FUNC _ConvertX86p16_16RGB555
    6.24 +SDL_FUNC _ConvertX86p16_16BGR555
    6.25 +SDL_FUNC _ConvertX86p16_8RGB332
    6.26  
    6.27  EXTERN _ConvertX86
    6.28  EXTERN _x86return
     7.1 --- a/src/hermes/x86p_32.asm	Wed Jun 21 07:36:00 2006 +0000
     7.2 +++ b/src/hermes/x86p_32.asm	Wed Jun 21 07:57:59 2006 +0000
     7.3 @@ -9,19 +9,20 @@
     7.4  ; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
     7.5  ; 
     7.6  
     7.7 -	
     7.8  BITS 32
     7.9  
    7.10 -GLOBAL _ConvertX86p32_32BGR888
    7.11 -GLOBAL _ConvertX86p32_32RGBA888
    7.12 -GLOBAL _ConvertX86p32_32BGRA888
    7.13 -GLOBAL _ConvertX86p32_24RGB888	
    7.14 -GLOBAL _ConvertX86p32_24BGR888
    7.15 -GLOBAL _ConvertX86p32_16RGB565
    7.16 -GLOBAL _ConvertX86p32_16BGR565
    7.17 -GLOBAL _ConvertX86p32_16RGB555
    7.18 -GLOBAL _ConvertX86p32_16BGR555
    7.19 -GLOBAL _ConvertX86p32_8RGB332
    7.20 +%include "common.asm"
    7.21 +
    7.22 +SDL_FUNC _ConvertX86p32_32BGR888
    7.23 +SDL_FUNC _ConvertX86p32_32RGBA888
    7.24 +SDL_FUNC _ConvertX86p32_32BGRA888
    7.25 +SDL_FUNC _ConvertX86p32_24RGB888	
    7.26 +SDL_FUNC _ConvertX86p32_24BGR888
    7.27 +SDL_FUNC _ConvertX86p32_16RGB565
    7.28 +SDL_FUNC _ConvertX86p32_16BGR565
    7.29 +SDL_FUNC _ConvertX86p32_16RGB555
    7.30 +SDL_FUNC _ConvertX86p32_16BGR555
    7.31 +SDL_FUNC _ConvertX86p32_8RGB332
    7.32  
    7.33  EXTERN _x86return
    7.34