From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 2B0BB80143 for ; Wed, 31 May 2017 13:24:59 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-it0-f41.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.41 as permitted sender) identity=mailfrom; client-ip=209.85.214.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-it0-f41.google.com) identity=helo; client-ip=209.85.214.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-it0-f41.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3APHe52BHEcXWIPOcoGWCPDZ1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ7zrsWwAkXT6L1XgUPTWs2DsrQf2rSQ7v+oGTRZp83Q7zZaKN0EfiRGoP?= =?us-ascii?q?tVtjRjOvLNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9?= =?us-ascii?q?fbytScbdgMutyu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+zriFiaUTFJfXqyXq?= =?us-ascii?q?Q85is6CI28F4vDSJqt0/S923KcGpRYLkBLEFGKHj+8cIGNVd8FZTqcJsInnjFS?= =?us-ascii?q?Bpa7TIp0+hikrg73z/JcJerZ4CAC/cbs3dJv5uDX0wo59TFuAt613GSETmUylW?= =?us-ascii?q?QNEWxllJtjqFBwnw/QmZNzhOZVQJkKv6tE?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0ACMQB0pi5ZfynWVdFDGh0BBQELARgBB?= =?us-ascii?q?QELAYJ/TgE+gQ0Hg2uBNppRgmmGL4cphEQGgn0shXgCglYHQxQBAQEBAQEBAQE?= =?us-ascii?q?BARIBAQkLCwgmMYIzJAGCQQECAgEjHQEbHQEDAQsGAwILNwICIgERAQUBHAYTi?= =?us-ascii?q?hEBAw0IEDGNY5EaP4wHggQFARyDCgWDWgoZJw1WgzsBAQEBAQUBAQEBAQEaAgY?= =?us-ascii?q?Shk+Ef4d7gmABBJ4jghCFEIwIgluPHIpeiCgUH4EVDyeBKzAhI1sZhFuCKiQ2A?= =?us-ascii?q?YlSAQEB?= X-IPAS-Result: =?us-ascii?q?A0ACMQB0pi5ZfynWVdFDGh0BBQELARgBBQELAYJ/TgE+gQ0?= =?us-ascii?q?Hg2uBNppRgmmGL4cphEQGgn0shXgCglYHQxQBAQEBAQEBAQEBARIBAQkLCwgmM?= =?us-ascii?q?YIzJAGCQQECAgEjHQEbHQEDAQsGAwILNwICIgERAQUBHAYTihEBAw0IEDGNY5E?= =?us-ascii?q?aP4wHggQFARyDCgWDWgoZJw1WgzsBAQEBAQUBAQEBAQEaAgYShk+Ef4d7gmABB?= =?us-ascii?q?J4jghCFEIwIgluPHIpeiCgUH4EVDyeBKzAhI1sZhFuCKiQ2AYlSAQEB?= X-IronPort-AV: E=Sophos;i="5.38,423,1491256800"; d="scan'208,217";a="226860084" Received: from mail-it0-f41.google.com ([209.85.214.41]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 31 May 2017 13:24:57 +0200 Received: by mail-it0-f41.google.com with SMTP id m47so11817118iti.1 for ; Wed, 31 May 2017 04:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gmBtLuig7tKt6fj/FKZxDEc5uXWihQcD9G1j+/Cw4M8=; b=F/diY1vzQbRoSscdutzMR8E5WGpVVq0+g5irICymFuHbmpVTELqoeryCZZijk15vYY /BF5iPsetnJGkBcR8uHx7Ocibxu0XR0z+i3j3HnsBYj+BoE2QWGY6hBC67cCk1ZA0N5j 2rrrAzeLEDkKO06t7j+LTY4ZwGCJWJ9u3NeJkOFdlXmIOF5PGqC+vYSvWjqS4ZqxU+Hq FrmvbU38ZBrc3euUlhkM/Y4Jn+h4PGK18AT6sGYS/bNPXTkj86CyyDKjXl53ysvudkLR KedMXpHlvzl3dQtcS8pCd/UkfJDbeA3QU0vSgT0PTjRBWqeDW24KeZguFu8+CCGQPo2o Yghg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gmBtLuig7tKt6fj/FKZxDEc5uXWihQcD9G1j+/Cw4M8=; b=RzSN9H+L3Bbpnlih0HsxkgqFis4MuvP0GumFS08sRfZByMJtGvI0M9ksjwWQ+ul1NC tPK8jblGd+pTsDV0o/Ahk8CatKfKLAzVaNwkRgi/ZG+k+jKpYBuQZ7D67rdBMJpgQKXF JcDgz3aEXh/osHDXJMh2+rSG/GKYXbhwffKkeTfnvh3Evz6mtsbu1s/9uTZSmDZMdbA7 Fjh4+amyxpJ+6AHTPFOqvNZ666qDDo6G1UyFNC8/D0x/mk70mLQg/d2b6UL/weY8xrJ3 /Sf70ToZ4BNeDBQr2ruXjfV01Qm67FxB/kfmztwh0CpI/7WnxqmV78gfbVQfs5RG5JEN FKHg== X-Gm-Message-State: AODbwcBqYwn/RmdYZyB7ufH3ZfbFWzE/ZiWgqeuKCHO8RB/iTLXofGgl tzLSKrAixPnTR5QWC+tE8YGZEeYt93wq X-Received: by 10.36.69.225 with SMTP id c94mr6603300itd.79.1496229896406; Wed, 31 May 2017 04:24:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.36.212 with HTTP; Wed, 31 May 2017 04:24:15 -0700 (PDT) In-Reply-To: <20170531081218.GH26792@aepfle.de> References: <20170531081218.GH26792@aepfle.de> From: Gabriel Scherer Date: Wed, 31 May 2017 07:24:15 -0400 Message-ID: To: Olaf Hering Cc: caml users Content-Type: multipart/alternative; boundary="001a11c14bf67a57330550d02b14" Subject: Re: [Caml-list] pic version of libasmrun not used --001a11c14bf67a57330550d02b14 Content-Type: text/plain; charset="UTF-8" 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 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 > --001a11c14bf67a57330550d02b14 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The OCaml compiler has a flag (-runtime-var= iant 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 oca= mlbuild. So you can use the tag 'runtime_variant(_pic)' at the leve= l of one OCamlbuild project to enable this.

I suppose that wha= t you would actually be looking for here is a way to set this runtime varia= nt as the default at the level of the whole OCaml package tree (one opam sw= itch). Unfortunately, I don't know whether the ocaml configure/build sy= stem makes this easy today. Could you consider opening an issue on the bugt= racker ( http= ://caml.inria.fr/mantis/view_all_bug_page.php ) to track this feature r= equest?

Do you have some documentation on what precisely is th= e 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 m= ost ocaml
related packages fail to build. The reason is that libasmrun.a instead
of libasmrun_pic.a is used during linking:


[=C2=A0 =C2=A044s] + ocamlfind ocamlopt unix.cmxa -I /usr/lib64/ocaml/ocaml= build /usr/lib64/ocaml/ocamlbuild/ocamlbuildlib.cmxa -linkpkg myocamlbui= ld.ml /usr/lib64/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild ...
[=C2=A0 =C2=A044s] /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
...
[=C2=A0 =C2=A044s] E: Failure("Command ''/usr/bin/ocamlbuild&#= 39; src/oasis/oasis.cma src/oasis/oasis.cmxa src/oasis/oasis.a src/oasis/oa= sis.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/plug= in-loader.cma src/ext/plugin-loader/src/plugin-loader.cmxa src/ext/plu= gin-loader/src/plugin-loader.a src/ext/plugin-loader/src/plugin-l= oader.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/userc= onf.a src/ext/userconf/src/userconf.cmxs -use-ocamlfind -tag debu= g' terminated with error code 10")

The workaround is to overwrite libasmrun.a in ocaml like this:
cp -av --remove-destination \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 %{buildroot}%{_libdir}/ocaml/libasmrun_pic= .a \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 %{buildroot}%{_libdir}/ocaml/libasmrun.a
Is there a secret knob to let ocamlbuild select the pic version of libasmru= n?


Olaf

--001a11c14bf67a57330550d02b14--