* [Caml-list] pic version of libasmrun not used
@ 2017-05-31 8:12 Olaf Hering
2017-05-31 11:24 ` Gabriel Scherer
0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2017-05-31 8:12 UTC (permalink / raw)
To: caml-list
[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]
openSUSE Tumbleweed switched to gcc7, with the result that most ocaml
related packages fail to build. The reason is that libasmrun.a instead
of libasmrun_pic.a is used during linking:
[ 44s] + ocamlfind ocamlopt unix.cmxa -I /usr/lib64/ocaml/ocamlbuild /usr/lib64/ocaml/ocamlbuild/ocamlbuildlib.cmxa -linkpkg myocamlbuild.ml /usr/lib64/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
...
[ 44s] /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/ocaml/libasmrun.a(startup_aux.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
...
[ 44s] E: Failure("Command ''/usr/bin/ocamlbuild' src/oasis/oasis.cma src/oasis/oasis.cmxa src/oasis/oasis.a src/oasis/oasis.cmxs src/base/base.cma src/base/base.cmxa src/base/base.a src/base/base.cmxs src/builtin-plugins.cma src/builtin-plugins.cmxa src/builtin-plugins.a src/builtin-plugins.cmxs src/dynrun/dynrun.cma src/dynrun/dynrun.cmxa src/dynrun/dynrun.a src/dynrun/dynrun.cmxs src/ext/plugin-loader/src/plugin-loader.cma src/ext/plugin-loader/src/plugin-loader.cmxa src/ext/plugin-loader/src/plugin-loader.a src/ext/plugin-loader/src/plugin-loader.cmxs src/cli/cli.cma src/cli/Main.byte src/ext/userconf/src/userconf.cma src/ext/userconf/src/userconf.cmxa src/ext/userconf/src/userconf.a src/ext/userconf/src/userconf.cmxs -use-ocamlfind -tag debug' terminated with error code 10")
The workaround is to overwrite libasmrun.a in ocaml like this:
cp -av --remove-destination \
%{buildroot}%{_libdir}/ocaml/libasmrun_pic.a \
%{buildroot}%{_libdir}/ocaml/libasmrun.a
Is there a secret knob to let ocamlbuild select the pic version of libasmrun?
Olaf
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] pic version of libasmrun not used
2017-05-31 8:12 [Caml-list] pic version of libasmrun not used Olaf Hering
@ 2017-05-31 11:24 ` Gabriel Scherer
2017-05-31 12:16 ` Olaf Hering
0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Scherer @ 2017-05-31 11:24 UTC (permalink / raw)
To: Olaf Hering; +Cc: caml users
[-- Attachment #1: Type: text/plain, Size: 2742 bytes --]
The OCaml compiler has a flag (-runtime-variant foo) that has the effect of
linking libasmrunfoo.a instead.
In OCaml 4.02.2, whitequark contributed both the build of libasmrun_pic.a
and an ocamlbuild flag runtime_variant(foo) to enable this feature in
ocamlbuild. So you can use the tag 'runtime_variant(_pic)' at the level of
one OCamlbuild project to enable this.
I suppose that what you would actually be looking for here is a way to set
this runtime variant as the default at the level of the whole OCaml package
tree (one opam switch). Unfortunately, I don't know whether the ocaml
configure/build system makes this easy today. Could you consider opening an
issue on the bugtracker ( http://caml.inria.fr/mantis/view_all_bug_page.php
) to track this feature request?
Do you have some documentation on what precisely is the change in gcc7 that
causes this compatibility breakage?
On Wed, May 31, 2017 at 4:12 AM, Olaf Hering <olaf@aepfle.de> wrote:
> openSUSE Tumbleweed switched to gcc7, with the result that most ocaml
> related packages fail to build. The reason is that libasmrun.a instead
> of libasmrun_pic.a is used during linking:
>
>
> [ 44s] + ocamlfind ocamlopt unix.cmxa -I /usr/lib64/ocaml/ocamlbuild
> /usr/lib64/ocaml/ocamlbuild/ocamlbuildlib.cmxa -linkpkg myocamlbuild.ml
> /usr/lib64/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
> ...
> [ 44s] /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
> /usr/lib64/ocaml/libasmrun.a(startup_aux.o): relocation R_X86_64_32
> against `.rodata.str1.1' can not be used when making a shared object;
> recompile with -fPIC
> ...
> [ 44s] E: Failure("Command ''/usr/bin/ocamlbuild' src/oasis/oasis.cma
> src/oasis/oasis.cmxa src/oasis/oasis.a src/oasis/oasis.cmxs
> src/base/base.cma src/base/base.cmxa src/base/base.a src/base/base.cmxs
> src/builtin-plugins.cma src/builtin-plugins.cmxa src/builtin-plugins.a
> src/builtin-plugins.cmxs src/dynrun/dynrun.cma src/dynrun/dynrun.cmxa
> src/dynrun/dynrun.a src/dynrun/dynrun.cmxs src/ext/plugin-loader/src/plugin-loader.cma
> src/ext/plugin-loader/src/plugin-loader.cmxa src/ext/plugin-loader/src/plugin-loader.a
> src/ext/plugin-loader/src/plugin-loader.cmxs src/cli/cli.cma
> src/cli/Main.byte src/ext/userconf/src/userconf.cma
> src/ext/userconf/src/userconf.cmxa src/ext/userconf/src/userconf.a
> src/ext/userconf/src/userconf.cmxs -use-ocamlfind -tag debug' terminated
> with error code 10")
>
> The workaround is to overwrite libasmrun.a in ocaml like this:
> cp -av --remove-destination \
> %{buildroot}%{_libdir}/ocaml/libasmrun_pic.a \
> %{buildroot}%{_libdir}/ocaml/libasmrun.a
>
> Is there a secret knob to let ocamlbuild select the pic version of
> libasmrun?
>
>
> Olaf
>
[-- Attachment #2: Type: text/html, Size: 3438 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-31 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 8:12 [Caml-list] pic version of libasmrun not used Olaf Hering
2017-05-31 11:24 ` Gabriel Scherer
2017-05-31 12:16 ` Olaf Hering
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox