From 27eea716e3d9a1a67d82ea67740f477be1e5a112 Mon Sep 17 00:00:00 2001
From: liuyulong <liuyulong35@huawei.com>
Date: Wed, 1 Feb 2023 16:23:44 +0800
Subject: [PATCH 3/6] fix SUSE x86_32 build failure

DTS/AR: DTS2023013108238
Summary: <hotspot>: fix SUSE x86_32 build failure
LLT: NA
Patch Type: huawei
Bug url: NA
---
 hotspot/src/share/vm/utilities/elfFile.hpp | 41 +++++++++++-----------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/hotspot/src/share/vm/utilities/elfFile.hpp b/hotspot/src/share/vm/utilities/elfFile.hpp
index 3277a40e0..1419d7c63 100644
--- a/hotspot/src/share/vm/utilities/elfFile.hpp
+++ b/hotspot/src/share/vm/utilities/elfFile.hpp
@@ -36,27 +36,6 @@
 
 #ifdef _LP64
 
-#ifdef ASSERT
-// Helper macros to print different log levels during DWARF parsing
-#define DWARF_LOG_SUMMARY(format, ...) DWARF_LOG_WITH_LEVEL(1, format, ##__VA_ARGS__) // Same level as error logging
-#define DWARF_LOG_ERROR(format, ...) DWARF_LOG_WITH_LEVEL(1, format, ##__VA_ARGS__)
-#define DWARF_LOG_INFO(format, ...) DWARF_LOG_WITH_LEVEL(2, format, ##__VA_ARGS__)
-#define DWARF_LOG_DEBUG(format, ...) DWARF_LOG_WITH_LEVEL(3, format, ##__VA_ARGS__)
-#define DWARF_LOG_TRACE(format, ...) DWARF_LOG_WITH_LEVEL(4, format, ##__VA_ARGS__)
-
-#define DWARF_LOG_WITH_LEVEL(level, format, ...) \
-    if (TraceDwarfLevel >= level) {         \
-      tty->print("[dwarf] ");               \
-      tty->print_cr(format, ##__VA_ARGS__); \
-    }
-#else
-#define DWARF_LOG_SUMMARY(format, ...)
-#define DWARF_LOG_ERROR(format, ...)
-#define DWARF_LOG_INFO(format, ...)
-#define DWARF_LOG_DEBUG(format, ...)
-#define DWARF_LOG_TRACE(format, ...)
-#endif
-
 typedef Elf64_Half      Elf_Half;
 typedef Elf64_Word      Elf_Word;
 typedef Elf64_Off       Elf_Off;
@@ -93,6 +72,26 @@ typedef Elf32_Sym       Elf_Sym;
 #include "memory/allocation.hpp"
 #include "utilities/decoder.hpp"
 
+#ifdef ASSERT
+// Helper macros to print different log levels during DWARF parsing
+#define DWARF_LOG_SUMMARY(format, ...) DWARF_LOG_WITH_LEVEL(1, format, ##__VA_ARGS__) // Same level as error logging
+#define DWARF_LOG_ERROR(format, ...) DWARF_LOG_WITH_LEVEL(1, format, ##__VA_ARGS__)
+#define DWARF_LOG_INFO(format, ...) DWARF_LOG_WITH_LEVEL(2, format, ##__VA_ARGS__)
+#define DWARF_LOG_DEBUG(format, ...) DWARF_LOG_WITH_LEVEL(3, format, ##__VA_ARGS__)
+#define DWARF_LOG_TRACE(format, ...) DWARF_LOG_WITH_LEVEL(4, format, ##__VA_ARGS__)
+
+#define DWARF_LOG_WITH_LEVEL(level, format, ...) \
+    if (TraceDwarfLevel >= level) {         \
+      tty->print("[dwarf] ");               \
+      tty->print_cr(format, ##__VA_ARGS__); \
+    }
+#else
+#define DWARF_LOG_SUMMARY(format, ...)
+#define DWARF_LOG_ERROR(format, ...)
+#define DWARF_LOG_INFO(format, ...)
+#define DWARF_LOG_DEBUG(format, ...)
+#define DWARF_LOG_TRACE(format, ...)
+#endif
 
 class ElfStringTable;
 class ElfSymbolTable;
-- 
2.22.0

