pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pcre-ocaml buildlink problems



Hi,

I'm trying to update pcre-ocaml, but I'm running into some problems; at some 
point my compilation stops, complaining about some "undefined reference to 
`caml_hash_variant'".

Now, I know that I'm supposed to be (one of) the ocaml expert(s) here, but I'm 
suspecting that there is actually some buildlink trickery going on. Ocaml uses 
gcc to link things - this is the gcc command that actually gives the error:
gcc -o 'examples/cloc/cloc.native'   '-Llib' '-L/usr/pkg/lib/ocaml' -O2 -
I/usr/pkg/include -I/usr/include -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib 
-Wl,-R/usr/lib -O2 -I/usr/pkg/include -I/usr/include -L/usr/pkg/lib -Wl,-
R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib '/tmp/camlstartup918211.o' 
'/usr/pkg/lib/ocaml/std_exit.o' 'examples/cloc/cloc.o' 'lib/pcre.a' 
'/usr/pkg/lib/ocaml/stdlib.a' '-lpcre_stubs' '-L/usr/pkg/lib' '-Wl,-
R/usr/pkg/lib' '-lpcre' '-L/usr/pkg/lib' '-Wl,-R/usr/pkg/lib' '-lpcre' 
'/usr/pkg/lib/ocaml/libasmrun.a' -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib  
-lm

(the error is:
lib/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init':
/usr/wrkdir-pkgsrc/devel/pcre-ocaml/work/pcre-
ocaml-7.1.1/_build/lib/pcre_stubs.c:169: undefined reference to 
`caml_hash_variant')

caml_hash_variant is defined in /usr/pkg/lib/ocaml/libasmrun.a, so this 
shouldn't be happening.

If I then continue the build from inside the work directory, the following 
command is run:
gcc -o 'examples/cloc/cloc.native'   '-Llib' '-L/usr/pkg/lib/ocaml' -O2 -
I/usr/pkg/include -I/usr/include -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib 
-Wl,-R/usr/lib '/tmp/camlstartupb697f4.o' '/usr/pkg/lib/ocaml/std_exit.o' 
'examples/cloc/cloc.o' 'lib/pcre.a' '/usr/pkg/lib/ocaml/stdlib.a' '-
lpcre_stubs' '-L/usr/pkg/lib' '-Wl,-R/usr/pkg/lib' '-lpcre' '-L/usr/pkg/lib' 
'-Wl,-R/usr/pkg/lib' '-lpcre' '/usr/pkg/lib/ocaml/libasmrun.a' -L/usr/lib -
Wl,-R/usr/lib -Wl,-R/usr/pkg/lib  -lm

which looks functionally equivalent to me, but links successfully.

So, my guess is that there is something going on with buildlink that results 
in gcc not seeing libasmrun.a properly. I've checked, and there is a 
lib/ocaml/libasmrun.a in the buildlink directory, and it contains 
caml_hash_variant.

Would anyone familiar with buildlink care to hazard a guess at what's 
happening here? I'm stumped.

best,

  Jaap

-- 
"Then I'll tell the truth. We're allowed to do that in emergencies."


Home | Main Index | Thread Index | Old Index