Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 393
    • Issues 393
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 24
    • Merge requests 24
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !174

[MacOS] Switch to using global CC/C++ binaries

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Hans-Nikolai Viessmann requested to merge hans/sac2c:hans-macos-sysroot-fix-1 into develop Feb 12, 2022
  • Overview 5
  • Commits 2
  • Changes 21

This MR tries to resolve #2256 (closed), which itself is caused by a design decision by the CMAKE devs to always unwrap /usr/bin/cc to <SYSROOT>/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc(https://gitlab.kitware.com/cmake/cmake/-/commit/1f085e11e40a20f8e8702da7920e950e47deb27c), the effect of this is that the SYSROOT path is lost, and must now be manually specified with -sysroot .... This rational behind this was due to a lacking convention with XCode in both install location and which tools needed to have the SYSROOT specified (additionally, there was some concern about XCode upgrades as well, which could break existing configured projects). As of MacOS Catalina (XCode 11ish) this issue is solved, CC/C++ always set the current SYSROOT of the activated XCode. In future releases of CMAKE it is possible that they will do away with this de-wrapping, see https://gitlab.kitware.com/cmake/cmake/-/issues/19180.

In short, when building on MacOS/Darwin-based system, we default to using /usr/bin/cc//usr/bin/c++ when build sac2c. This can be override as standard by setting ENV CC and CXX, or CMAKE's -DCMAKE_<LANG>_COMPILER flag. We also no longer store any SYSROOT in the sac2crc file.

With this a packaged version of the compiler should now run on any MacOS system, regardless of XCode version/location.

Additionally this MR does:

  • re-did documentation in utils/str.c and updated the unit-tests a bit; add STRstrip function to remove space chars from front and back of string.
Edited Feb 15, 2022 by Hans-Nikolai Viessmann
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: hans-macos-sysroot-fix-1