Skip to content
Back to formatted view

Raw Message

Message-ID: <1MbirE-1rRfHw1i7q-00dG2U@mail.gmx.net>
Date: 2023-10-08T19:41:14Z
From: Matthias Gondan
Subject: [R-pkg-devel] CXX_VISIBILITY on macOS

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]]