build clang

This commit is contained in:
slava86 2020-07-13 00:32:45 +03:00
parent 7c79585c9c
commit a8dd187647
2 changed files with 19 additions and 3 deletions

12
clang_stack.patch Normal file
View file

@ -0,0 +1,12 @@
diff -urN openjdk/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp openjdk-diff/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
--- openjdk/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp 2020-06-10 19:44:52.000000000 +0000
+++ openjdk-diff/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp 2020-07-12 21:26:42.912877532 +0000
@@ -825,7 +825,7 @@
#ifndef PRODUCT
void os::verify_stack_alignment() {
-#ifdef AMD64
+#if defined(AMD64) && ! defined(__clang__)
assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
#endif
}

View file

@ -1156,13 +1156,13 @@ Patch8: s390-8214206_fix.patch
############################################# #############################################
# JDK-8247874: Replacement in VersionProps.java.template not working when --with-vendor-bug-url contains '&' # JDK-8247874: Replacement in VersionProps.java.template not working when --with-vendor-bug-url contains '&'
Patch9: jdk8247874-fix_ampersand_in_vm_bug_url.patch Patch9: jdk8247874-fix_ampersand_in_vm_bug_url.patch
Patch10: clang_stack.patch
############################################# #############################################
# #
# JDK 9+ only patches # JDK 9+ only patches
# #
############################################# #############################################
BuildRequires: clang
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: binutils BuildRequires: binutils
@ -1430,6 +1430,7 @@ pushd %{top_level_dir_name}
%patch7 -p1 %patch7 -p1
%patch8 -p1 %patch8 -p1
%patch9 -p1 %patch9 -p1
%patch10 -p1
popd # openjdk popd # openjdk
%patch1000 %patch1000
@ -1482,6 +1483,8 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg
%build %build
export CC="clang"
export CXX="clang++"
# How many CPU's do we have? # How many CPU's do we have?
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
export NUM_PROC=${NUM_PROC:-1} export NUM_PROC=${NUM_PROC:-1}
@ -1563,7 +1566,8 @@ bash ../configure \
%ifarch x86_64 %ifarch x86_64
--with-jvm-features=zgc \ --with-jvm-features=zgc \
%endif %endif
--disable-warnings-as-errors --disable-warnings-as-errors \
--with-toolchain-type="clang"
# Debug builds don't need same targets as release for # Debug builds don't need same targets as release for
# build speed-up # build speed-up