ocaml / ocaml

The core OCaml system: compilers, runtime system, base libraries
https://ocaml.org
Other
5.38k stars 1.09k forks source link

"ocamlopt.opt -cc 'g++'" calls gcc instead of g++ #4621

Closed vicuna closed 15 years ago

vicuna commented 15 years ago

Original bug ID: 4621 Reporter: spiralvoice Status: closed (set by @xavierleroy on 2008-10-15T08:49:45Z) Resolution: fixed Priority: normal Severity: major Version: 3.11+dev Category: ~DO NOT USE (was: OCaml general)

Bug description

Here is the command line of ocamlopt.opt

ocamlopt.opt -inline 10 -verbose -linkall -o mlnet \ bigarray.cmxa unix.cmxa str.cmxa -ccopt " " -cclib "-lz " -cclib -lbz2 -ccopt "-pthread" \ \ -cclib "-lgd -ljpeg -lfreetype -lpng12 -lz -lm" -ccopt "-L/usr/lib" \ -cc 'g++' -ccopt '-g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' \ -cclib -lmagic \ -I build build/cdk.cmxa build/magic.cmxa build/common.cmxa build/client.cmxa build/core.cmxa build/driver.cmxa src/daemon/common/commonMain.cmx

which results into these calls:

It leads to linking problems with C++ code. Using the same command with Ocaml 3.10.2 works.

Additional information

ocamlopt.opt -v

The Objective Caml native-code compiler, version 3.11+dev20 Private_abbrevs+natdynlink+lazy_patterns+fscanf debug (2008-10-08) Standard library directory: /usr/local/lib/ocaml

vicuna commented 15 years ago

Comment author: @xavierleroy

Thanks for reporting this regression. It is fixed in the 3.11 release branch.