sparc-linux fixes from Debian

Thorsten Glaser t.glaser at tarent.de
Mon Jul 3 00:15:51 UTC 2023


Hi,

you’ll want this, or something that only adds that flag
if SUNWcc is actually used:

--- a/jdk/make/CompileDemos.gmk
+++ b/jdk/make/CompileDemos.gmk
@@ -235,10 +235,12 @@ define SetupJVMTIDemo
   $1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 \
       $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
       $(CXXFLAGS_DEBUG_SYMBOLS)
+  ifeq ($(OPENJDK_TARGET_OS), solaris)
   ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
     $1_FILTER := -xregs=no%appl
     $1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
   endif
+  endif
 
   # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
   # eval call below, the comma gets expanded too early.


Furthermore, you’ll want something like this; I took this
from commit 718f3252f64e4a4da739b1419dc520dd60e3b6dc, not
knowing whether it’s correct for Linux.

--- a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,11 +32,21 @@ bool JavaThread::pd_get_top_frame_for_si
                                                      void* ucontext,
                                                      bool isInJava) {
   assert(Thread::current() == this, "caller must be current thread");
+  return pd_get_top_frame(fr_addr, ucontext, isInJava, true);
+}
+
+bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
+  // get ucontext somehow
+  return pd_get_top_frame(fr_addr, ucontext, isInJava, false);
+}
+
+bool JavaThread::pd_get_top_frame(frame* fr_addr,
+  void* ucontext, bool isInJava, bool makeWalkable) {
   assert(this->is_Java_thread(), "must be JavaThread");
 
   JavaThread* jt = (JavaThread *)this;
 
-  if (!isInJava) {
+  if (!isInJava && makeWalkable) {
     // make_walkable flushes register windows and grabs last_Java_pc
     // which can not be done if the ucontext sp matches last_Java_sp
     // stack walking utilities assume last_Java_pc set if marked flushed
--- a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp
@@ -94,6 +94,11 @@ public:
   bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
     bool isInJava);
 
+  bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
+private:
+  bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);
+public:
+
   // These routines are only used on cpu architectures that
   // have separate register stacks (Itanium).
   static bool register_stack_overflow() { return false; }


bye,
//mirabilos
-- 
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

                        ****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against      Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also,     https://www.tarent.de/newsletter
╱ ╲ header encryption!
                        ****************************************************


More information about the jdk8u-dev mailing list