From a8dd187647d90056e7bb951d3b7fb473ed1e5e5b Mon Sep 17 00:00:00 2001 From: slava86 Date: Mon, 13 Jul 2020 00:32:45 +0300 Subject: [PATCH] build clang --- clang_stack.patch | 12 ++++++++++++ java-11-openjdk.spec | 10 +++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 clang_stack.patch diff --git a/clang_stack.patch b/clang_stack.patch new file mode 100644 index 0000000..3021e44 --- /dev/null +++ b/clang_stack.patch @@ -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 + } diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec index 87fa9a4..9ec59e1 100644 --- a/java-11-openjdk.spec +++ b/java-11-openjdk.spec @@ -1156,13 +1156,13 @@ Patch8: s390-8214206_fix.patch ############################################# # JDK-8247874: Replacement in VersionProps.java.template not working when --with-vendor-bug-url contains '&' Patch9: jdk8247874-fix_ampersand_in_vm_bug_url.patch - +Patch10: clang_stack.patch ############################################# # # JDK 9+ only patches # ############################################# - +BuildRequires: clang BuildRequires: autoconf BuildRequires: automake BuildRequires: binutils @@ -1430,6 +1430,7 @@ pushd %{top_level_dir_name} %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 popd # openjdk %patch1000 @@ -1482,6 +1483,8 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg %build +export CC="clang" +export CXX="clang++" # How many CPU's do we have? export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} @@ -1563,7 +1566,8 @@ bash ../configure \ %ifarch x86_64 --with-jvm-features=zgc \ %endif - --disable-warnings-as-errors + --disable-warnings-as-errors \ + --with-toolchain-type="clang" # Debug builds don't need same targets as release for # build speed-up