Gentoo Archives: gentoo-alt

From: Michael Weiser <michael@×××××××××××××××.net>
To: "Han H." <twn@×××××××.com>
Cc: "gentoo-alt@l.g.o" <gentoo-alt@l.g.o>
Subject: Re: [gentoo-alt] Update clang failed (El Captain)
Date: Fri, 02 Sep 2016 16:00:34
Message-Id: 20160902154448.mgcjj7clteuse7eo@weiser.dinsnail.net
In Reply to: [gentoo-alt] Update clang failed (El Captain) by "Han H."
1 Hello Han,
2
3 On Fri, Sep 02, 2016 at 02:49:22PM +0000, Han H. wrote:
4
5 > This might be the relevant error message:
6
7 > 'stdio.h' file not found
8
9 The more interesting message is this one:
10
11 > x86_64-apple-darwin15-clang-3.7: warning: no such sysroot directory: '-mmacosx-version-min=10.5'
12
13 It basically says thath '-mmacosx-version-min=10.5' is passed as
14 parameter to -isysroot which is bogus. Looking at the compiler call for
15 eprintf.c above it:
16
17 > /Users/abc/gentoo/usr/bin/x86_64-apple-darwin15-clang -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/builtins -I/Users/abc/gentoo/var/tmp/portage/sys-devel/llvm-3.8.1/work/llvm-3.8.1.src/projects/compiler-rt/lib/builtins -Iinclude -I/Users/abc/gentoo/var/tmp/portage/sys-devel/llvm-3.8.1/work/llvm-3.8.1.src/include -DNDEBUG -arch i386 -isysroot -mmacosx-version-min=10.5 -arch i386 -fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer -MD -MT projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.eprintf.dir/eprintf.c.o -MF projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.eprintf.dir/eprintf.c.o.d -o projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.eprintf.dir/eprintf.c.o -c /Users/abc/gentoo/var/tmp/portage/sys-devel/llvm-3.8.1/work/llvm-3.8.1.src/projects/compiler-rt/lib/builtins/eprintf.c
18
19 ... you can see that this is actually the case:
20
21 -isysroot -mmacosx-version-min=10.5
22
23 So you'd need to find out why that is the case.
24
25 Grepping for sysroot in llvm-3.8.1.src/projects/compiler-rt and knowing
26 that llvm is nowadays built using cmake on Gentoo I find
27 cmake/config-ix.cmake which has the following interesting code block
28 that might lead to an -isysroot parameter without path:
29
30 # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not
31 # the command line tools. If this is the case, we need to find the OS X
32 # sysroot to pass to clang.
33 if(NOT EXISTS /usr/include)
34 execute_process(COMMAND xcodebuild -version -sdk macosx Path
35 OUTPUT_VARIABLE OSX_SYSROOT
36 ERROR_QUIET
37 OUTPUT_STRIP_TRAILING_WHITESPACE)
38 set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}")
39 endif()
40
41 So to get the obvious out of the way:
42
43 1. Do you have /usr/include
44 2. Do you have the XCode command line tools installed?
45 3. Have you recently upgraded Xcode and possibly forgotten the command
46 line tools so they don't match in version?
47 3. What does xcodebuild -version -sdk macosx Path output?
48
49 Another possiblity is this bit of CMake code in the same file:
50
51 find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx)
52
53 if(DARWIN_osx_SYSROOT)
54 list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT})
55 list(APPEND DARWIN_osx_LINKFLAGS -isysroot ${DARWIN_osx_SYSROOT})
56 endif()
57
58 find_darwin_sdk_dir is defined in ./cmake/Modules/CompilerRTDarwinUtils.cmake
59 and contains a basically identical call to xcodebuild.
60
61 Also, I just noticed that I have llvm-3.8.1-r1 on my box and emerge -atuND
62 @world is offering me a *downgrade* to 3.8.1 which you are trying to install.
63 I've just kicked this off and will let you know if it ran through on my system.
64
65 Yet also, there is an ebuild llvm-3.8.1-r2 and llvm-3.9.0_rc3. Have you tried
66 any of those (-r1, -r2, _rc3)?
67 --
68 tschoe, Michael
69 I like Kaba!