This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Porting problems with assembler


I'm currently trying to port a program that makes heavy use of assembler 
(namely mplayer ->, to win32 (and OpenBSD, where I have 
the same prob).

The problem is that on Linux/ELF I use extern functionname() in C code and 
functionname in external gas asm code, but if I try to link this on win32 (or 
OpenBSD/aout) external asm functions need a preceding underscore to link 
fine, so it must be extern functionname() in C and _functionname in assembler 
No one could write a preprocessor definition in the form of:
#if defined(__CYGWIN__) || defined(__OpenBSD__)
#define ASMLINK(x) x
#define ASMLINK(x) _##x

and then replace all functionname in asm source with _functionname and all 
functionname() in c source with ASMLINK(funtionname)(), but this is quite 
messy and as mplayer has lot's of external libraries that need to be kept on 
sync with external development this is a sort of no way.

So my question, are there any other ways to achieve this goal, best thing 
would be some assembler/compiler/linker/whatever option to resolve it.


Best Regards,

Ever tried? Ever failed? - Try again! Fail better!

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]