Originally committed as revision 12484 to svn://svn.ffmpeg.org/ffmpeg/trunk
Måns Rullgård authored on 2008/03/18 11:01:20... | ... |
@@ -1491,6 +1491,12 @@ if test "$?" != 0; then |
1491 | 1491 |
die "C compiler test failed." |
1492 | 1492 |
fi |
1493 | 1493 |
|
1494 |
+check_cc <<EOF || die "Symbol mangling check failed." |
|
1495 |
+int ff_extern; |
|
1496 |
+EOF |
|
1497 |
+sym=$(nm -P $TMPO) |
|
1498 |
+extern_prefix=${sym%%ff_extern*} |
|
1499 |
+ |
|
1494 | 1500 |
check_asm inline_asm '""' |
1495 | 1501 |
|
1496 | 1502 |
if enabled x86; then |
... | ... |
@@ -2070,6 +2076,7 @@ enabled asmalign_pot && |
2070 | 2070 |
printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH || |
2071 | 2071 |
printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH |
2072 | 2072 |
|
2073 |
+echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH |
|
2073 | 2074 |
|
2074 | 2075 |
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH |
2075 | 2076 |
|
... | ... |
@@ -119,18 +119,10 @@ |
119 | 119 |
#endif |
120 | 120 |
|
121 | 121 |
// Use rip-relative addressing if compiling PIC code on x86-64. |
122 |
-#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__DJGPP__) || \ |
|
123 |
- defined(__OS2__) || defined(__APPLE__) || \ |
|
124 |
- (defined (__OpenBSD__) && !defined(__ELF__)) |
|
125 |
-# if defined(ARCH_X86_64) && defined(PIC) |
|
126 |
-# define MANGLE(a) "_" #a"(%%rip)" |
|
127 |
-# else |
|
128 |
-# define MANGLE(a) "_" #a |
|
129 |
-# endif |
|
130 |
-#elif defined(ARCH_X86_64) && defined(PIC) |
|
131 |
-# define MANGLE(a) #a"(%%rip)" |
|
122 |
+#if defined(ARCH_X86_64) && defined(PIC) |
|
123 |
+# define MANGLE(a) EXTERN_PREFIX #a"(%%rip)" |
|
132 | 124 |
#else |
133 |
-# define MANGLE(a) #a |
|
125 |
+# define MANGLE(a) EXTERN_PREFIX #a |
|
134 | 126 |
#endif |
135 | 127 |
|
136 | 128 |
/* debug stuff */ |