Message-ID: <E4CF3C25-B923-49BC-B8D3-9EF5D7D46902@R-project.org>
Date: 2023-10-08T20:29:50Z
From: Simon Urbanek
Subject: [R-pkg-devel] CXX_VISIBILITY on macOS
In-Reply-To: <1MbirE-1rRfHw1i7q-00dG2U@mail.gmx.net>
Matthias,
this has nothing to do with R, but rather your code. You have the wrong order of headers: the SWI headers mess up visibility macros, so you have to include them *after* Rcpp.h.
Cheers,
Simon
> On 9/10/2023, at 8:41 AM, Matthias Gondan <matthias-gondan at gmx.de> wrote:
>
> 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]]
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>