Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 501428 - dev-lang/ocaml-3.12.1 with dev-ml/pcre-ocaml-6.2.5 - lack of function caml_hash_variant in ocaml makes native code generation in pcre-ocaml fail
Summary: dev-lang/ocaml-3.12.1 with dev-ml/pcre-ocaml-6.2.5 - lack of function caml_ha...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Team for the ML programming language family
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-15 18:13 UTC by thssld
Modified: 2014-09-13 17:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thssld 2014-02-15 18:13:54 UTC
The stable branch of ocaml lack of function caml_hash_variant, which makes software using pcre-ocaml fails to produce native codes.

Reproducible: Always

Steps to Reproduce:
1. Install newest stable ocaml(-3.12.1) and pcre-ocaml(-6.2.5)

2. Write a code as following and save as test.ml :
let () =
    let regex = Pcre.regexp Sys.argv.(1) in
    let str = Sys.argv.(2) in
    let m = try Pcre.extract ~rex:regex str with Not_found -> [||] in
    Array.iter (fun x -> print_endline x) m;;

3. try to compile it to native binary with:
ocamlbuild -use-ocamlfind -package pcre test.native
or
ocamlfind ocamlopt -o test -package pcre -linkpkg test.ml
Actual Results:  
It fails to generate executable and produces following message (slightly differ if using the second command):

+ /usr/bin/ocamlfind ocamlopt -linkpkg -package pcre test.cmx -o test.native
/usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init':
(.text+0x1b2): undefined reference to `caml_hash_variant'
/usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init':
(.text+0x1c5): undefined reference to `caml_hash_variant'
/usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init':
(.text+0x1d8): undefined reference to `caml_hash_variant'
/usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init':
(.text+0x1eb): undefined reference to `caml_hash_variant'
/usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init':
(.text+0x1fe): undefined reference to `caml_hash_variant'
/usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o):(.text+0x211): more undefined references to `caml_hash_variant' follow
collect2: error: ld returned 1 exit status
File "caml_startup", line 1, characters 0-1:
Error: Error during linking
Command exited with code 2.
Compilation unsuccessful after building 4 targets (2 cached) in 00:00:00.


Expected Results:  
It compiles well and produce test.native (or test using the second command)

This bug maybe also have relationship with https://github.com/ocaml/opam-repository/issues/1197‎.

I moved to ocaml of testing branch (-4.01.0) and rebuilt all ocaml packages, and this bug is fixed.

During doing the update, Also found stable branch of ocamlnet(-3.6.3) cannot build with ocaml-4.01.0 (and possibly 4.00.1_rc as the Changelog). As ocaml-4 is not stable, I don't submit a separate bug for this issue.
Comment 1 thssld 2014-09-13 17:03:37 UTC
Stable branch of ocaml is update to 4.01.0 resolved this bug.