From: Steve Blinkhorn <steve@pr...> - 2007-05-30 15:43:31
I have the source code for a DLL that was designed to be compiled
under MSVC. I need to make a static library from this source code to
link into a (complex) fully-static executable that I have been
building under mingw. But this source code has one function that is
all inline assembler, and one, just one, line of this assembler won't
translate into the gnu syntax for gas. At least it's beyond me (I
just use intel2gas).
Of course it compiles with MSVC, but I could use some clear guidance
1. Can I simply rename a static foo.lib file from MSVC to libfoo.a and
link as normal.
2. When I do 1., it is clear that the linker is trying to resolve
external references via _imp__MyFunc entry points rather than MyFunc.
Is this a matter of MSVC setup options? Something in the source (I
thought I had removed anything that looked as if it were setting
things up to be a DLL)?
3. Or do I need to go through an extra step that I am missing?
Steve Blinkhorn <steve@...>
On 2007-05-30 15:42Z, Steve Blinkhorn wrote:
> I have the source code for a DLL that was designed to be compiled
> under MSVC. I need to make a static library from this source code to
> link into a (complex) fully-static executable that I have been
> building under mingw. But this source code has one function that is
> all inline assembler, and one, just one, line of this assembler won't
> translate into the gnu syntax for gas.
First of all, did you try '.intel_syntax'? Otherwise...
> At least it's beyond me (I
> just use intel2gas).
One option is to post the line that doesn't translate, along
with whatever context is necessary for it to make sense.
Maybe someone here or on some 'intel2gas' list can help you
rewrite it. It would be helpful to copy and paste any error
message you get from that tool.
Another option is to figure out what the asm function does,
and rewrite it completely in an asm dialect that the gnu
assembler accepts, or in a higher-level language. Perhaps
the author can give guidance there.
Or maybe you can just use ms tools, or something else like
'nasm', to assemble this one file and link the resulting
machine code to the binary you produce with gcc.