Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamlopt -shared does not preserve order of -cclib options #5234

Closed
vicuna opened this issue Mar 3, 2011 · 0 comments
Closed

ocamlopt -shared does not preserve order of -cclib options #5234

vicuna opened this issue Mar 3, 2011 · 0 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 3, 2011

Original bug ID: 5234
Reporter: @db4
Status: closed (set by @damiendoligez on 2011-05-17T14:14:58Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.12.0
Fixed in version: 3.12.1+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #5260

Bug description

Consider the following example (Windows, MSVC port):

foo.ml:
let x = 1

bar.ml:
let _ = Printf.printf "%d\n" Foo.x

ocamlopt -a -o foo.cmxa -cclib -defaultlib -cclib msvcrt.lib foo.ml
ocamlopt -verbose -o bar.exe foo.cmxa bar.ml
gives

  • flexlink -merge-manifest -exe -link /STACK:16777216 -o "bar.exe"
    "-LC:\Ocaml\lib" "C:\DOCUME1\dbely\LOCALS1\Temp\camlstartup799bea.obj"
    "C:\Ocaml\lib\std_exit.obj" "bar.obj" "foo.lib" "C:\Ocaml\lib\stdlib.lib"
    "-defaultlib" "msvcrt.lib" "C:\Ocaml\lib\libasmrun.lib" advapi32.lib
    ws2_32.lib
    (correct)

ocamlopt -verbose -shared -o bar.cmxs foo.cmxa bar.ml
gives

  • flexlink -merge-manifest -o "bar.cmxs" "-LC:\Ocaml\lib"
    "bar.cmxs.startup.obj" "bar.obj" "foo.lib" "msvcrt.lib" "-defaultlib"
    flexlink: option `-defaultlib' needs an argument.

Note that "-defaultlib" "msvcrt.lib" order is reversed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant