I am compiling mplayer with llvm-gcc-4.2.1.
With '-O1' (which disables link time optimization), the program successfully compiles and links. With "-O2" or "-O1 -flto" ld complains about undefined characters:
Undefined symbols for architecture x86_64:
"_MM_FIX_0_707106781", referenced from:
_filter in vf_fspp.o
"_MM_FIX_0_541196100", referenced from:
_filter in vf_fspp.o
ld: symbol (s) not found for architecture x86_64
collect2: ld returned 1 exit status
fyi, my version of ld:
@(
llvm version 2.9svn, from Apple Clang 2.0 (build 137)
I will focus only on MM_FIX_0_707106781, as the other constants follow the same procedure.
MM_FIX_0_707106781 is initialized with the macro:
DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_707106781)=FIX64(0.707106781, 14);
which is rated as:
static const uint64_t __attribute__((used, aligned (8))) MM_FIX_0_707106781=0x2d412d412d412d41;
These constants are used in the asm code:
#define MANGLE(a) "_" #a "(%%rip)"
__asm__ volatile(
...
"pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm7 \n\t"
...
);
( ?) asm, , :
".globl "LABLE_MANGLE(functionnamehere)"\n\t"
, ASM.
, , . , -O1 , . -O2 asm-.
- ? .