Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple's Xcode 10 changes to autodetect /usr/include in SDK needs to be ported to llvm.org clang #38193

Open
llvmbot opened this issue Sep 5, 2018 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' platform:macos

Comments

@llvmbot
Copy link
Member

llvmbot commented Sep 5, 2018

Bugzilla Link 38845
Version 7.0
OS MacOS X
Reporter LLVM Bugzilla Contributor
@llvmbot
Copy link
Member Author

llvmbot commented Sep 5, 2018

The current llvm 7.0 clang compiler code appears to be missing the changes from clang in Xcode 10 that allows the /usr/include in the SDK to be automatically detected in the absence of the root level /usr/include. These changes need to be ported to llvm.org's clang so that the headers in the SDK's /usr/include can be used in the absence of the installation of the fall back header package.

This issue becomes apparent when trying to do a 3-stage bootstrap of llvm 7.0.0 using Xcode 10 on macOS 10.14 as the stage1 compiler fails to configure for the stage2 bootstrap due to the absence of /usr/include and its inability to automatically find that directory in the SDK.

@llvmbot
Copy link
Member Author

llvmbot commented Sep 6, 2018

I've gotten a clarification on how Apple has handled the removal of the SDK from / in Xcode 10 on 10.14. They actually haven't patched the compiler itself in any way. Rather the compiler stub executables in /usr/bin have been modified to call the compilers through the xcrun program which sets the SDKROOT so they can find the system headers through the SDK.
MacPorts currently implements this in their llvm packaging by using compiler wrappers of the form...

#!/bin/bash

if [ -x /usr/bin/xcrun ] ; then
exec /usr/bin/xcrun EXEC_PATH "${@}"
else
exec EXEC_PATH "${@}"

So llvm.org needs to find a way to mimic the Apple Xcode 10 changes by introducing compiler wrappers for the installed compilers on 10.14 and later in order to address the deprecation of system headers in /.

Note that the actual compiler executables in Xcode 10 can't find the buried system headers in the SDK on their own without being called through xcrun.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Endilll Endilll added clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' platform:macos labels Jul 5, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Jul 5, 2024

@llvm/issue-subscribers-clang-driver

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [38845](https://llvm.org/bz38845) | | Version | 7.0 | | OS | MacOS X | | Reporter | LLVM Bugzilla Contributor |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' platform:macos
Projects
None yet
Development

No branches or pull requests

2 participants