[R-pkg-devel] Note: information on .o files is not available / Found '_exit', possibly from '_exit' (C)

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Fri Jul 17 15:19:52 CEST 2020


On Fri, 17 Jul 2020 11:25:40 +0200
Fabio Sigrist <fabiosigrist using gmail.com> wrote:

>     Found '_exit', possibly from '_exit' (C)
>     Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
>     Found 'exit', possibly from 'exit' (C), 'stop' (Fortran)
>     Found 'printf', possibly from 'printf' (C)

A curious thing is that it seems to only happen on Windows. I tried
searching objdump -D output for the offending functions by means of a
Perl5 one-liner [1] and found that the functions are all called by
various bits of libgcc, OpenMP, C and C++ runtimes. This is probably
caused by linking your R package with -static-libstdc++ (which is set
in CMakeLists.txt if(WIN32 AND MINGW)).

> Note that the shared library is compiled using install.libs.R (this
> is a deliberate choice)

Some of the things it does aren't very portable (e.g. manually setting
most -W flags is discouraged). In particular, I had to manually remove
-Wno-error=cast-function-type from CMakeLists.txt to build the package
with GCC 6.3.0-18+deb9u1, despite it passing the version check
(>=4.8.2).

-- 
Best regards,
Ivan

[1] objdump -D lib_gpboost.dll | \
 perl -lnE'
  $fn = $1 if /^[0-9a-f]+ +<([^>]+)>:/;
  say $fn if /call.*<\Q$call\E/
 ' -s -- -call=abort | c++filt



More information about the R-package-devel mailing list