[java-1.7.0-openjdk/f17] Unified spec file for x86, x86_64, ARM and s390 - Integrated changes from Dan Horák <dhorak at redhat

Deepak Bhole dbhole at fedoraproject.org
Mon Mar 12 20:26:18 UTC 2012


commit 9d475db9ef0cbec04e60f28c773efb3fa70cbb08
Author: Deepak Bhole <dbhole at redhat.com>
Date:   Mon Mar 12 16:18:09 2012 -0400

    Unified spec file for x86, x86_64, ARM and s390
     - Integrated changes from Dan Horák <dhorak at redhat.com> for Zero/s390
     - Integrated changes from Chris Phillips <chphilli at redhat.com> for Zero/ARM

 java-1.7.0-openjdk-arm-fixes.patch |   44 +++++++
 java-1.7.0-openjdk-arm-ftbfs.patch |  220 +++++++++++++++++++++++++++++++++
 java-1.7.0-openjdk-bitmap.patch    |   47 +++++++
 java-1.7.0-openjdk-size_t.patch    |  239 ++++++++++++++++++++++++++++++++++++
 java-1.7.0-openjdk.spec            |   72 ++++++++++-
 5 files changed, 616 insertions(+), 6 deletions(-)
---
diff --git a/java-1.7.0-openjdk-arm-fixes.patch b/java-1.7.0-openjdk-arm-fixes.patch
new file mode 100644
index 0000000..47f28dc
--- /dev/null
+++ b/java-1.7.0-openjdk-arm-fixes.patch
@@ -0,0 +1,44 @@
+diff -up openjdk/jdk/make/common/shared/Sanity.gmk.sav openjdk/jdk/make/common/shared/Sanity.gmk
+--- openjdk/jdk/make/common/shared/Sanity.gmk.sav	2012-02-14 16:12:48.000000000 -0500
++++ openjdk/jdk/make/common/shared/Sanity.gmk	2012-03-07 17:31:26.153840755 -0500
+@@ -814,12 +814,12 @@ ifdef OPENJDK
+ 	@(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
+ 	    $(ECHO) "Failed to build freetypecheck." ) > $@
+ 
+-    sane-freetype: $(TEMPDIR)/freetypeinfo
+-	@if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
+-	  $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
+-	          " or higher is required. \n" \
+-		  "`$(CAT) $<`  \n" >> $(ERROR_FILE) ; \
+-	fi
++#    sane-freetype: $(TEMPDIR)/freetypeinfo
++#	@if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
++#	  $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
++#	          " or higher is required. \n" \
++#		  "`$(CAT) $<`  \n" >> $(ERROR_FILE) ; \
++#	fi
+   else
+     #do nothing  (cross-compiling)
+     sane-freetype: 
+diff -up openjdk/jdk/make/jdk_generic_profile.sh.sav openjdk/jdk/make/jdk_generic_profile.sh
+--- openjdk/jdk/make/jdk_generic_profile.sh.sav	2012-02-14 16:12:48.000000000 -0500
++++ openjdk/jdk/make/jdk_generic_profile.sh	2012-03-07 17:31:26.154840740 -0500
+@@ -280,7 +280,7 @@ if [ "${ZERO_BUILD}" = true ] ; then
+ 
+   # ZERO_ENDIANNESS is the endianness of the processor
+   case "${ZERO_LIBARCH}" in
+-    i386|amd64|ia64)
++    i386|amd64|ia64|arm)
+       ZERO_ENDIANNESS=little
+       ;;
+     ppc*|s390*|sparc*|alpha)
+@@ -307,6 +307,9 @@ if [ "${ZERO_BUILD}" = true ] ; then
+     s390)
+       ZERO_ARCHFLAG="-m31"
+       ;;
++    arm)
++      ZERO_ARCHFLAG="-D_LITTLE_ENDIAN"
++      ;;
+     *)
+       ZERO_ARCHFLAG="-m${ARCH_DATA_MODEL}"
+   esac
diff --git a/java-1.7.0-openjdk-arm-ftbfs.patch b/java-1.7.0-openjdk-arm-ftbfs.patch
new file mode 100644
index 0000000..928125a
--- /dev/null
+++ b/java-1.7.0-openjdk-arm-ftbfs.patch
@@ -0,0 +1,220 @@
+diff -up openjdk/hotspot/make/linux/makefiles/defs.make.sav openjdk/hotspot/make/linux/makefiles/defs.make
+--- openjdk/hotspot/make/linux/makefiles/defs.make.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/make/linux/makefiles/defs.make	2012-03-08 10:39:44.567935704 -0500
+@@ -184,8 +184,10 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platfo
+ 
+ # client and server subdirectories have symbolic links to ../libjsig.so
+ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
+-ifneq ($(OBJCOPY),)
+-  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
++ifneq ($(ZERO_BUILD), true)
++  ifneq ($(OBJCOPY),)
++    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
++  endif
+ endif
+ 
+ EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
+@@ -194,8 +196,10 @@ EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARC
+ ifndef BUILD_CLIENT_ONLY
+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
+-  ifneq ($(OBJCOPY),)
+-    EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
++  ifneq ($(ZERO_BUILD), true)
++    ifneq ($(OBJCOPY),)
++      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
++    endif
+   endif
+ endif
+ 
+@@ -215,9 +219,11 @@ ADD_SA_BINARIES/x86   = $(EXPORT_JRE_LIB
+                         $(EXPORT_LIB_DIR)/sa-jdi.jar 
+ ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
+                         $(EXPORT_LIB_DIR)/sa-jdi.jar 
+-ifneq ($(OBJCOPY),)
+-  ADD_SA_BINARIES/x86   += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
+-  ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
++ifneq ($(ZERO_BUILD), true)
++  ifneq ($(OBJCOPY),)
++    ADD_SA_BINARIES/x86   += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
++    ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
++  endif
+ endif
+ ADD_SA_BINARIES/ppc   = 
+ ADD_SA_BINARIES/ia64  = 
+diff -up openjdk/hotspot/make/linux/platform_zero.in.sav openjdk/hotspot/make/linux/platform_zero.in
+--- openjdk/hotspot/make/linux/platform_zero.in.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/make/linux/platform_zero.in	2012-03-08 10:39:44.567935704 -0500
+@@ -14,4 +14,4 @@ compiler = gcc
+ 
+ gnu_dis_arch = zero
+ 
+-sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -D at ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\"
++sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -DTARGET_ARCH_NYI_6939861=1 -D at ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\"
+diff -up openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp.sav openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp
+--- openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp	2012-03-08 10:39:44.567935704 -0500
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2011 Red Hat, Inc.
++ * Copyright 2011, 2012 Red Hat, Inc.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -29,7 +29,6 @@ enum /* platform_dependent_constants */
+   adapter_code_size = 0
+ };
+ 
+-#define TARGET_ARCH_NYI_6939861 
+ // ..#ifdef TARGET_ARCH_NYI_6939861
+ // ..  // Here are some backward compatible declarations until the 6939861 ports are updated.
+ // ..  #define _adapter_flyby    (_EK_LIMIT + 10)
+@@ -69,3 +68,19 @@ enum /* platform_dependent_constants */
+ // ..
+ // ..  static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
+ // ..#endif //TARGET_ARCH_NYI_6939861
++
++class RicochetFrame : public ResourceObj {
++  friend class MethodHandles;
++ private:
++  /*
++    RF field            x86                 SPARC
++    sender_pc           *(rsp+0)            I7-0x8
++    sender_link         rbp                 I6+BIAS
++    exact_sender_sp     rsi/r13             I5_savedSP
++    conversion          *(rcx+&amh_conv)    L5_conv
++    saved_args_base     rax                 L4_sab (cf. Gargs = G4)
++    saved_args_layout   #NULL               L3_sal
++    saved_target        *(rcx+&mh_vmtgt)    L2_stgt
++    continuation        #STUB_CON           L1_cont
++   */
++};
+diff -up openjdk/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp.sav openjdk/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp
+--- openjdk/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp	2012-03-08 10:39:44.567935704 -0500
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
++ * Copyright 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -47,6 +47,7 @@
+ #endif
+ 
+ 
++
+ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
+                                            VMRegPair *regs,
+                                            int total_args_passed,
+@@ -96,19 +97,21 @@ uint SharedRuntime::out_preserve_stack_s
+   ShouldNotCallThis();
+ }
+ 
++JRT_LEAF(void, zero_stub())
++  ShouldNotCallThis();
++JRT_END
++
++
+ static RuntimeStub* generate_empty_runtime_stub(const char* name) {
+-  CodeBuffer buffer(name, 0, 0);
+-  return RuntimeStub::new_runtime_stub(name, &buffer, 0, 0, NULL, false);
++  return CAST_FROM_FN_PTR(RuntimeStub*,zero_stub);
+ }
+ 
+ static SafepointBlob* generate_empty_safepoint_blob() {
+-  CodeBuffer buffer("handler_blob", 0, 0);
+-  return SafepointBlob::create(&buffer, NULL, 0);
++  return NULL;
+ }
+ 
+ static DeoptimizationBlob* generate_empty_deopt_blob() {
+-  CodeBuffer buffer("handler_blob", 0, 0);
+-  return DeoptimizationBlob::create(&buffer, NULL, 0, 0, 0, 0);
++  return NULL;
+ }
+ 
+ void SharedRuntime::generate_deopt_blob() {
+@@ -123,6 +126,7 @@ RuntimeStub* SharedRuntime::generate_res
+   return generate_empty_runtime_stub("resolve_blob");
+ }
+ 
++
+ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
+                                          VMRegPair *regs,
+                                          int total_args_passed) {
+diff -up openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp.sav openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
+--- openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp	2012-03-08 10:39:44.568935688 -0500
+@@ -818,10 +818,10 @@ static inline uint64_t cast_uint64_t(siz
+   /* CodeBlobs (NOTE: incomplete, but only a little) */                                                                              \
+   /***************************************************/                                                                              \
+                                                                                                                                      \
+-  X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _sender_pc,                                     address))                   \
+-  X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _exact_sender_sp,                              intptr_t*))                  \
+-  X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _sender_link,                                  intptr_t*))                  \
+-  X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _saved_args_base,                              intptr_t*))                  \
++  NOT_ZERO(X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _sender_pc,                                     address)))                   \
++  NOT_ZERO(X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _exact_sender_sp,                              intptr_t*)))                  \
++  NOT_ZERO(X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _sender_link,                                  intptr_t*)))                  \
++  NOT_ZERO(X86_ONLY(nonstatic_field(MethodHandles::RicochetFrame, _saved_args_base,                              intptr_t*)))                  \
+                                                                                                                                      \
+      static_field(SharedRuntime,               _ricochet_blob,                                RicochetBlob*)                         \
+                                                                                                                                      \
+@@ -2526,7 +2526,7 @@ static inline uint64_t cast_uint64_t(siz
+   /* frame              */                                                \
+   /**********************/                                                \
+                                                                           \
+-  X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset))      \
++  NOT_ZERO(X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset)))      \
+   declare_constant(frame::pc_return_offset)                               \
+                                                                           \
+   /*************/                                                         \
+diff -up openjdk/hotspot/src/share/vm/shark/sharkCompiler.cpp.sav openjdk/hotspot/src/share/vm/shark/sharkCompiler.cpp
+--- openjdk/hotspot/src/share/vm/shark/sharkCompiler.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/shark/sharkCompiler.cpp	2012-03-08 10:39:44.568935688 -0500
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2008, 2009, 2010, 2011 Red Hat, Inc.
++ * Copyright 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -319,7 +319,7 @@ void SharkCompiler::free_compiled_method
+   // finish with the exception of the VM thread, so we can consider
+   // ourself the owner of the execution engine lock even though we
+   // can't actually acquire it at this time.
+-  assert(Thread::current()->is_VM_thread(), "must be called by VM thread");
++  assert(JavaThread::current()->thread_state() == _thread_in_vm, "must run in vm mode");
+   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+ 
+   SharkEntry *entry = (SharkEntry *) code;
+diff -up openjdk/hotspot/src/share/vm/utilities/macros.hpp.sav openjdk/hotspot/src/share/vm/utilities/macros.hpp
+--- openjdk/hotspot/src/share/vm/utilities/macros.hpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/utilities/macros.hpp	2012-03-08 10:39:44.569935671 -0500
+@@ -169,6 +169,22 @@
+ #define NOT_WIN64(code) code
+ #endif
+ 
++#if defined(ZERO)
++#define ZERO_ONLY(code) code
++#define NOT_ZERO(code)
++#else
++#define ZERO_ONLY(code) 
++#define NOT_ZERO(code) code
++#endif
++
++#if defined(SHARK)
++#define SHARK_ONLY(code) code
++#define NOT_SHARK(code)
++#else
++#define SHARK_ONLY(code) 
++#define NOT_SHARK(code) code
++#endif
++
+ #if defined(IA32) || defined(AMD64)
+ #define X86
+ #define X86_ONLY(code) code
diff --git a/java-1.7.0-openjdk-bitmap.patch b/java-1.7.0-openjdk-bitmap.patch
new file mode 100644
index 0000000..3f7de26
--- /dev/null
+++ b/java-1.7.0-openjdk-bitmap.patch
@@ -0,0 +1,47 @@
+diff -up openjdk/hotspot/src/share/vm/utilities/bitMap.inline.hpp.s390 openjdk/hotspot/src/share/vm/utilities/bitMap.inline.hpp
+--- openjdk/hotspot/src/share/vm/utilities/bitMap.inline.hpp.s390	2012-02-10 08:30:46.378435291 -0500
++++ openjdk/hotspot/src/share/vm/utilities/bitMap.inline.hpp	2012-02-10 08:47:27.478427892 -0500
+@@ -52,16 +52,16 @@ inline void BitMap::clear_bit(idx_t bit)
+ 
+ inline bool BitMap::par_set_bit(idx_t bit) {
+   verify_index(bit);
+-  volatile idx_t* const addr = word_addr(bit);
+-  const idx_t mask = bit_mask(bit);
+-  idx_t old_val = *addr;
++  volatile bm_word_t* const addr = word_addr(bit);
++  const bm_word_t mask = bit_mask(bit);
++  bm_word_t old_val = *addr;
+ 
+   do {
+-    const idx_t new_val = old_val | mask;
++    const bm_word_t new_val = old_val | mask;
+     if (new_val == old_val) {
+       return false;     // Someone else beat us to it.
+     }
+-    const idx_t cur_val = (idx_t) Atomic::cmpxchg_ptr((void*) new_val,
++    const bm_word_t cur_val = (bm_word_t) Atomic::cmpxchg_ptr((void*) new_val,
+                                                       (volatile void*) addr,
+                                                       (void*) old_val);
+     if (cur_val == old_val) {
+@@ -73,16 +73,16 @@ inline bool BitMap::par_set_bit(idx_t bi
+ 
+ inline bool BitMap::par_clear_bit(idx_t bit) {
+   verify_index(bit);
+-  volatile idx_t* const addr = word_addr(bit);
+-  const idx_t mask = ~bit_mask(bit);
+-  idx_t old_val = *addr;
++  volatile bm_word_t* const addr = word_addr(bit);
++  const bm_word_t mask = ~bit_mask(bit);
++  bm_word_t old_val = *addr;
+ 
+   do {
+-    const idx_t new_val = old_val & mask;
++    const bm_word_t new_val = old_val & mask;
+     if (new_val == old_val) {
+       return false;     // Someone else beat us to it.
+     }
+-    const idx_t cur_val = (idx_t) Atomic::cmpxchg_ptr((void*) new_val,
++    const bm_word_t cur_val = (bm_word_t) Atomic::cmpxchg_ptr((void*) new_val,
+                                                       (volatile void*) addr,
+                                                       (void*) old_val);
+     if (cur_val == old_val) {
diff --git a/java-1.7.0-openjdk-size_t.patch b/java-1.7.0-openjdk-size_t.patch
new file mode 100644
index 0000000..f9bfc20
--- /dev/null
+++ b/java-1.7.0-openjdk-size_t.patch
@@ -0,0 +1,239 @@
+diff -up openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp.sav openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp
+--- openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp	2012-03-09 14:48:08.223867826 -0500
+@@ -572,15 +572,15 @@ void MethodLiveness::print_times() {
+ 
+ 
+ MethodLiveness::BasicBlock::BasicBlock(MethodLiveness *analyzer, int start, int limit) :
+-         _gen((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _gen((BitMap::bm_word_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _kill((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _kill((BitMap::bm_word_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _entry((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _entry((BitMap::bm_word_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _normal_exit((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _normal_exit((BitMap::bm_word_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _exception_exit((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _exception_exit((BitMap::bm_word_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+          _last_bci(-1) {
+   _analyzer = analyzer;
+@@ -998,7 +998,7 @@ bool MethodLiveness::BasicBlock::merge_e
+ }
+ 
+ MethodLivenessResult MethodLiveness::BasicBlock::get_liveness_at(ciMethod* method, int bci) {
+-  MethodLivenessResult answer(NEW_RESOURCE_ARRAY(size_t, _analyzer->bit_map_size_words()),
++  MethodLivenessResult answer(NEW_RESOURCE_ARRAY(BitMap::bm_word_t, _analyzer->bit_map_size_words()),
+                 _analyzer->bit_map_size_bits());
+   answer.set_is_valid();
+ 
+diff -up openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp.sav openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	2012-03-09 14:48:08.223867826 -0500
+@@ -2656,7 +2656,7 @@ void CFLS_LAB::get_from_global_pool(size
+   if (ResizeOldPLAB && CMSOldPLABResizeQuicker) {
+     size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks);
+     n_blks +=  CMSOldPLABReactivityFactor*multiple*n_blks;
+-    n_blks = MIN2(n_blks, CMSOldPLABMax);
++    n_blks = MIN2(n_blks, (size_t)CMSOldPLABMax);
+   }
+   assert(n_blks > 0, "Error");
+   _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl);
+diff -up openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp.sav openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	2012-03-09 16:30:30.426921691 -0500
+@@ -481,7 +481,7 @@ ConcurrentMark::ConcurrentMark(ReservedS
+   _regionStack(),
+   // _finger set in set_non_marking_state
+ 
+-  _max_task_num(MAX2(ParallelGCThreads, (size_t)1)),
++  _max_task_num(MAX2((size_t)ParallelGCThreads, (size_t)1)),
+   // _active_tasks set in set_non_marking_state
+   // _tasks set inside the constructor
+   _task_queues(new CMTaskQueueSet((int) _max_task_num)),
+@@ -586,7 +586,7 @@ ConcurrentMark::ConcurrentMark(ReservedS
+       _sleep_factor             = sleep_factor;
+       _marking_task_overhead    = marking_task_overhead;
+     } else {
+-      _parallel_marking_threads = MAX2((ParallelGCThreads + 2) / 4, (size_t)1);
++      _parallel_marking_threads = MAX2((size_t)((ParallelGCThreads + 2) / 4), (size_t)1);
+       _sleep_factor             = 0.0;
+       _marking_task_overhead    = 1.0;
+     }
+@@ -1116,7 +1116,7 @@ void ConcurrentMark::markFromRoots() {
+ 
+   _restart_for_overflow = false;
+ 
+-  size_t active_workers = MAX2((size_t) 1, parallel_marking_threads());
++  size_t active_workers = MAX2((size_t) 1, (size_t)parallel_marking_threads());
+   force_overflow_conc()->init();
+   set_phase(active_workers, true /* concurrent */);
+ 
+@@ -3689,7 +3689,7 @@ void CMTask::drain_local_queue(bool part
+   // of things to do) or totally (at the very end).
+   size_t target_size;
+   if (partially) {
+-    target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
++    target_size = MIN2((size_t)(_task_queue->max_elems()/3), (size_t) GCDrainStackTargetSize);
+   } else {
+     target_size = 0;
+   }
+@@ -4604,7 +4604,7 @@ size_t G1PrintRegionLivenessInfoClosure:
+   // The > 0 check is to deal with the prev and next live bytes which
+   // could be 0.
+   if (*hum_bytes > 0) {
+-    bytes = MIN2((size_t) HeapRegion::GrainBytes, *hum_bytes);
++    bytes = MIN2((size_t) HeapRegion::GrainBytes, (size_t)*hum_bytes);
+     *hum_bytes -= bytes;
+   }
+   return bytes;
+diff -up openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp.sav openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	2012-03-09 14:48:08.226867784 -0500
+@@ -1615,7 +1615,7 @@ HeapWord* G1CollectedHeap::expand_and_al
+ 
+   verify_region_sets_optional();
+ 
+-  size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes);
++  size_t expand_bytes = MAX2(word_size * HeapWordSize, (size_t)MinHeapDeltaBytes);
+   ergo_verbose1(ErgoHeapSizing,
+                 "attempt heap expansion",
+                 ergo_format_reason("allocation request failed")
+diff -up openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp.sav openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	2012-03-09 14:48:08.226867784 -0500
+@@ -1083,7 +1083,7 @@ OtherRegionsTable::do_cleanup_work(HRRSC
+ // This can be done by either mutator threads together with the
+ // concurrent refinement threads or GC threads.
+ int HeapRegionRemSet::num_par_rem_sets() {
+-  return (int)MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads);
++  return (int)MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), (size_t)ParallelGCThreads);
+ }
+ 
+ HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa,
+diff -up openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp.sav openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp	2012-03-09 14:48:08.226867784 -0500
+@@ -62,7 +62,7 @@ ParMarkBitMap::initialize(MemRegion cove
+   if (_virtual_space != NULL && _virtual_space->expand_by(bytes)) {
+     _region_start = covered_region.start();
+     _region_size = covered_region.word_size();
+-    idx_t* map = (idx_t*)_virtual_space->reserved_low_addr();
++    BitMap::bm_word_t* map = (BitMap::bm_word_t*)_virtual_space->reserved_low_addr();
+     _beg_bits.set_map(map);
+     _beg_bits.set_size(bits / 2);
+     _end_bits.set_map(map + words / 2);
+diff -up openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp.sav openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	2012-03-09 14:48:08.227867766 -0500
+@@ -188,7 +188,7 @@ bool ParScanThreadState::take_from_overf
+   const size_t num_overflow_elems = of_stack->size();
+   const size_t space_available = queue->max_elems() - queue->size();
+   const size_t num_take_elems = MIN3(space_available / 4,
+-                                     ParGCDesiredObjsFromOverflowList,
++                                     (size_t)ParGCDesiredObjsFromOverflowList,
+                                      num_overflow_elems);
+   // Transfer the most recent num_take_elems from the overflow
+   // stack to our work queue.
+diff -up openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp.sav openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp
+--- openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp	2012-03-09 14:48:08.227867766 -0500
+@@ -354,7 +354,7 @@ void GenCollectorPolicy::initialize_size
+       // generally small compared to the NewRatio calculation.
+       _min_gen0_size = NewSize;
+       desired_new_size = NewSize;
+-      max_new_size = MAX2(max_new_size, NewSize);
++      max_new_size = MAX2(max_new_size, (size_t)NewSize);
+     } else {
+       // For the case where NewSize is the default, use NewRatio
+       // to size the minimum and initial generation sizes.
+@@ -362,10 +362,10 @@ void GenCollectorPolicy::initialize_size
+       // NewRatio is overly large, the resulting sizes can be too
+       // small.
+       _min_gen0_size = MAX2(scale_by_NewRatio_aligned(min_heap_byte_size()),
+-                          NewSize);
++                          (size_t)NewSize);
+       desired_new_size =
+         MAX2(scale_by_NewRatio_aligned(initial_heap_byte_size()),
+-             NewSize);
++             (size_t)NewSize);
+     }
+ 
+     assert(_min_gen0_size > 0, "Sanity check");
+@@ -420,14 +420,14 @@ bool TwoGenerationCollectorPolicy::adjus
+       // Adjust gen0 down to accomodate OldSize
+       *gen0_size_ptr = heap_size - min_gen0_size;
+       *gen0_size_ptr =
+-        MAX2((uintx)align_size_down(*gen0_size_ptr, min_alignment()),
++        MAX2((size_t)align_size_down(*gen0_size_ptr, min_alignment()),
+              min_alignment());
+       assert(*gen0_size_ptr > 0, "Min gen0 is too large");
+       result = true;
+     } else {
+       *gen1_size_ptr = heap_size - *gen0_size_ptr;
+       *gen1_size_ptr =
+-        MAX2((uintx)align_size_down(*gen1_size_ptr, min_alignment()),
++        MAX2((size_t)align_size_down(*gen1_size_ptr, min_alignment()),
+                        min_alignment());
+     }
+   }
+@@ -451,7 +451,7 @@ void TwoGenerationCollectorPolicy::initi
+   // for setting the gen1 maximum.
+   _max_gen1_size = max_heap_byte_size() - _max_gen0_size;
+   _max_gen1_size =
+-    MAX2((uintx)align_size_down(_max_gen1_size, min_alignment()),
++    MAX2((size_t)align_size_down(_max_gen1_size, min_alignment()),
+          min_alignment());
+   // If no explicit command line flag has been set for the
+   // gen1 size, use what is left for gen1.
+@@ -465,11 +465,11 @@ void TwoGenerationCollectorPolicy::initi
+       "gen0 has an unexpected minimum size");
+     set_min_gen1_size(min_heap_byte_size() - min_gen0_size());
+     set_min_gen1_size(
+-      MAX2((uintx)align_size_down(_min_gen1_size, min_alignment()),
++      MAX2((size_t)align_size_down(_min_gen1_size, min_alignment()),
+            min_alignment()));
+     set_initial_gen1_size(initial_heap_byte_size() - initial_gen0_size());
+     set_initial_gen1_size(
+-      MAX2((uintx)align_size_down(_initial_gen1_size, min_alignment()),
++      MAX2((size_t)align_size_down(_initial_gen1_size, min_alignment()),
+            min_alignment()));
+ 
+   } else {
+diff -up openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp.sav openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
+--- openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp	2012-03-09 14:48:08.227867766 -0500
+@@ -46,7 +46,7 @@ void objArrayKlass::objarray_follow_cont
+   const size_t beg_index = size_t(index);
+   assert(beg_index < len || len == 0, "index too large");
+ 
+-  const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
++  const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
+   const size_t end_index = beg_index + stride;
+   T* const base = (T*)a->base();
+   T* const beg = base + beg_index;
+@@ -80,7 +80,7 @@ void objArrayKlass::objarray_follow_cont
+   const size_t beg_index = size_t(index);
+   assert(beg_index < len || len == 0, "index too large");
+ 
+-  const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
++  const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
+   const size_t end_index = beg_index + stride;
+   T* const base = (T*)a->base();
+   T* const beg = base + beg_index;
+diff -up openjdk/hotspot/src/share/vm/runtime/arguments.cpp.sav openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk/hotspot/src/share/vm/runtime/arguments.cpp.sav	2012-02-14 16:11:12.000000000 -0500
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2012-03-09 14:48:08.228867748 -0500
+@@ -1179,7 +1179,7 @@ void Arguments::set_cms_and_parnew_gc_fl
+       // so it's NewRatio x of NewSize.
+       if (FLAG_IS_DEFAULT(OldSize)) {
+         if (max_heap > NewSize) {
+-          FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
++          FLAG_SET_ERGO(uintx, OldSize, MIN2((size_t)(NewRatio*NewSize), max_heap - NewSize));
+           if (PrintGCDetails && Verbose) {
+             // Too early to use gclog_or_tty
+             tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
diff --git a/java-1.7.0-openjdk.spec b/java-1.7.0-openjdk.spec
index cf85847..d5f5948 100644
--- a/java-1.7.0-openjdk.spec
+++ b/java-1.7.0-openjdk.spec
@@ -38,10 +38,12 @@
 %ifarch ppc
 %global archbuild ppc
 %global archinstall ppc
+%global archdef PPC
 %endif
 %ifarch ppc64
 %global archbuild ppc64
 %global archinstall ppc64
+%global archdef PPC
 %endif
 %ifarch i386
 %global archbuild i586
@@ -56,8 +58,19 @@
 %global archinstall ia64
 %endif
 %ifarch s390
+%global archbuild s390
+%global archinstall s390
+%global archdef S390
+%endif
+%ifarch s390x
 %global archbuild s390x
 %global archinstall s390x
+%global archdef S390
+%endif
+%ifarch %{arm}
+%global archbuild arm
+%global archinstall arm
+%global archdef ARM
 %endif
 # 32 bit sparc, optimized for v9
 %ifarch sparcv9
@@ -151,7 +164,7 @@
 
 Name:    java-%{javaver}-%{origin}
 Version: %{javaver}.%{buildver}
-Release: %{icedtea_version}%{?dist}.1
+Release: %{icedtea_version}%{?dist}.2
 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
 # and this change was brought into RHEL-4.  java-1.5.0-ibm packages
 # also included the epoch in their virtual provides.  This created a
@@ -253,6 +266,14 @@ Patch8:   %{name}-remove-mimpure-opt.patch
 # Add rhino support
 Patch100: rhino.patch
 
+# Type fixing for s390
+Patch101: %{name}-bitmap.patch
+Patch102: %{name}-size_t.patch
+
+# Patches for Arm
+Patch103:  %{name}-arm-fixes.patch
+Patch104:  %{name}-arm-ftbfs.patch
+
 #
 # Bootstrap patches (code with this is never shipped)
 #
@@ -430,15 +451,16 @@ BuildRequires: pulseaudio >= 0.9.11
 %endif
 # Zero-assembler build requirement.
 %ifnarch %{jit_arches}
-BuildRequires: libffi-devel
+BuildRequires: libffi-devel >= 3.0.10
 %endif
 
-ExclusiveArch: x86_64 i686
-
 # cacerts build requirement.
 BuildRequires: openssl
 # execstack build requirement.
+# no prelink on ARM yet
+%ifnarch %{arm}
 BuildRequires: prelink
+%endif
 %ifarch %{jit_arches}
 #systemtap build requirement.
 BuildRequires: systemtap-sdt-devel
@@ -654,7 +676,7 @@ export NUM_PROC=`/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :`
 export NUM_PROC=${NUM_PROC:-1}
 
 # Build IcedTea and OpenJDK.
-%ifarch sparc64 alpha
+%ifarch s390x sparc64 alpha ppc64
 export ARCH_DATA_MODEL=64
 %endif
 %ifarch alpha
@@ -672,6 +694,14 @@ patch -l -p0 < %{PATCH6}
 patch -l -p0 < %{PATCH7}
 patch -l -p0 < %{PATCH8}
 
+# Type fixes
+patch -l -p0 < %{PATCH101}
+patch -l -p0 < %{PATCH102}
+
+# Arm fixes
+patch -l -p0 < %{PATCH103}
+patch -l -p0 < %{PATCH104}
+
 # Add a "-icedtea" tag to the version
 sed -i "s#BUILD_VARIANT_RELEASE)#BUILD_VARIANT_RELEASE)-icedtea#" openjdk/jdk/make/common/shared/Defs.gmk
 
@@ -779,7 +809,20 @@ make \
   DISABLE_NIMBUS="true" \
   XSLT="/usr/bin/xsltproc" \
   FT2_CFLAGS="-I/usr/include/freetype2 " \
-  FT2_LIBS="-lfreetype "
+  FT2_LIBS="-lfreetype " \
+%ifnarch %{jit_arches}
+  LIBFFI_CFLAGS="`pkg-config --cflags libffi` " \
+  LIBFFI_LIBS="-lffi " \
+  ZERO_BUILD="true" \
+  ZERO_LIBARCH="%{archbuild}" \
+  ZERO_ARCHDEF="%{archdef}" \
+%ifarch ppc ppc64 s390 s390x
+  ZERO_ENDIANNESS="big" \
+%else
+  ZERO_ENDIANNESS="little" \
+%endif
+%endif
+  %{nil}
 
 export JDK_TO_BUILD_WITH=$PWD/build/linux-%{archbuild}/j2sdk-image
 
@@ -813,6 +856,18 @@ make \
   FT2_LIBS="-lfreetype " \
   DEBUG_CLASSFILES="true" \
   DEBUG_BINARIES="true" \
+%ifnarch %{jit_arches}
+  LIBFFI_CFLAGS="`pkg-config --cflags libffi` " \
+  LIBFFI_LIBS="-lffi " \
+  ZERO_BUILD="true" \
+  ZERO_LIBARCH="%{archbuild}" \
+  ZERO_ARCHDEF="%{archdef}" \
+%ifarch ppc ppc64 s390 s390x
+  ZERO_ENDIANNESS="big" \
+%else
+  ZERO_ENDIANNESS="little" \
+%endif
+%endif
   %{debugbuild}
 
 popd >& /dev/null
@@ -1331,6 +1386,11 @@ exit 0
 %doc %{buildoutputdir}/j2sdk-image/jre/LICENSE
 
 %changelog
+* Mon Mar 12 2012 Deepak Bhole <dbhole at redhat.com> - 1.7.0.3-2.1.fc17.2
+- Unified spec file for x86, x86_64, ARM and s390
+  - Integrated changes from Dan Horák <dhorak at redhat.com> for Zero/s390
+  - Integrated changes from Chris Phillips <chphilli at redhat.com> for Zero/ARM
+
 * Fri Feb 24 2012 Deepak Bhole <dbhole at redhat.com> - 1.7.0.3-2.1.fc17.1
 - Added flag so that debuginfo is built into classfiles (rhbz# 796400) 
 - Updated rhino.patch to build scripting support (rhbz# 796398)


More information about the scm-commits mailing list