[llvm-bugs] [Bug 30647] New: clang omits valid c++ search path when -isysroot is set to SDKs in Xcode.app

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 9 05:20:55 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30647

            Bug ID: 30647
           Summary: clang omits valid c++ search path when -isysroot is
                    set to SDKs in Xcode.app
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: howarth.mailing.lists at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The llvm.org clang compiler omits a usable search path for the system c++
headers when the -isysroot option is set to an SDK from Xcode.app. For
example...

$ clang++-4.0 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
-v -c hello.cc 
clang version 4.0.0 (trunk)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /sw/bin
 "/sw/opt/llvm-4.0/bin/clang-4.0" -cc1 -triple x86_64-apple-macosx10.12.0
-Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name hello.cc -mrelocation-model pic -pic-level 2 -mthread-model
posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 274.1 -v -dwarf-column-info -debugger-tuning=lldb
-coverage-notes-file /Users/howarth/hello.gcno -resource-dir
/sw/opt/llvm-4.0/bin/../lib/clang/4.0.0 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
-stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/howarth
-ferror-limit 19 -fmessage-length 161 -stack-protector 1 -fblocks
-fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -o hello.o -x c++ hello.cc
clang -cc1 version 4.0.0 based upon LLVM 4.0.0 default target
x86_64-apple-darwin15.6.0
ignoring nonexistent directory "/sw/opt/llvm-4.0/bin/../include/c++/v1"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /sw/opt/llvm-4.0/bin/../lib/clang/4.0.0/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks
(framework directory)
End of search list.
hello.cc:1:10: fatal error: 'iostream' file not found
#include <iostream>
        ^
1 error generated.

whereas Apple clang-800.0.42 produces...

$ clang++ -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
-v -c hello.cc
Apple LLVM version 8.0.0 (clang-800.0.42)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
-cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name hello.cc
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 274.1
-v -dwarf-column-info -debugger-tuning=lldb -coverage-file
/Users/howarth/hello.cc -resource-dir
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
-stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/howarth
-ferror-limit 19 -fmessage-length 161 -stack-protector 1 -fblocks
-fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -o hello.o -x c++ hello.cc
clang -cc1 version 8.0.0 (clang-800.0.42) default target
x86_64-apple-darwin15.6.0
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/v1"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks
(framework directory)
End of search list.

which produces a valid c++ header search path of...

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1 

compared llvm.org's clang compiler which mangles this path by prefixing an
additional instance of
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
before the valid path of
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
making it unusable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161009/06d6d5e2/attachment.html>


More information about the llvm-bugs mailing list