configure script issue with -flto with recent gcc and system ar/ranlib

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

configure script issue with -flto with recent gcc and system ar/ranlib

Thomas König
Hi,

there can be an issue with recent gcc where the system-installed "ar"
and "ranlib" commands cannot handle LTO binaries.  On compilation, this
manifests itself with error messages claiming that they need extra
plugins.

This can be fixed by using the command line

$ AR=gcc-ar RANLIB=gcc-ranlib ./configure --enable-lto

so it is not a big issue, but it would still be nicer if the configure
script tested the functionality of ar and ranlib itself and would
select the appropriate one accordingly.

This is with R version 3.5.3.

Regards

        Thomas

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: configure script issue with -flto with recent gcc and system ar/ranlib

Tomas Kalibera
On 4/23/19 2:59 PM, Thomas König wrote:

> Hi,
>
> there can be an issue with recent gcc where the system-installed "ar"
> and "ranlib" commands cannot handle LTO binaries.  On compilation, this
> manifests itself with error messages claiming that they need extra
> plugins.
>
> This can be fixed by using the command line
>
> $ AR=gcc-ar RANLIB=gcc-ranlib ./configure --enable-lto
>
> so it is not a big issue, but it would still be nicer if the configure
> script tested the functionality of ar and ranlib itself and would
> select the appropriate one accordingly.
>
> This is with R version 3.5.3.

Thanks for the report. What was the version of binutils on the system
with this problem? On my Ubuntu 18.04 I can use the binutils version of
"ar" and "ranlib" with --enable-lto without problems.  I read that with
recent binutils (2.25?), the LTO plugin should be loaded automatically,
so one does not have to use the wrappers anymore.

Thanks
Tomas

>
> Regards
>
>     Thomas
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: configure script issue with -flto with recent gcc and system ar/ranlib

Thomas König
Hi Tomas,

> On 4/23/19 2:59 PM, Thomas König wrote:
>> Hi,
>>
>> there can be an issue with recent gcc where the system-installed "ar"
>> and "ranlib" commands cannot handle LTO binaries.  On compilation, this
>> manifests itself with error messages claiming that they need extra
>> plugins.

> Thanks for the report. What was the version of binutils on the system
> with this problem? On my Ubuntu 18.04 I can use the binutils version of
> "ar" and "ranlib" with --enable-lto without problems.  I read that with
> recent binutils (2.25?), the LTO plugin should be loaded automatically,
> so one does not have to use the wrappers anymore.

This was with, on x86_64-pc-linux-gnu,

GNU ar (GNU Binutils; openSUSE Leap 42.3) 2.31.1.20180828-19

and, on powerpc64le-unknown-linux-gnu,

GNU ar version 2.27-34.base.el7

both with a recent gcc 9.0.1 snapshot.

Regards

        Thomas

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: configure script issue with -flto with recent gcc and system ar/ranlib

Tomas Kalibera
On 4/25/19 6:11 PM, Thomas König wrote:

> Hi Tomas,
>
>> On 4/23/19 2:59 PM, Thomas König wrote:
>>> Hi,
>>>
>>> there can be an issue with recent gcc where the system-installed "ar"
>>> and "ranlib" commands cannot handle LTO binaries.  On compilation, this
>>> manifests itself with error messages claiming that they need extra
>>> plugins.
>
>> Thanks for the report. What was the version of binutils on the system
>> with this problem? On my Ubuntu 18.04 I can use the binutils version
>> of "ar" and "ranlib" with --enable-lto without problems.  I read that
>> with recent binutils (2.25?), the LTO plugin should be loaded
>> automatically, so one does not have to use the wrappers anymore.
>
> This was with, on x86_64-pc-linux-gnu,
>
> GNU ar (GNU Binutils; openSUSE Leap 42.3) 2.31.1.20180828-19
>
> and, on powerpc64le-unknown-linux-gnu,
>
> GNU ar version 2.27-34.base.el7
>
> both with a recent gcc 9.0.1 snapshot.

Thanks. I can reproduce with Leap 42.3 and gcc-8, the binutils ar fails
with errors "plugin needed to handle lto object". This is because "ar"
cannot find the LTO plugin liblto_plugin.so. The plugin needs to be in
directory /usr/lib/bfd-plugins for ar/nm/ranlib to find it. On 42.3, gcc
installation fails to create that directory and link its plugin there. I
read that the problem is fixed in Leap 45. To work this around in Leap
42.3, one may build R using the wrappers (AR=gcc-ar RANLIB=gcc-ranlib
NM=gcc-nm) or create the link.

mkdir /usr/lib/bfd-plugins
ln -s /usr/lib64/gcc/x86_64-suse-linux/8/liblto_plugin.so
/usr/lib/bfd-plugins

Similar wrappers exist also for LLVM, but I read that LLVM installation
on Leap 42.3 links its plugin properly from /usr/lib/bfd-plugins.

Best
Tomas

>
> Regards
>
>     Thomas

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel