Skip to content

Commit 7d3ccb4

Browse files
author
Uoti Urpala
committed
configure: go back to platform-based EXTERN_PREFIX test
Commit 6ad1f58 (svn r28151) changed EXTERN_PREFIX detection to use a "general" configure test instead of determining it based on platform. However, this "general" test depends on assumptions about object file contents, and actually fails if compiling with gcc -flto for example. Go back to the simple platform-based test. Leave out the OS2 (no longer supported) and OpenBSD !ELF (no idea what that is, but probably not something I'd care about supporting) parts from the old test. Remove configure switch --nm, as it was only used for the hacky EXTERN_PREFIX test. Simply disable the use of EXTERN_ASM (same as EXTERN_PREFIX under another name) in wrapper.S; this seems to have been added for OS/2 only, and the file should not get compiled on any platform with a nonempty prefix now.
1 parent 3ba2699 commit 7d3ccb4

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

configure

-22
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ Miscellaneous options:
424424
--enable-runtime-cpudetection enable runtime CPU detection [disable]
425425
--enable-cross-compile enable cross-compilation [disable]
426426
--cc=COMPILER C compiler to build MPlayer [gcc]
427-
--nm=NM nm tool to build MPlayer [nm]
428427
--pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
429428
--windres=WINDRES windres to build MPlayer [windres]
430429
--target=PLATFORM target platform (i386-linux, arm-linux, etc)
@@ -498,7 +497,6 @@ _windres=auto
498497
_cc=auto
499498
test "$CC" && _cc="$CC"
500499
_as=auto
501-
_nm=auto
502500
_runtime_cpudetection=no
503501
_cross_compile=no
504502
_prefix="/usr/local"
@@ -687,9 +685,6 @@ for ac_option do
687685
--cc=*)
688686
_cc=$(echo $ac_option | cut -d '=' -f 2)
689687
;;
690-
--nm=*)
691-
_nm=$(echo $ac_option | cut -d '=' -f 2)
692-
;;
693688
--pkg-config=*)
694689
_pkg_config=$(echo $ac_option | cut -d '=' -f 2)
695690
;;
@@ -1298,11 +1293,6 @@ echo "Detected host architecture: $host_arch"
12981293

12991294
# ---
13001295

1301-
if test "$_nm" = auto ; then
1302-
_nm=$($_cc -print-prog-name=nm)
1303-
test -z "$_nm" && _nm=nm
1304-
fi
1305-
13061296
# XXX: this should be ok..
13071297
_cpuinfo="echo"
13081298

@@ -2033,18 +2023,6 @@ fi
20332023
echores "$_byte_order"
20342024

20352025

2036-
echocheck "extern symbol prefix"
2037-
cat > $TMPC << EOF
2038-
int ff_extern;
2039-
EOF
2040-
cc_check -c || die "Symbol mangling check failed."
2041-
sym=$($_nm -P -g $TMPEXE)
2042-
extern_prefix=${sym%%ff_extern*}
2043-
def_extern_asm="#define EXTERN_ASM $extern_prefix"
2044-
def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2045-
echores $extern_prefix
2046-
2047-
20482026
echocheck "assembler support of -pipe option"
20492027
# -I. helps to detect compilers that just misunderstand -pipe like Sun C
20502028
cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"

loader/wrapper.S

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#define GLUE(a, b) a ## b
44
#define JOIN(a, b) GLUE(a, b)
5+
#define EXTERN_ASM
56
#define MANGLE(s) JOIN(EXTERN_ASM, s)
67

78
.data

mangle.h

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
#define attribute_used
3232
#endif
3333

34+
#if defined(_WIN32) || defined(__APPLE__)
35+
#define EXTERN_PREFIX "_"
36+
#else
37+
#define EXTERN_PREFIX ""
38+
#endif
39+
3440
#if ARCH_X86_64 && defined(PIC)
3541
#define MANGLE(a) EXTERN_PREFIX #a "(%%rip)"
3642
#else

0 commit comments

Comments
 (0)