Skip to content
Prev 61625 / 63424 Next

R-4.2.3 build from source on Windows (w Rtools42) - lto1.exe error

Initial comments

- R 4.2.3 is not current

- -flto does not seem to be the default in src/gnuwin32/MkRules.

- LTO versions in GCC are tied to the compiler version, and in recent 
GCC are the same as the compiler version.  The recommended toolchain for 
R 4.2.x is Rtools42 which according to NEWS is based on GCC 10 not 9.

- LTO mismatches in my experience are most often seen in incremental 
builds, so first do an ab initio build.  (Not so long ago they were not 
detected during linking but gave segfaults.)

Assuming it is important to use LTO, I would first build without LTO to 
isolate the issue.  And be aware of the following in the NEWS for R 4.3.0:

     ? The Rcomplex definition (in header R_ext/Complex.h) has been
       extended to prevent possible mis-compilation when interfacing
       with Fortran (PR#18430).

AFAIR that "possible mis-compilation" is most likely using LTO.
On 11/05/2023 02:07, Gmail wrote: