caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] "-pack" on win32/msvc
@ 2002-10-11 19:02 Chris Hecker
  2002-10-11 21:12 ` Chris Hecker
  2002-10-13 10:09 ` Xavier Leroy
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Hecker @ 2002-10-11 19:02 UTC (permalink / raw)
  To: caml-list


Hi, -pack is disabled on msvc builds because nm and objcopy are not 
installed by default.  However, the cygwin nm and objcopy work on PE format 
files (msvc objs, libs, and exes), so everything should work just fine 
(perhaps you didn't know this, Xavier, or maybe you did know it and they're 
broken in some nonobvious way?).  I enabled nm and objcopy in the config 
files, rebuilt, and I've almost got it working (there's a "-o" that needs 
to be turned into a "-out:" as a config.ml parm to link, but that's 
minor).  The big problem is that when the pack.obj is made by asmpackager, 
it includes the camlpackage tmp obj file created, so nm dumps out this 
file's symbols as well.  But the camlpackage tmp is deleted after the 
packed obj is made (around line 242 of 3.06 asmpackager.ml), so when 
objcopy goes to do its thing in rename_in_object_file, it blows up because 
that obj file is missing from the tmp dir.  I just now got access to a unix 
machine to see how it works there, because it doesn't seem like this is an 
msvc-specific problem, but I must admit to not knowing all the details of 
the nm/objcopy step.

Anybody looked at this?

Chris

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] "-pack" on win32/msvc
  2002-10-11 19:02 [Caml-list] "-pack" on win32/msvc Chris Hecker
@ 2002-10-11 21:12 ` Chris Hecker
  2002-10-13 10:09 ` Xavier Leroy
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Hecker @ 2002-10-11 21:12 UTC (permalink / raw)
  To: caml-list


>by default.  However, the cygwin nm and objcopy work on PE format files 
>(msvc objs, libs, and exes), so everything should work just fine (perhaps 
>you didn't know this, Xavier, or maybe you did know it and they're broken 
>in some nonobvious way?).

Actually, it looks like ld supports pe-i386 files as well, so there's just 
a couple small places to patch asmpackager.ml (msvc generates a leading 
underscore on symbols) and it should work.  I'll fix the objcopy command 
line length problem as well (I guess I should sync cvs and make sure that's 
not already fixed) while I'm in there, and post a small patch.

Chris

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] "-pack" on win32/msvc
  2002-10-11 19:02 [Caml-list] "-pack" on win32/msvc Chris Hecker
  2002-10-11 21:12 ` Chris Hecker
@ 2002-10-13 10:09 ` Xavier Leroy
  2002-10-14  8:26   ` Chris Hecker
  1 sibling, 1 reply; 4+ messages in thread
From: Xavier Leroy @ 2002-10-13 10:09 UTC (permalink / raw)
  To: Chris Hecker; +Cc: caml-list

> Hi, -pack is disabled on msvc builds because nm and objcopy are not 
> installed by default.  However, the cygwin nm and objcopy work on PE format 
> files (msvc objs, libs, and exes), so everything should work just fine 
> (perhaps you didn't know this, Xavier, or maybe you did know it and they're 
> broken in some nonobvious way?).

I was told that nm and objcopy might work on MSVC-generated object
files.  But I was also warned that the .obj file format used by MSVC
might not be *exactly* the documented PE format...  So, basically, it
should work most of the time, but might break.

A perhaps less risky alternative is to use the mingw build of OCaml.
I encourage all our advanced Windows users to give it a try and let us
know if it works well.  If it does, it might provide a better
alternative to the MSVC build (working -pack, no need to fetch MASM
from obscure places, etc).

> I enabled nm and objcopy in the config 
> files, rebuilt, and I've almost got it working (there's a "-o" that needs 
> to be turned into a "-out:" as a config.ml parm to link, but that's 
> minor).  The big problem is that when the pack.obj is made by asmpackager, 
> it includes the camlpackage tmp obj file created, so nm dumps out this 
> file's symbols as well.

I don't fully understand what you're describing.  Let us (you and me)
discuss that off-list once you've experimented some more.

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] "-pack" on win32/msvc
  2002-10-13 10:09 ` Xavier Leroy
@ 2002-10-14  8:26   ` Chris Hecker
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Hecker @ 2002-10-14  8:26 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list


>A perhaps less risky alternative is to use the mingw build of OCaml.
>I encourage all our advanced Windows users to give it a try and let us
>know if it works well.  If it does, it might provide a better
>alternative to the MSVC build (working -pack, no need to fetch MASM
>from obscure places, etc).

I think we need to keep the msvc build running properly.  As I've said 
before, I think most professional (as opposed to academic) windows 
programmers are more comfortable with msvc, for better or for worse.

Of course, if the solution to the -pack problem is to have people install 
binutils, then it's not a pure msvc solution anyway...but, it's still 
better to be able to use all of the familiar tools (like the debugger) on 
the resulting executables and any c code linked in.  Downloading binutils 
is just a minor annoyance, as is downloading masm.  Switching compilers is 
a more major step for people (after they've already chosen to try out ocaml).

Another option is to require binutils for the msvc build, and get rid of 
the masm requirement and just use "as" as the assembler, since it generates 
coff anyway.  That would coallesce all the i386 code that's currently 
duplicated between gnu and masm in the whole compiler, and you'd get -pack 
working on msvc as part of this.

 > I don't fully understand what you're describing.  Let us (you and me)
>discuss that off-list once you've experimented some more.

Okay, I'll mail you.

Chris

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-14  8:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11 19:02 [Caml-list] "-pack" on win32/msvc Chris Hecker
2002-10-11 21:12 ` Chris Hecker
2002-10-13 10:09 ` Xavier Leroy
2002-10-14  8:26   ` Chris Hecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).