Skip to content

Fix old macOS Clang allocation flags - #278

Open
LeonidasZhak wants to merge 1 commit into
RcppCore:masterfrom
LeonidasZhak:fix/old-macos-aligned-allocation
Open

Fix old macOS Clang allocation flags#278
LeonidasZhak wants to merge 1 commit into
RcppCore:masterfrom
LeonidasZhak:fix/old-macos-aligned-allocation

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

Pass -fno-aligned-allocation when building against libc++ on macOS 10.12 and earlier with Clang.

Thanks to maintainers

Thanks for identifying the affected compiler and macOS boundary in #219, and for welcoming a focused fix.

Issue or motivation

Fixes #219. The oneTBB backend does not compile on the affected systems unless this flag is supplied.

Root cause

Darwin 16 and earlier use a libc++ implementation that needs aligned allocation disabled for the oneTBB build and for packages compiling against its headers. The flag was not carried through RcppParallel's configuration or downstream CxxFlags() output.

Change

  • Detect the Darwin 16-or-earlier and clang++ combination during configuration.
  • Pass the resulting flag to RcppParallel, the bundled oneTBB build, and downstream packages through CxxFlags().
  • Add focused tests for the platform/compiler boundary and document the fix in NEWS.

Tests

  • Platform helper regression checks for affected and unaffected combinations: passed
  • R CMD build --no-manual: passed
  • R CMD check --as-cran --no-manual: passed; all 13 test scripts passed, with only the existing development-version NOTE

Scope

This does not change flags on newer macOS releases, non-Clang compilers, or non-Darwin platforms. It does not modify the bundled oneTBB sources or alter unrelated compiler flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[oneTBB backend] macOS < 10.13 with libc++ need -fno-aligned-allocation

1 participant