Gerd Stolpmann <g...@gerd-stolpmann.de> writes:

> Well, that's the wrong order of -lpcre -lpcre_stubs (must be the other
> way round for static linking, while for dynamic linking there is no
> requirement to give the -l archives in any particular order).

Gerd, thanks a million!  Works perfectly again!

> But I fear you are on your own with this issue. There is absolutely no
> sensitivity for getting this right among ocaml developers. Even ocaml
> itself makes it wrong:
>
> g...@flake:~/tmp$ ocamlc -a -cclib -l1 -cclib -l2 -o t.cma t.cmo
> g...@flake:~/tmp$ objinfo t.cma
> File t.cma
>   Force custom: no
>   Extra C object files: -l2 -l1
>   ...
> g...@flake:~/tmp$ ocamlc -a -cclib "-l1 -l2" -o t.cma t.cmo
> g...@flake:~/tmp$ objinfo t.cma
> File t.cma
>   Force custom: no
>   Extra C object files: -l2 -l1
>   ...
>
> Don't know why the order is not kept. It makes it really hard to
> diagnose anything. So far I see, the arguments are again reverted when
> the "Extra C object files" are used.

Are you saying this boils down to an ocamlc bug?  Should I report it?

Or, is this a pcre-ocaml bug I should report to Markus?

> Anyway, I've fixed that for pcre, but you could run into any number of
> similar issues when using libraries. Maybe it is better for you to
> define a wrapper for "ld" that smuggles --start-group and --end-group
> options in, so the search for symbols behaves like for shared linking.

As far as possible I try to avoid using 3rd-party C libraries in my
ocaml code -- I try to stick with pure ocaml libraries.  But there's
no avoiding pcre in what I do.

I would like to understand how you fixed this -- can you point me at
the changes you had to make?  I diffed buildfiles/godi-pcre-6.0.1godi2
and buildfiles/godi-pcre-6.0.1godi4 but I don't think I see the fix in
there.

Thanks again!

_______________________________________________
Godi-list mailing list
Godi-list@ocaml-programming.de
https://godirepo.camlcity.org/mailman/listinfo/godi-list

Reply via email to