clang ToT doesn't build on macOS 10.10 anymore...?

Hi all,

I just tried updating my clang build on a few machines, and it built fine on 10.11, but on a macOS 10.10 with AppleClang 7.0.2.7000181 I get this:

/Users/builder/llvm/llvm/projects/compiler-rt/lib/builtins/adddf3.c:28:53: error: alias unsupported on this file format
AEABI_RTABI double __aeabi_dadd(double a, double b) COMPILER_RT_ALIAS(__adddf3);
                                                    ^
/Users/builder/llvm/llvm/projects/compiler-rt/lib/builtins/int_lib.h:29:36: note: expanded from macro 'COMPILER_RT_ALIAS'
#define COMPILER_RT_ALIAS(aliasee) _Pragma("GCC error(\"alias unsupported on this file format\")")
                                   ^
<scratch space>:89:6: note: expanded from here
GCC error("alias unsupported on this file format")
     ^

Should this build? Is 10.10 supported?

Thanks,

Sean

I just ran into the same thing :-/

CC'ing ahatanak and efriedma

So I bisected where building on macOS 10.10 broke, and found at least 2 commits that introduced errors:

Wasn’t the NOESCAPE error fixed in r321543?

https://reviews.llvm.org/D41601

Akira,

Yes, it seems so. If I try to build r321543 I don't get the DISPATCH_NOESCAPE error, but do still get the adddf3.c error.

Sean

What target triple are you compiling for? Targets which define "__ARM_EABI__" should also define "__ELF__", as far as I know.

-Eli

Eli,

I don't believe I'm specifying any target triple (I confess I don't exactly know what that is). I'm just doing a vanilla cmake & make on macOS 10.10 using Xcode 7.2.1's compiler & SDK. No cross compiling. Searching cmake's output for "triple" reveals this though: x86_64-apple-darwin14.5.0

One new data point: if I manually apply Akira's DISPATCH_NOESCAPE fix to r314850, that builds; but r314851 does not.

Sean

Can you get the exact command-line for the failing command? (With make, you should be able to get that with "make VERBOSE=1", I think.)

-Eli

(for ninja, pass -v to ninja)

From off-list, got the compiler invocation. It looks like it's invoking clang from Xcode, and that clang has a bug where it incorrectly defines __ARM_EABI__ for -arch armv7em. (Not sure off the top of my head how old AppleClang 7 is.)

Should work if you build using a more recent version of clang. Or maybe you can work around the problem by commenting out the call to darwin_add_embedded_builtin_libraries() in compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake .

-Eli

From off-list, got the compiler invocation. It looks like it's
invoking clang from Xcode, and that clang has a bug where it incorrectly
defines __ARM_EABI__ for -arch armv7em. (Not sure off the top of my
head how old AppleClang 7 is.)

Xcode 7.2.1 was released February 3, 2016. Not so old. It's the last/newest Xcode that supports running on OS X 10.10.

Should work if you build using a more recent version of clang.

I suppose one could get a clang/gcc from "somewhere" to bootstap clang ToT. But really my point is that using Xcode is the easiest way, and if the newest Xcode for that OS isn't supported, it's a much bigger pain. :frowning:

Or maybe
you can work around the problem by commenting out the call to
darwin_add_embedded_builtin_libraries() in
compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake .

Confirmed. I can build r314851 if I comment out that line.

Cheers,

Sean