Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005659OCamlOCaml windowspublic2012-06-21 14:562012-07-17 20:33
Reporterdb 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.1 
Target Version4.00.0+devFixed in Version4.00.0+dev 
Summary0005659: ocamlmklib's -L option does not work as expected with Microsoft Visual C compiler
DescriptionConsider the following scenario (all files are attached below):

C:\Work\Ocaml\Bug\ocamlmklib>make.bat

C:\Work\Ocaml\Bug\ocamlmklib>ocamlc -c foo_stubs.c
foo_stubs.c

C:\Work\Ocaml\Bug\ocamlmklib>ocamlmklib -verbose -Lc:/Ocaml/lib foo.ml foo_stubs
.obj -o foo
+ flexlink -merge-manifest -o .\dllfoo.dll foo_stubs.obj -Lc:/Ocaml/lib
+ link /lib /nologo /out:.\libfoo.lib foo_stubs.obj
+ ocamlc -a -o foo.cma foo.ml -dllib -lfoo -cclib -lfoo -ccopt -Lc:/Ocaml/lib

+ ocamlopt -a -o foo.cmxa foo.ml -cclib -lfoo -ccopt -Lc:/Ocaml/lib

C:\Work\Ocaml\Bug\ocamlmklib>ocamlc -verbose foo.cma bar.ml -output-obj -o bar.obj
+ cl /nologo -D_CRT_SECURE_NO_DEPRECATE /Ox /MD -c -Lc:/Ocaml/lib -I"C:\Ocaml\lib" "bar.c"
cl : Command line warning D9002 : ignoring unknown option '-Lc:/Ocaml/lib' bar.c
C:\Work\Ocaml\Bug\ocamlmklib>

Note strange "-ccopt -Lc:/Ocaml/lib" that ocamlmklib generates and that is not recognized later by Microsoft C compiler. Why -L path is put into -ccopt?
TagsNo tags attached.
Attached Fileszip file icon bug.zip [^] (1,197 bytes) 2012-06-21 14:56
patch file icon ocamlmklib.patch [^] (1,318 bytes) 2012-07-12 14:30 [Show Content]

- Relationships

-  Notes
(0007731)
doligez (administrator)
2012-07-12 14:30

For reference, I have attached the patch proposed by Fabrice.
(0007770)
doligez (administrator)
2012-07-17 20:33

Tested and applied Fabrice's patch in 4.00 (commit 12723) and trunk (commit 12724).

- Issue History
Date Modified Username Field Change
2012-06-21 14:56 db New Issue
2012-06-21 14:56 db File Added: bug.zip
2012-07-04 17:17 doligez Target Version => 4.00.0+dev
2012-07-12 14:29 doligez Status new => acknowledged
2012-07-12 14:30 doligez File Added: ocamlmklib.patch
2012-07-12 14:30 doligez Note Added: 0007731
2012-07-17 20:33 doligez Note Added: 0007770
2012-07-17 20:33 doligez Status acknowledged => closed
2012-07-17 20:33 doligez Resolution open => fixed
2012-07-17 20:33 doligez Fixed in Version => 4.00.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker