using JWasm with mingw headers and libs (?)

Started by SteveAsm, October 27, 2011, 02:40:09 PM

Previous topic - Next topic

jcfuller

Also note I am using the 32bit MinGW TDM4.6.1 not TDM64 for these tests as it's easier to use ld and I have no interest in 64bit assembler.

I do use MinGWTDM64 for all my Bcx/Ubx/C++ work.

James

drizz

#31
jcfuller,

I thought you said "elf vs coff". You meant "omf vs coff"? Indeed omf is more compatible with mingw tools-chain, nevertheless it supports coff too.
The truth cannot be learned ... it can only be recognized.

jcfuller

drizz,
omf  ??
As I said I'm a novice but ....
In my original bat file post I use -elf for jwasm and --format elf32-i386 for ld.

Then I tried -coff for jwasm and --format pe-i386 for ld.

Is --format pe-i386 for omf ?
If so what is coff. The information for ld is a bit confusing to me.

Thanks

James





Quote from: drizz on October 28, 2011, 01:22:33 PM
jcfuller,

I thought you said "elf vs coff". You meant "omf vs coff"? Indeed omf is more compatible with mingw tools-chain, nevertheless it supports coff too.


drizz

Ignore my last post :bdg
There are so many variations on a theme that is easy to get confused.

I don't know what input format is better for ld or if there are any issues with linking elf objects to PE.
I use -elf for linux 32, -elf64 for linux 64, -coff for win32, -win64 for win64
The truth cannot be learned ... it can only be recognized.

jcfuller

This is confusing and tracking down the information is just as bad!

As this is stll about the TOPIC I'll add more....

This is what I understand so far along with info on what has confused me.

MinGW gcc/g++ 32bit default is coff.
jwasm default is omf
ld appears to be able to handle a mixed bag of formats
I'm not sure on MinGW ar?

I compiled a few asm routines with jwasm xxx.asm; I assume  omf  xxx.obj files
I then used ar to create a static library ar rcs *.obj libmylib.a
Next I compiled asm code with jwasm using -elf and linking with ld using MinGW Windows libraries and -lmylib
All worked fine.

I wrote a simple demo on linux and japheth added this header which started the confusion on my part.
;=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
;very simple jwasm gtk example (written by jcfuller)
; create a Linux binary
; 1. assemble:       jwasm -elf -zcw -Fo=gtk01.o gtk01.asm
; 2. link with LD:   ld -s -o gtk01 gtk01.o -I/lib/ld-linux.so.2 `pkg-config --libs gtk+-2.0`
;
; create a Win32 binary with MinGW
; ( MinGW installed at C:\MinGW, GTK+ installed at C:\GTK )
; 1. assemble:       jwasm -elf gtk01.asm
; 2. link with LD:   ld -s -o gtk01.exe gtk01.obj -Lc:/gtk/lib
;                    -lgtk-win32-2.0.dll -lgobject-2.0.dll -Lc:/mingw/lib -lmsvcrt
;=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

Time to go code some PowerBASIC and get my head straight :)

James

drizz

If it works why bother?  :)

OT:
James, do you perhaps have a complete set of include files for jwasm on linux? XWindows, some kind of LinInc system or anything else like that? I would be interested in that.
The truth cannot be learned ... it can only be recognized.

jcfuller

drizz,
  From what I remember it's a bit of this and a bit of that. I think I have a pretty complete gtk-2.
Some protos for c libraries stdio, stdlib ..... but not complete.
I ported Raymond's fpu library to linux 32bit. I really should get these a bit more organized.

James