|Anonymous | Login | Signup for a new account||2017-05-27 04:33 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001800||OCaml||compiler driver||public||2003-08-27 20:01||2017-03-03 17:39|
|Target Version||Fixed in Version|
|Summary||0001800: -output-obj and c files|
|Description||Full_Name: Trevor Jim|
OS: Mac OS X
Submission from: targe.cs.princeton.edu (18.104.22.168)
Hm, thought I submitted this but I don't see it in the database...
Anyway there is an inconsistency in the way that -output-obj handles C files.
For example, if I do
ocamlopt -custom -o bar <lots of cmx files> foo.c
then ocamlopt compiles foo.c to foo.o and links it in to bar.
But if I do
ocamlopt -output-obj -o bar.o <lots of cmx files> foo.c
then ocamlopt compiles foo.c to foo.o, and DOES NOT link it in to bar.o.
Bug or feature? You decide.
|Tags||No tags attached.|
"-output-obj" is a bit of a strange one since it does effectively a partial link: the OCaml objects are bundled together but any required C stubs are not (and neither is the runtime library). A final link using the system linker is required to put everything together.
Given this and the documentation in the manual the exhibited behaviour in this PR seems correct. It also seems to be consistent with other command line flags (for example "-shared" looks to ignore C objects as well, but will presumably compile them).
I'm torn between just closing this or altering the compiler so that functionality of this form (where C files may be compiled but not linked, for whatever definition of "linked" is appropriate) is changed to reject C input files. Opinions?
I don't think this can be implemented easily because Unix linkers generally do not support linking several `.o` files into a single `.o`, which would be needed here.
I therefore move to close this PR.
|2005-11-18 10:13||administrator||New Issue|
|2016-12-08 13:54||shinwell||Note Added: 0016873|
|2016-12-08 13:54||shinwell||Assigned To||=> shinwell|
|2016-12-08 13:54||shinwell||Status||acknowledged => assigned|
|2017-02-23 16:36||doligez||Category||OCaml general => -OCaml general|
|2017-03-03 17:39||doligez||Note Added: 0017566|
|2017-03-03 17:39||doligez||Category||-OCaml general => compiler driver|
|2017-03-03 17:39||doligez||Description Updated||View Revisions|
|Copyright © 2000 - 2011 MantisBT Group|