ocaml / flexdll

a dlopen-like API for Windows
Other
97 stars 30 forks source link

suggestion: detect obj wordsize mismatching chain type #69

Open zeromus opened 5 years ago

zeromus commented 5 years ago

I was just stumped for a while by a dumb mistake: I used -chain msvc to process x64 .obj files. The error that manifested was Unsupported relocation kind 0008; it would be nice if I had got .obj wordsize (64) mismatches selected chain wordsize (32) instead.

Maybe there's a technical reason for this check not being present, but I think it's more likely nobody's ever done anything as stupid as what I did before.

zeromus commented 5 years ago

And while we're on the subject... it would be nice if -o myfile.exe without -exe printed a warning; or in otherwords, a mismatch of extension and -exe/non-exe option should print a warning.

I know, I'm dumb.

dra27 commented 4 years ago

Yes, this would be a good (and straightforward) addition, although I'd be more explicit that it's the machine type which doesn't match - ARM64 support will arrive at some point, when I fire up the machine on my desk for long enough to do it!

dra27 commented 4 years ago

I don't think it's dumb to forget the .exe! However, OCaml behaves the same way, so we can't add a warning here without forcing that on ocamlopt as well. FWIW, annoying though it is, there occasions where you don't want the .exe and the semantics of the warning become unclear if the name you give has other dots in it. I, for example, have an old Windows-only project which compiles foo.cgi and would be irritated to start getting warnings about foo.cgi not ending it .exe. Equally, the vast number of ocamlbuild projects out there which still emit foo.native really could with a warning that you might have wanted foo.native.exe!