Re: [Mingw-msys] Cross compiler Linux -> msys
- Date: Wed, 18 Jul 2007 16:45:21 +0800 (CST)
- From: haibin zhang <dragzhb@xxxxxxxxxxxx>
- Subject: [Mingw-msys] Assemble problem in Mingw32 (binutils-2.17.50-20070129-1.tar.gz)
Hi All :
I test cpu id using as in
binutils-2.17.50-20070129-1.tar.gz, but it can't
compile pass, I have tested this in linux, it's ok.
I have two file :cpuidfunc.s stringtest.c
I use compile command :
gcc -o test.exe cpuidfunc.s stringtest.c
It print error :
$ gcc -o test.exe cpuidfunc.s stringtest.c
cpuidfunc.s: Assembler messages:
cpuidfunc.s:5: Warning: .type pseudo-op used outside
of .def/.endef ignored.
cpuidfunc.s:5: Error: junk at end of line, first
unrecognized character is `c'
$ as --version
GNU assembler 2.17.50 20070129
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it
under the terms of
the GNU General Public License. This program has
absolutely no warranty.
This assembler was configured for a target of
`mingw32'.
$ gcc -v
Reading specs from
d:/msys/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --with-gcc
--with-gnu-ld --with-gnu-as --host=mingw32
--target=mingw32 --prefix=/ming
w --enable-threads --disable-nls
--enable-languages=c,c++,f77,ada,objc,java
--disable-win32-registry --disable-shared --enabl
e-sjlj-exceptions --enable-libgcj --disable-java-awt
--without-x --enable-java-gc=boehm
--disable-libgcj-debug --enable-inter
preter --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)
Regards
Zhang HaiBin
___________________________________________________________
雅虎免费邮箱3.5G容量,20M附件!
http://cn.mail.yahoo.com//* stringtest.c - An example of returning a string value */
#include <stdio.h>
char *cpuidfunc(void);
int main()
{
char *spValue;
spValue = cpuidfunc();
printf("The CPUID is: '%s'\n", spValue);
return 0;
}
# cpuidfunc.s - An example of returning a string value
.section .bss
.comm output, 13
.section .text
.type cpuidfunc, @function
.globl cpuidfunc
cpuidfunc:
pushl %ebp
movl %esp, %ebp
pushl %ebx
movl $0, %eax
cpuid
movl $output, %edi
movl %ebx, (%edi)
movl %edx, 4(%edi)
movl %ecx, 8(%edi)
movl $output, %eax
popl %ebx
movl %ebp, %esp
popl %ebp
ret
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys