Skip to content
Permalink
Browse files

llvm/clang/lldb-devel: bump to 20200512

tweak compiler blacklisting
tweak features enabled based on build success
add patch for missing defines needed on some systems
tweak patches as needed
  • Loading branch information
kencu committed May 15, 2020
1 parent 681733c commit f0069725f4a85506a601787daf92e328db7542ae
@@ -9,10 +9,15 @@ PortGroup legacysupport 1.0
# link legacysupport statically for compilers
legacysupport.use_static yes

# limit legacysupport to 10.9 for now
# test on 10.10 to see what happens there
# on 10.11 there is a collision with getattrlistat (that has been fixed in legacysupportdevel)
legacysupport.newest_darwin_requires_legacy 13

# for devel
PortGroup github 1.0
set llvm-commit 6d6d48add8a8fcfbc311648a1d6b1ccc6e1e8b26
set date 20200505
set llvm-commit d9166ad272847e246799afbb5e0c71874f83aa12
set date 20200512
set llvm_version devel

# for release
@@ -24,9 +29,9 @@ set lldb_executable_version 11

github.setup llvm llvm-project ${llvm-commit}

checksums rmd160 b148e3ea84e63534ffac75bbe031d8343b65e55d \
sha256 f24a6c752717a57c11d8323dbf2cd869a436e64070cf8c8e84deee7d4fb62787 \
size 118617893
checksums rmd160 c23afe6f2b423a27037afed49ac0335de3bc20c7 \
sha256 a51f6ade9627cef7937b7d62a782f4ce6c3bc30b9973fa03c1aa9628c4e68acd \
size 118871523

# for release, use ${llvm_version}
# version ${llvm_version}
@@ -109,7 +114,7 @@ post-extract {
file rename ${workpath}/llvm-project/clang ${worksrcpath}/tools/clang
file rename ${workpath}/llvm-project/compiler-rt ${worksrcpath}/projects/compiler-rt
file rename ${workpath}/llvm-project/libcxx ${worksrcpath}/projects/libcxx
file rename ${workpath}/llvm-project/libcxxabi ${worksrcpath}/projects/libcxxabi
file rename ${workpath}/llvm-project/libcxxabi ${worksrcpath}/projects/libcxxabi
file rename ${workpath}/llvm-project/clang-tools-extra ${worksrcpath}/tools/clang/tools/extra
} elseif {${subport} eq "lldb-${llvm_version}"} {
file rename ${workpath}/llvm-project/clang ${worksrcpath}/tools/clang
@@ -122,11 +127,9 @@ patchfiles \
0002-Define-EXC_MASK_CRASH-and-MACH_EXCEPTION_CODES-if-th.patch \
0003-MacPorts-Only-Don-t-embed-the-deployment-target-in-t.patch \
0005-Threading-Only-call-pthread_setname_np-on-SnowLeopar.patch \
0006-Only-call-setpriority-PRIO_DARWIN_THREAD-0-PRIO_DARW.patch

patchfiles-append \
5000-patch-llvm8-tools-dsymutil-symbolmap-use-older-cfname-and-fix-uuid-on-leopard.diff \
5000-patch-lib-support-unix-path-copyfileclone-on-older-systems.diff
0006-Only-call-setpriority-PRIO_DARWIN_THREAD-0-PRIO_DARW.patch \
0007-patch-llvm8-tools-dsymutil-symbolmap-use-older-cfname-and-fix-uuid-on-leopard.diff \
0008-patch-lib-support-unix-path-copyfileclone-on-older-systems.diff

if {${subport} eq "clang-${llvm_version}"} {
patchfiles-append \
@@ -136,6 +139,8 @@ if {${subport} eq "clang-${llvm_version}"} {
1004-Default-to-fragile-ObjC-runtime-when-targeting-darwi.patch \
1005-Fixup-libstdc-header-search-paths-for-older-versions.patch \
1007-Fix-float.h-to-work-on-Snow-Leopard-and-earlier.patch \
1008-compilerrt-fuzzer-missingdefs.diff \
1009-compilerrt-sanitizer-missingdefs.diff \
2002-Work-around-no-libdispatch-on-10.6.patch \
3001-Fix-missing-long-long-math-prototypes-when-using-the.patch \
3002-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch \
@@ -212,7 +217,7 @@ if {${subport} eq "llvm-${llvm_version}"} {

configure.args-append \
-DLLDB_CODESIGN_IDENTITY=- \
-DCLANG_ENABLE_ARCMT=OFF \
-DLLDB_ENABLE_LUA=OFF \
-DCLANG_INCLUDE_TESTS=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
-DCLANG_ENABLE_ARCMT=OFF \
@@ -221,11 +226,12 @@ if {${subport} eq "llvm-${llvm_version}"} {
-DLIBCXX_INSTALL_LIBRARY=OFF
}

# not building with macports-clang up to 3.7 or xcode clang up to 800.0.42.1
# not building with macports-clang up to 3.7
# error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
# ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
# ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiler.blacklist *gcc* {clang < 801} macports-clang-3.*
# clang-1000.11.45.5 gives missing symbols for ZTIDu and others during libcxxabi build
compiler.blacklist *gcc* {clang < 1001} macports-clang-3.*

# Override the normal compiler fallback list entirely since we have
# such specific requirements.
@@ -266,18 +272,31 @@ platform darwin {

if {${subport} eq "clang-${llvm_version}"} {

if {${os.major} <= 13} {
# xpc.h available 10.10 https://developer.apple.com/documentation/xpc?language=objc
# toggle enabled in https://reviews.llvm.org/D59808
configure.args-append -DCLANGD_BUILD_XPC=OFF
if {${os.major} == 14} {
# Building Xray forces build of sanitizer_common, even if
# COMPILER_RT_BUILD_SANITIZERS=OFF, and this fails on 10.10
# TODO: See why sanitizer_common fails on 10.10
configure.args-append -DCOMPILER_RT_BUILD_XRAY=OFF
}

if {${os.major} <= 13} {
if {${os.major} <= 14} {
# We unfortunately don't have an option to just turn off tsan
# https://llvm.org/bugs/show_bug.cgi?id=27715
configure.args-append -DCOMPILER_RT_BUILD_SANITIZERS=OFF
}

if {${os.major} <= 10} {
# needs thread_local_storage enabled
require_active_variants port:libcxx emulated_tls
}

if {${os.major} <= 11} {
# xpc.h available 10.7 but doesn't support nullable features
# xpc.h works currently on 10.8+
# toggle enabled in https://reviews.llvm.org/D59808
configure.args-append -DCLANGD_BUILD_XPC=OFF
}

if {${os.major} <= 10} {
# the directorywatcher code is currently 10.7+
patchfiles-append 5003-patch-no-directory-watcher-on-snowleopard.diff
@@ -302,10 +321,8 @@ pre-fetch {
depends_run
archive_sites
known_fail yes
pre-fetch {
ui_error "${subport} is not supported on this os version at present."
return -code error {unsupported platform}
}
ui_error "${subport} is not supported on this os version at present."
return -code error {unsupported platform}
}
}
}
@@ -32,8 +32,8 @@ index 3ba0abefc9..d67e3733bd 100755
+++ macports_master/tools/clang/tools/clang-format/clang-format-diff.py
@@ -58,7 +58,7 @@ def main():
parser.add_argument('-style',
help='formatting style to apply (LLVM, Google, Chromium, '
'Mozilla, WebKit)')
help='formatting style to apply (LLVM, GNU, Google, Chromium, '
'Microsoft, Mozilla, WebKit)')
- parser.add_argument('-binary', default='clang-format',
+ parser.add_argument('-binary', default='@CLANG_FORMAT_PATH@',
help='location of binary to use for clang-format')
@@ -0,0 +1,17 @@
--- llvm/projects/compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp.orig 2020-05-14 15:23:11.000000000 -0700
+++ llvm/projects/compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp 2020-05-14 15:31:23.000000000 -0700
@@ -19,6 +19,14 @@
#include <sys/wait.h>
#include <unistd.h>

+// add definition missing on older systems
+#ifndef POSIX_SPAWN_SETSIGMASK
+#define POSIX_SPAWN_SETSIGMASK 0x0008
+#endif
+#ifndef POSIX_SPAWN_SETSIGDEF
+#define POSIX_SPAWN_SETSIGDEF 0x0004
+#endif
+
// There is no header for this on macOS so declare here
extern "C" char **environ;

@@ -0,0 +1,14 @@
--- llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp.orig 2020-05-14 15:13:45.000000000 -0700
+++ llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp 2020-05-14 15:17:03.000000000 -0700
@@ -111,6 +111,11 @@
#define VM_MEMORY_SANITIZER 99
#endif

+// From <sys/spawn.h> but not in some SDKs
+#ifndef POSIX_SPAWN_CLOEXEC_DEFAULT
+#define POSIX_SPAWN_CLOEXEC_DEFAULT 0x4000
+#endif
+
// XNU on Darwin provides a mmap flag that optimizes allocation/deallocation of
// giant memory regions (i.e. shadow memory regions).
#define kXnuFastMmapFd 0x4

0 comments on commit f006972

Please sign in to comment.
You can’t perform that action at this time.