Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

LLVM from sources and "xcrun: error: unrecognized option: --show-sdk-version" #38665

Open Quuxplusone opened 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR39692
Status NEW
Importance P enhancement
Reported by Jeffrey Walton (noloader@gmail.com)
Reported on 2018-11-16 10:14:09 -0800
Last modified on 2018-12-28 10:34:41 -0800
Version 7.0
Hardware Macintosh MacOS X
CC ken.cunningham.webuse@gmail.com, llvm-bugs@lists.llvm.org, mclow.lists@gmail.com, noloader@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
I'm working on an old PowerMac. MacPorts does not provide an updated Clang
compiler. I am trying to build LLVM/Clang from sources. I am bootstrapping the
process with MacPorts GCC 5 compiler (to satisfy the GCC 4.8 minimum).

My build script works fine on Fedora 29 x86_64. On the PowerMac it is having
some trouble. The build script is at https://github.com/noloader/build-llvm .

Here's the first sign of trouble on the PowerMac:

cmake ...

...
-- Performing Test LIBCXX_SUPPORTS_WNO_ERROR_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_ERROR_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_EHSC_FLAG
-- Performing Test LIBCXX_SUPPORTS_EHSC_FLAG - Failed
-- Performing Test LIBCXX_SUPPORTS_FPIC_FLAG
-- Performing Test LIBCXX_SUPPORTS_FPIC_FLAG - Success
xcrun: error: unrecognized option: --show-sdk-version

usage:
xcrun [-verbose] [-no-cache] [-sdk <sdkroot>] [-log] [-run] <utility>
[argument...]
xcrun [-verbose] [-no-cache] [-sdk <sdkroot>] -find <utility>
<tool> [tool arguments ...]
-- Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG
-- Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG - Success
-- Adding Benchmark: algorithms.bench.cpp
-- Adding Benchmark: filesystem.bench.cpp

This seems to work, but I don't know if it is useful to this process:

$ /usr/bin/xcodebuild -version
Xcode 3.1.4
Component versions: DevToolsCore-1204.0; DevToolsSupport-1186.0
BuildVersion: 9M2809
Quuxplusone commented 5 years ago

Jeff, there are a few outstanding show-stoppers to get clang/llvm on PowerMacs.

Some are in the build, and are fairly easy to get around manually (I am running clang-3.8 and clang-5.0 on a PowerMac G5 running Leopard now, and clang-3.8 on a 10.4 PowerMac). Automating them is rather more difficult. I expect that we will need to write our own build scripts for PowerPC Darwin, as incorporating PPC32 Darwin support for compiler_rt in particular back into the main trunk is looking very unlikely to me.

Libcxx / libcxxabi also build and function. Again, not with the default scripts, but with some manual steps. I have the build with libcxx 7.0.1 building with gcc7 on PowerPC Leopard 10.5 at present.

BUT -- aside from these build issues -- there are several real big issues. Some of the PowerPC Darwin 32bit ABI is just plain not implemented in llvm yet https://bugs.llvm.org/show_bug.cgi?id=33108.

Also, there is a major bug in the exception table generation; only basic "catch-all" exceptions will work. Anything with a non-default landing pad either segfaults or just doesn't work https://bugs.llvm.org/show_bug.cgi?id=30866.

These issues all look fixable, but we may need some help with the exception table and ABI implementation. There are very few people with those skills left, and even fewer of them with interest. Iain Sandoe has those skills, but many other projects on his plate.

Despite that, clang-3.8 on PowerPC Darwin 9 passes 98% of the clang test suite when I last ran it about a year ago, and can be used to build many things that gcc can't build.