Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/clang++/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

Expand Down
2 changes: 2 additions & 0 deletions scripts/clang-format/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

Expand Down
2 changes: 2 additions & 0 deletions scripts/clang-tidy/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

Expand Down
2 changes: 2 additions & 0 deletions scripts/include-what-you-use/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

Expand Down
2 changes: 2 additions & 0 deletions scripts/lldb/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

Expand Down
2 changes: 2 additions & 0 deletions scripts/llvm-cov/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

Expand Down
4 changes: 1 addition & 3 deletions scripts/llvm/6.0.0/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
### llvm v4.x

Development package of llvm git head
For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md
51 changes: 51 additions & 0 deletions scripts/llvm/6.0.0/libcxx.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/src/experimental/filesystem/operations.cpp b/src/experimental/filesystem/operations.cpp
index 2bc28c21d..bd173893c 100644
--- a/src/experimental/filesystem/operations.cpp
+++ b/src/experimental/filesystem/operations.cpp
@@ -21,7 +21,34 @@
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <fcntl.h> /* values for fchmodat */
-#if !defined(UTIME_OMIT)
+
+#if (__APPLE__)
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101300
+#define _LIBCXX_USE_UTIMENSAT
+#endif
+#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110000
+#define _LIBCXX_USE_UTIMENSAT
+#endif
+#elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 110000
+#define _LIBCXX_USE_UTIMENSAT
+#endif
+#elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 40000
+#define _LIBCXX_USE_UTIMENSAT
+#endif
+#endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__
+#else
+// We can use the presence of UTIME_OMIT to detect platforms that provide
+// utimensat.
+#if defined(UTIME_OMIT)
+#define _LIBCXX_USE_UTIMENSAT
+#endif
+#endif // __APPLE__
+
+#if !defined(_LIBCXX_USE_UTIMENSAT)
#include <sys/time.h> // for ::utimes as used in __last_write_time
#endif

@@ -560,9 +587,7 @@ void __last_write_time(const path& p, file_time_type new_time,
using namespace std::chrono;
std::error_code m_ec;

- // We can use the presence of UTIME_OMIT to detect platforms that do not
- // provide utimensat.
-#if !defined(UTIME_OMIT)
+#if !defined(_LIBCXX_USE_UTIMENSAT)
// This implementation has a race condition between determining the
// last access time and attempting to set it to the same value using
// ::utimes
27 changes: 14 additions & 13 deletions scripts/llvm/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# For context on this file see https://github.com/mapbox/mason/blob/master/scripts/llvm/base/README.md

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
# dynamically take name of package from directory
Expand All @@ -9,19 +11,18 @@ MASON_VERSION=$(basename $HERE)
# inherit all functions from llvm base
source ${HERE}/../../${MASON_NAME}/base/common.sh

function setup_base_tools() {
get_llvm_project "http://llvm.org/git/llvm.git" ${MASON_BUILD_PATH}
get_llvm_project "http://llvm.org/git/clang.git" ${MASON_BUILD_PATH}/tools/clang
get_llvm_project "http://llvm.org/git/compiler-rt.git" ${MASON_BUILD_PATH}/projects/compiler-rt
if [[ ${BUILD_AND_LINK_LIBCXX} == true ]]; then
get_llvm_project "http://llvm.org/git/libcxx.git" ${MASON_BUILD_PATH}/projects/libcxx
get_llvm_project "http://llvm.org/git/libcxxabi.git" ${MASON_BUILD_PATH}/projects/libcxxabi
get_llvm_project "http://llvm.org/git/libunwind.git" ${MASON_BUILD_PATH}/projects/libunwind
fi
get_llvm_project "http://llvm.org/git/lld.git" ${MASON_BUILD_PATH}/tools/lld
get_llvm_project "http://llvm.org/git/clang-tools-extra.git" ${MASON_BUILD_PATH}/tools/clang/tools/extra
get_llvm_project "http://llvm.org/git/lldb.git" ${MASON_BUILD_PATH}/tools/lldb
get_llvm_project "https://github.com/include-what-you-use/include-what-you-use.git" ${MASON_BUILD_PATH}/tools/clang/tools/include-what-you-use
# broken with:
# ../tools/clang/tools/include-what-you-use/iwyu_ast_util.cc:455:3: error: use of undeclared identifier 'printTemplateArgumentList'
# function setup_release() {
# get_llvm_project "https://github.com/include-what-you-use/include-what-you-use.git" ${MASON_BUILD_PATH}/tools/clang/tools/include-what-you-use "" 5788b34c2e22fa97630c4a5b1153d828698f9ac1
# }

function setup_release() {
#get_llvm_project "https://github.com/include-what-you-use/include-what-you-use.git" ${MASON_BUILD_PATH}/tools/clang/tools/include-what-you-use "" f1ec249
# FIX 6.0.0 specific libcxx bug: https://github.com/llvm-mirror/libcxx/commit/68b20ca4d9c4bee2c2ad5a9240599b3e4b78d0ba
# This will need to be removed in upcoming releases
(cd ${MASON_BUILD_PATH}/projects/libcxx &&
patch -N -p1 < ${MASON_DIR}/scripts/${MASON_NAME}/${MASON_VERSION}/libcxx.diff)
}

mason_run "$@"
21 changes: 5 additions & 16 deletions scripts/llvm/base/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,6 @@ function mason_prepare_compile {
}

function mason_compile {
if [[ $(uname -s) == 'Darwin' ]]; then
# ensure codesigning is working before starting
# this logic borrowed from homebrew llvm.rb formula
TMPDIR=$(mktemp -d)
(cd $TMPDIR && \
cp /usr/bin/false llvm_check && \
RESULT=0 &&
/usr/bin/codesign -f -s lldb_codesign --dryrun llvm_check || RESULT=$? &&
if [[ ${RESULT} != 0 ]]; then
echo "lldb_codesign identity must be available to build with LLDB."
echo "See: https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt"
exit 1
fi
)
fi

export CXX="${CUSTOM_CXX:-${MASON_CLANG}/bin/clang++}"
export CC="${CUSTOM_CC:-${MASON_CLANG}/bin/clang}"
echo "using CXX=${CXX}"
Expand All @@ -187,6 +171,11 @@ function mason_compile {

CMAKE_EXTRA_ARGS=""

if [[ $(uname -s) == 'Darwin' ]]; then
# don't require codesigning for macOS
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DLLDB_CODESIGN_IDENTITY=''"
fi

if [[ ${MAJOR_MINOR} == "3.8" ]]; then
# workaround https://llvm.org/bugs/show_bug.cgi?id=25565
perl -i -p -e "s/set\(codegen_deps intrinsics_gen\)/set\(codegen_deps intrinsics_gen attributes_inc\)/g;" lib/CodeGen/CMakeLists.txt
Expand Down
4 changes: 2 additions & 2 deletions utils/llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ function create() {
echo "ERROR: please provide first arg of new version"
exit 1
fi
if [[ -d ./scripts/llvm/${1} ]]; then
if [[ -d ./scripts/llvm/${1} ]] && [[ ${FORCE_LLVM_OVERWRITE:-false} != 1 ]]; then
usage
echo
echo
echo "ERROR: first arg must point to a version of llvm that does not exist"
echo "ERROR: first arg must point to a version of llvm that does not exist (or pass 'FORCE_LLVM_OVERWRITE=1 ./utils/llvm.sh create'"
exit 1
fi
if [[ ! -d ./scripts/llvm/${2} ]]; then
Expand Down