You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3439 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
I want to be able to compile a camlp4-based executable (which links in the
campl4.cm[x]a library) without a -linkall (which would result in a noticeably
smaller executable in my case). Unfortunatelly, it is impossible in the current
(3.08.2) state of things - the camlp4 processing relies on the Argl module to do
the "real job" of file processing, but without -linkall, the Argl module gets
dropped!
There are a number of things that can be done about it:
Users could link all camlp4 executables with -linkall. This is what I
currently have to do, but this is obviously suboptimal (especially in case the
executable also needs a bunch of other big libraries).
You could change the camlp4/camlp4/Makefile to use -linkall for building
camlp4.cm[x]a. I should be sufficient (I have to admit - have not tested it yet)
to just replace the "LINKFLAGS=$(INCLUDES)" on line 9 with
"LINKFLAGS=$(INCLUDES) -linkall"! This is ideal, unless there are some valid
reasons to link agains the camlp4.cm[x]a library and not use Argl (I doubt
this is likely to happen)
You could change the camlp4/camlp4/Makefile to install the argl.cmo, argl.o,
and argl.cmx into the "$(LIBDIR)/camlp4/.". This way users would be able to
explicitly link in argl.cmx and not worry about it being dropped. (Not sure if
that would require removing Argl from the camlp4.cm[x]a - if yes, than may be
this is not such a good idea).
You could change the camlp4/camlp4/Makefile to install argl.cmi (by adding it
to the line 76 that currently reads
cp mLast.cmi quotation.cmi ast2pt.cmi pcaml.cmi spretty.cmi
"$(LIBDIR)/camlp4/."). This way users could, for example, add "let _ = Argl.go"
to one of the files compiled into my executable and I am good to go. This is a
bit of a hack, obviously, but it is a possibility.
You could create some additional dependency on Argl (similar to 3) that users
could then use to "pull in" the Argl module w/o haing to use -linkall.
Users could just copy argl.ml from the distribution and compile it into their
binaries, instead of using the Argl in the camlp4.cm[x]a. This is obviously
problematic.
IMHO, options "2" and "3" are much better than all others.
Thank you in advance for considering this!
The text was updated successfully, but these errors were encountered:
Original bug ID: 3439
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Aleksey Nogin
Version: 3.08.2
OS: Fedora Core 2
Submission from: wasco.cs.caltech.edu (131.215.44.173)
I want to be able to compile a camlp4-based executable (which links in the
campl4.cm[x]a library) without a -linkall (which would result in a noticeably
smaller executable in my case). Unfortunatelly, it is impossible in the current
(3.08.2) state of things - the camlp4 processing relies on the Argl module to do
the "real job" of file processing, but without -linkall, the Argl module gets
dropped!
There are a number of things that can be done about it:
Users could link all camlp4 executables with -linkall. This is what I
currently have to do, but this is obviously suboptimal (especially in case the
executable also needs a bunch of other big libraries).
You could change the camlp4/camlp4/Makefile to use -linkall for building
camlp4.cm[x]a. I should be sufficient (I have to admit - have not tested it yet)
to just replace the "LINKFLAGS=$(INCLUDES)" on line 9 with
"LINKFLAGS=$(INCLUDES) -linkall"! This is ideal, unless there are some valid
reasons to link agains the camlp4.cm[x]a library and not use Argl (I doubt
this is likely to happen)
You could change the camlp4/camlp4/Makefile to install the argl.cmo, argl.o,
and argl.cmx into the "$(LIBDIR)/camlp4/.". This way users would be able to
explicitly link in argl.cmx and not worry about it being dropped. (Not sure if
that would require removing Argl from the camlp4.cm[x]a - if yes, than may be
this is not such a good idea).
You could change the camlp4/camlp4/Makefile to install argl.cmi (by adding it
to the line 76 that currently reads
cp mLast.cmi quotation.cmi ast2pt.cmi pcaml.cmi spretty.cmi
"$(LIBDIR)/camlp4/."). This way users could, for example, add "let _ = Argl.go"
to one of the files compiled into my executable and I am good to go. This is a
bit of a hack, obviously, but it is a possibility.
You could create some additional dependency on Argl (similar to 3) that users
could then use to "pull in" the Argl module w/o haing to use -linkall.
Users could just copy argl.ml from the distribution and compile it into their
binaries, instead of using the Argl in the camlp4.cm[x]a. This is obviously
problematic.
IMHO, options "2" and "3" are much better than all others.
Thank you in advance for considering this!
The text was updated successfully, but these errors were encountered: