swiftlang / swift-corelibs-libdispatch

The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware
swift.org
Apache License 2.0
2.47k stars 461 forks source link

[SR-8925] error when building libdispatch: unsupported compiler #646

Open 6d44b555-049a-4a81-86f1-5537312bcad6 opened 6 years ago

6d44b555-049a-4a81-86f1-5537312bcad6 commented 6 years ago
Previous ID SR-8925
Radar None
Original Reporter @kevints
Type Bug
Environment $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty $ clang --version Ubuntu clang version 3.6.0-2ubuntu1\~trusty2 (tags/RELEASE_360/final) (based on LLVM 3.6.0) Target: x86_64-pc-linux-gnu Thread model: posix
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | libdispatch | |Labels | Bug, CMake, Linux | |Assignee | None | |Priority | Medium | md5: cdb05afb8862e6d925dbe1649eb809c7

Issue Description:

On Ubuntu 14.04 the host compiler recommended to build swift can't build libdispatch. This results in the error below. Presumably we were using the freshly-built toolchain compiler to build dispatch before.

FAILED: /usr/bin/clang  -DDISPATCH_USE_DTRACE=0 -DHAVE_CONFIG_H -D_GNU_SOURCE=1 -Ddispatch_EXPORTS -isystem /code/swift-corelibs-libdispatch/src/BlocksRuntime -I. -I/code/swift-corelibs-libdispatch -I/code/swift-corelibs-libdispatch/src -Isrc -I/code/swift-corelibs-libdispatch/private -fPIC -fvisibility=hidden   -Werror -Wall -Wextra -Warray-bounds-pointer-arithmetic -Wassign-enum -Watomic-properties -Wcomma -Wconditional-uninitialized -Wconversion -Wcovered-switch-default -Wdate-time -Wdeprecated -Wdocumentation -Wdouble-promotion -Wduplicate-enum -Wexpansion-to-defined -Wfloat-equal -Widiomatic-parentheses -Winfinite-recursion -Wmissing-prototypes -Wnewline-eof -Wnullable-to-nonnull-conversion -Wobjc-interface-ivars -Wover-aligned -Wpacked -Wpointer-arith -Wselector -Wshadow -Wshorten-64-to-32 -Wsign-conversion -Wstatic-in-inline -Wsuper-class-method-mismatch -Wswitch-enum -Wunguarded-availability -Wunreachable-code -Wunused -Wno-unknown-warning-option -Wno-trigraphs -Wno-four-char-constants -Wno-disabled-macro-expansion -Wno-pedantic -Wno-bad-function-cast -Wno-c++-compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align -Wno-cast-qual -Wno-documentation-unknown-command -Wno-format-nonliteral -Wno-missing-variable-declarations -Wno-old-style-cast -Wno-padded -Wno-reserved-id-macro -Wno-shift-sign-overflow -Wno-undef -Wno-unreachable-code-aggressive -Wno-unused-macros -Wno-used-but-marked-unused -Wno-vla -Wno-error=assign-enum -fno-exceptions -isystem /usr/include/bsd -DLIBBSD_OVERLAY -fblocks -momit-leaf-frame-pointer -pthread -std=gnu11 -MMD -MT src/CMakeFiles/dispatch.dir/init.c.o -MF src/CMakeFiles/dispatch.dir/init.c.o.d -o src/CMakeFiles/dispatch.dir/init.c.o   -c /code/swift-corelibs-libdispatch/src/init.c
In file included from /code/swift-corelibs-libdispatch/src/init.c:26:
In file included from /code/swift-corelibs-libdispatch/src/internal.h:646:
/code/swift-corelibs-libdispatch/src/shims.h:241:2: error: unsupported compiler
#error unsupported compiler
 ^
1 error generated.
ninja: build stopped: subcommand failed.
6d44b555-049a-4a81-86f1-5537312bcad6 commented 6 years ago

cc @compnerd @belkadan

6d44b555-049a-4a81-86f1-5537312bcad6 commented 6 years ago

This happens in the SourceKit section of the build

6d44b555-049a-4a81-86f1-5537312bcad6 commented 6 years ago

Updating clang to 3.9 fixes the issue: https://github.com/apple/swift/pull/19735

6d44b555-049a-4a81-86f1-5537312bcad6 commented 6 years ago

It looks like CI is now using Clang 7.0.0 to build Swift. Should we document that as the minimum requirement? @belkadan