[cfe-dev] Libtool search path on MacOS

scott constable via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 26 12:37:35 PDT 2017


Sorry, I should have clarified. The C/C++ headers are the ones which cannot
be found. For clarity, here's the output of my tool with the -v flag (I've
hidden some sensitive names with ***):

clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir:
clang Invocation:
 "clang-tool" "-cc1" "-triple" "x86_64-apple-macosx10.12.0"
"-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage"
"-fsyntax-only" "-disable-free" "-disable-llvm-verifier"
"-discard-value-names" "-main-file-name" "AddressOfTest.cpp"
"-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix"
"-mdisable-fp-elim" "-masm-verbose" "-munwind-tables" "-target-cpu"
"penryn" "-target-linker-version" "278.4" "-v" "-dwarf-column-info"
"-debugger-tuning=lldb" "-resource-dir"
"***/build-debug/bin/../lib/clang/4.0.0"
"-c-isystem" "/usr/local/include" "-stdlib=libc++" "-fdeprecated-macro"
"-fdebug-compilation-dir" "***/build-debug" "-ferror-limit" "19"
"-fmessage-length" "95" "-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" "-x" "c++" "test.cpp"
clang -cc1 version 4.0.0 based upon LLVM 4.0.0 default target
x86_64-apple-darwin16.6.0
ignoring nonexistent directory "/***/build-debug/bin/../include/c++/v1"
ignoring nonexistent directory "/usr/include/c++/v1"
ignoring nonexistent directory "***/build-debug/bin/../lib/
clang/4.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.

Both my Xcode clang and my homebrew-installed clang find the headers
through the relative path "../include/c++/v1". This won't be possible with
my libtool unless (a) I move my libtool into the directory where clang is
installed, or (b) I also distribute the C/C++ headers with my libtool. Both
of these solutions is ugly, so I would prefer something nicer.

Thanks,

Scott

On Mon, Jun 26, 2017 at 3:24 PM, Jacob Carlborg via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On 2017-06-26 20:27, scott constable via cfe-dev wrote:
>
> I had already installed Xcode and the command line tools, but I don't
>> see how this would help.
>>
>
> Well, if you don't have Xcode and the command line tools installed there
> wouldn't be a GCC/Clang installation to find (I don't think it would be
> able to find the one in homebrew). But if you already have that installed,
> then unfortunately, I don't know.
>
> Although I'm not sure if you're talking about the C/C++ standard library
> headers or the internal compiler headers. The former should be found in the
> standard include paths, /usr/include. The latter are only search for in the
> relative include path, ../lib/clang/x.y.z/include, in my experience.
>
> In my tool [1] I solved that by embedding the internal headers in the
> executable [2][3].
>
> [1] https://github.com/jacob-carlborg/dstep
>
> [2] https://github.com/jacob-carlborg/dstep/blob/master/clang/
> Compiler.d#L37-L38
>
> [3] https://github.com/jacob-carlborg/dstep/blob/master/clang/
> Compiler.d#L52-L54
>
> --
> /Jacob Carlborg
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170626/71b39f0b/attachment.html>


More information about the cfe-dev mailing list