[R-pkg-devel] CXX_VISIBILITY on macOS

Matthias Gondan m@tth|@@-gond@n @end|ng |rom gmx@de
Sun Oct 8 21:41:14 CEST 2023


Dear developers and CRAN people,

I get some linker warnings on the macOS build server,

ld: warning: direct access in function '…' from file '…' to global weak symbol '…' from file '…' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

Writing R Extensions (Section 6.16) says that visibility attributes are not supported on macOS nor Windows. If I add $(CXX_VISIBILITY) to PKG_CXXFLAGS, the warnings are still there, and I can see from the compiler log that the flags do not have any effect on macOS. However, if I add -fvisibility=hidden to PKG_CXXFLAGS, the warnings disappear (but I get a reminder from R CMD check that -fvisibility=hidden is not portable). I am wondering if $(CXX_VISIBILITY) could be supported on macOS.

Best wishes,

Matthias

This is the build log of the package: https://www.r-project.org/nosvn/R.check/r-release-macos-arm64/rswipl-00install.html


	[[alternative HTML version deleted]]




More information about the R-package-devel mailing list