|
From: Francky <fra...@fr...> - 2004-10-07 14:14:43
|
Hello, I'am using Mingw to write a program with both C and assembler sources (.c and .s) and it works pretty well. Now, I'm trying to compile and link my work on Linux using gcc. I use almost the same makefile (and exactely the same compiler and linker options). When using mingw under Windows, its generates a '_' before each function (using gcc -S myfile.c, for instance). So, for instance, in order to call "printf" into my .s files, I push my stuff and call '_printf'. Same thing when I uses global variables defined into C source into assembler code. Now, under Linux/gcc, it does not generate this little '_' before functions or global variables. And when I try to link my work, I have hundred of link errors because of that. I could use some conditional #define into my assembler files in order to correct this, but perhap's a compiler or linker option exist, or I have missed something. So is there a way to correct this (not using '_' with mingw or using '_' with gcc into assembler code) ? Of course, something that works with calling convention using msvcrt.dll in the first case, and gcc libraries in the second. Thanks, Franck |