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: 1800 Reporter: administrator Assigned to:@mshinwell Status: assigned (set by @mshinwell on 2016-12-08T12:54:25Z) Resolution: open Priority: normal Severity: feature Category: compiler driver
Bug description
Full_Name: Trevor Jim
Version: 3.06
OS: Mac OS X
Submission from: targe.cs.princeton.edu (128.112.139.194)
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 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 foo.c
then ocamlopt compiles foo.c to foo.o, and DOES NOT link it in to bar.o.
Bug or feature? You decide.
The text was updated successfully, but these errors were encountered:
"-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.
Original bug ID: 1800
Reporter: administrator
Assigned to: @mshinwell
Status: assigned (set by @mshinwell on 2016-12-08T12:54:25Z)
Resolution: open
Priority: normal
Severity: feature
Category: compiler driver
Bug description
Full_Name: Trevor Jim
Version: 3.06
OS: Mac OS X
Submission from: targe.cs.princeton.edu (128.112.139.194)
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 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 foo.c
then ocamlopt compiles foo.c to foo.o, and DOES NOT link it in to bar.o.
Bug or feature? You decide.
The text was updated successfully, but these errors were encountered: