This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Smpeg MMX asm compilation (problem)
Alright, I've managed to get both .S files to compile- however when I
try to link them with a program using:
extern "C" {
extern unsigned int cpu_flags(void);
extern void IDCT_mmx(DCTBLOCK data);
}
The linker tool comes up with
./.libs/libsmpeg.a(parseblock.o): In function `Z8InitIDCTv':
e:/programming/smpeg/video/parseblock.cpp:117: undefined reference to
`cpu_flags()'
./.libs/libsmpeg.a(parseblock.o): In function
`Z15ParseReconBlockiP10vid_stream':
e:/programming/smpeg/video/parseblock.cpp:583: undefined reference to
`IDCT_mmx(short*)'
They *are* getting assembled&linked- Why is this??
Here's the code for the mmxflags_asm.S, which should be enough for you
folk to figure it out:
"
.text
.align 2
.globl cpu_flags
.def cpu_flags; .scl 2; .type 32; .endef
cpu_flags:
pushfl
popl %eax
movl %eax,%edx
xorl $0x040000,%eax
pushl %eax
popfl
pushfl
popl %eax
xorl %ecx,%eax
jz cpu_flags.L1 # Processor is 386
pushl %ecx
popfl
movl %ecx,%eax
xorl $0x200000,%eax
pushl %eax
popfl
pushfl
popl %eax
xorl %ecx,%eax
je cpu_flags.L1
pushl %ebx
movl $1,%eax
cpuid
movl %edx,%eax
popl %ecx
cpu_flags.L1:
ret
"
M@