scummvm random work
[patches.git] / bfin-alsa-lib.patch
1 diff -r 46221e609f45 configure.in
2 --- a/configure.in Wed Sep 06 14:39:01 2006 +0200
3 +++ b/configure.in Thu Sep 07 20:45:24 2006 -0400
4 @@ -34,6 +34,7 @@ fi
5
6
7 AC_PROG_CC
8 +AC_PROG_CPP
9 AC_PROG_INSTALL
10 AC_PROG_LN_S
11 AC_DISABLE_STATIC
12 @@ -104,6 +105,16 @@ else
13 AC_MSG_RESULT(no)
14 fi
15 AM_CONDITIONAL(VERSIONED_SYMBOLS, test x$versioned = xyes)
16 +
17 +dnl See if toolchain has a custom prefix for symbols ...
18 +AC_MSG_CHECKING(for custom symbol prefixes)
19 +SYMBOL_PREFIX=` \
20 + echo "PREFIX=__USER_LABEL_PREFIX__" \
21 + | ${CPP-${CC-gcc} -E} - 2>&1 \
22 + | ${EGREP-grep} "^PREFIX=" \
23 + | ${SED-sed} "s:^PREFIX=::"`
24 +AC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
25 +AC_MSG_RESULT($SYMBOL_PREFIX)
26
27 dnl Check for debug...
28 AC_MSG_CHECKING(for debug)
29 diff -r 46221e609f45 include/alsa-symbols.h
30 --- a/include/alsa-symbols.h Wed Sep 06 14:39:01 2006 +0200
31 +++ b/include/alsa-symbols.h Thu Sep 07 20:45:45 2006 -0400
32 @@ -22,6 +22,14 @@
33 #ifndef __ALSA_SYMBOLS_H
34 #define __ALSA_SYMBOLS_H
35
36 +#ifdef __USER_LABEL_PREFIX__
37 +# define __SYMBOL_PREFIX __USER_LABEL_PREFIX__
38 +#else
39 +# define __SYMBOL_PREFIX
40 +#endif
41 +
42 +#include "local.h"
43 +
44 #if defined(PIC) && defined(VERSIONED_SYMBOLS) /* might be also configurable */
45 #define USE_VERSIONED_SYMBOLS
46 #endif
47 @@ -31,16 +39,16 @@
48
49 #ifdef __powerpc64__
50 # define symbol_version(real, name, version) \
51 - __asm__ (".symver " #real "," #name "@" #version); \
52 - __asm__ (".symver ." #real ",." #name "@" #version)
53 + __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version); \
54 + __asm__ (".symver ." ASM_NAME(#real) ",." ASM_NAME(#name) "@" #version)
55 # define default_symbol_version(real, name, version) \
56 - __asm__ (".symver " #real "," #name "@@" #version); \
57 - __asm__ (".symver ." #real ",." #name "@@" #version)
58 + __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version); \
59 + __asm__ (".symver ." ASM_NAME(#real) ",." ASM_NAME(#name) "@@" #version)
60 #else
61 # define symbol_version(real, name, version) \
62 - __asm__ (".symver " #real "," #name "@" #version)
63 + __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version)
64 # define default_symbol_version(real, name, version) \
65 - __asm__ (".symver " #real "," #name "@@" #version)
66 + __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version)
67 #endif
68
69 #ifdef USE_VERSIONED_SYMBOLS
70 @@ -52,19 +60,19 @@
71 #define use_symbol_version(real, name, version) /* nothing */
72 #ifdef __powerpc64__
73 #define use_default_symbol_version(real, name, version) \
74 - __asm__ (".weak " #name); \
75 - __asm__ (".weak ." #name); \
76 - __asm__ (".set " #name "," #real); \
77 - __asm__ (".set ." #name ",." #real)
78 + __asm__ (".weak " ASM_NAME(#name)); \
79 + __asm__ (".weak ." ASM_NAME(#name)); \
80 + __asm__ (".set " ASM_NAME(#name) "," ASM_NAME(#real)); \
81 + __asm__ (".set ." ASM_NAME(#name) ",." ASM_NAME(#real))
82 #else
83 #if defined(__alpha__) || defined(__mips__)
84 #define use_default_symbol_version(real, name, version) \
85 - __asm__ (".weak " #name); \
86 - __asm__ (#name " = " #real)
87 + __asm__ (".weak " ASM_NAME(#name)); \
88 + __asm__ (ASM_NAME(#name) " = " ASM_NAME(#real))
89 #else
90 #define use_default_symbol_version(real, name, version) \
91 - __asm__ (".weak " #name); \
92 - __asm__ (".set " #name "," #real)
93 + __asm__ (".weak " ASM_NAME(#name)); \
94 + __asm__ (".set " ASM_NAME(#name) "," ASM_NAME(#real))
95 #endif
96 #endif
97 #endif
98 diff -r 46221e609f45 include/local.h
99 --- a/include/local.h Wed Sep 06 14:39:01 2006 +0200
100 +++ b/include/local.h Thu Sep 07 20:45:45 2006 -0400
101 @@ -192,6 +192,9 @@ extern snd_lib_error_handler_t snd_err_m
102
103 /* When a reference to SYMBOL is encountered, the linker will emit a
104 warning message MSG. */
105 +
106 +#define ASM_NAME(name) __SYMBOL_PREFIX name
107 +
108 #ifdef HAVE_GNU_LD
109 # ifdef HAVE_ELF
110
111 @@ -210,19 +213,19 @@ extern snd_lib_error_handler_t snd_err_m
112 section attributes on what looks like a comment to the assembler. */
113 # ifdef HAVE_SECTION_QUOTES
114 # define link_warning(symbol, msg) \
115 - __make_section_unallocated (".gnu.warning." #symbol) \
116 + __make_section_unallocated (".gnu.warning." ASM_NAME(#symbol)) \
117 static const char __evoke_link_warning_##symbol[] \
118 - __attribute__ ((section (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
119 + __attribute__ ((section (".gnu.warning." ASM_NAME(#symbol) "\"\n\t#\""))) = msg;
120 # else
121 # define link_warning(symbol, msg) \
122 - __make_section_unallocated (".gnu.warning." #symbol) \
123 + __make_section_unallocated (".gnu.warning." ASM_NAME(#symbol)) \
124 static const char __evoke_link_warning_##symbol[] \
125 - __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
126 + __attribute__ ((section (".gnu.warning." ASM_NAME(#symbol) "\n\t#"))) = msg;
127 # endif
128 # else
129 # define link_warning(symbol, msg) \
130 asm (".stabs \"" msg "\",30,0,0,0\n\t" \
131 - ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
132 + ".stabs \"" ASM_NAME(#symbol) "\",1,0,0,0\n");
133 # endif
134 #else
135 /* We will never be heard; they will all die horribly. */