Author Topic: Linking win32 object files under Linux  (Read 17528 times)

Offline Rob

  • Jr. Member
  • *
  • Posts: 2
Linking win32 object files under Linux
« on: April 06, 2010, 04:47:13 AM »
I'm trying to link win32 executables under Linux.  I usually use GoLink under windows, but I can't seem to get it to link under WINE (I suspect it has to do with trying to read the imports directly from the .dlls).
Does anyone know of a good windows linker?  Are there any Linux native ones?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Linking win32 object files under Linux
« Reply #1 on: April 06, 2010, 01:36:17 PM »
There's a post on getting Alink to build under Linux, over in the "Example Code" section:

http://forum.nasm.us/index.php?topic=696.0

In the course of a reply to that, I mentioned that Japheth has a Linux binary of Wlink... I don't actually see that now... Maybe could build it from the OpenWatcom source... (I think hpa builds Windows-Nasm under Linux using OpenWatcom, so it must be possible)

At one point, I tried to build MinGW gcc/binutils on Linux (a failed attempt to build Nasm for Windows on Linux). It didn't work, as I recall. I don't think I spent much time on it.

What else do we have source for? Maybe David Lindauer's Valx would build under Linux? Never tried any of his stuff in Linux... his cc386 is interesting in that it will emit assembly in Nasm syntax - kind of a kick to see Nasm assembling itself. :)

I don't have any experience with WINE - maybe some other linker would work there, or maybe Golink would work if we can learn the "trick".

Outside of the fact that Alink can be made to work, I don't have a good answer, Rob. I admire the question! :)

Best,
Frank


Offline Rob

  • Jr. Member
  • *
  • Posts: 2
Re: Linking win32 object files under Linux
« Reply #2 on: April 07, 2010, 04:51:19 AM »
Well, I got the windows version of alink to work using WINE.
I built it under Linux too, but although it seemed to run fine and displayed the help message, it would just lock up as soon as I tried to link against a library.

Thanks though for your help, it works great for my purposes.
I might just have to add getting this port to work fully to my to-do list though:  it seems so close.

Thanks,
Rob


Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Linking win32 object files under Linux
« Reply #3 on: April 07, 2010, 06:02:14 AM »
Perhaps POLINK under WINE, utilizing .def/.lib files, will do the trick?

I've attached a good deal of Win32 .def/.lib files that were utilized with NASMX when it was still using POLINK.
« Last Edit: April 07, 2010, 06:08:24 AM by Keith Kanios »

Offline QUASAR

  • Jr. Member
  • *
  • Posts: 4
Re: Linking win32 object files under Linux
« Reply #4 on: April 16, 2010, 08:00:00 PM »
It is possible to link using GoLink under Wine -> http://github.com/skirge/nasm32-examples