File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ ifeq ($(HSDIS_BACKEND), capstone)
47
47
CAPSTONE_ARCH := CS_ARCH_X86
48
48
CAPSTONE_MODE := CS_MODE_$(OPENJDK_TARGET_CPU_BITS)
49
49
else ifeq ($(call isTargetCpuArch, aarch64), true)
50
- CAPSTONE_ARCH := CS_ARCH_ARM64
50
+ CAPSTONE_ARCH := CS_ARCH_$(CAPSTONE_ARCH_AARCH64_NAME)
51
51
CAPSTONE_MODE := CS_MODE_ARM
52
52
else
53
53
$(error No support for Capstone on this platform)
Original file line number Diff line number Diff line change @@ -63,6 +63,19 @@ AC_DEFUN([LIB_SETUP_HSDIS_CAPSTONE],
63
63
AC_MSG_ERROR ( [ Cannot continue] )
64
64
fi
65
65
fi
66
+
67
+ capstone_header="\"$CAPSTONE/include/capstone/capstone.h\""
68
+ AC_MSG_CHECKING ( [ capstone aarch64 arch name] )
69
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ #include $capstone_header] ,[ [ cs_arch test = CS_ARCH_AARCH64] ] ) ] ,
70
+ [
71
+ AC_MSG_RESULT ( [ AARCH64] )
72
+ CAPSTONE_ARCH_AARCH64_NAME="AARCH64"
73
+ ] ,
74
+ [
75
+ AC_MSG_RESULT ( [ ARM64] )
76
+ CAPSTONE_ARCH_AARCH64_NAME="ARM64"
77
+ ]
78
+ )
66
79
] )
67
80
68
81
# ###############################################################################
@@ -365,6 +378,7 @@ AC_DEFUN_ONCE([LIB_SETUP_HSDIS],
365
378
AC_SUBST ( HSDIS_CFLAGS )
366
379
AC_SUBST ( HSDIS_LDFLAGS )
367
380
AC_SUBST ( HSDIS_LIBS )
381
+ AC_SUBST ( CAPSTONE_ARCH_AARCH64_NAME )
368
382
369
383
AC_MSG_CHECKING ( [ if hsdis should be bundled] )
370
384
if test "x$ENABLE_HSDIS_BUNDLING" = "xtrue"; then
Original file line number Diff line number Diff line change @@ -377,6 +377,7 @@ ENABLE_HSDIS_BUNDLING := @ENABLE_HSDIS_BUNDLING@
377
377
HSDIS_CFLAGS := @HSDIS_CFLAGS@
378
378
HSDIS_LDFLAGS := @HSDIS_LDFLAGS@
379
379
HSDIS_LIBS := @HSDIS_LIBS@
380
+ CAPSTONE_ARCH_AARCH64_NAME := @CAPSTONE_ARCH_AARCH64_NAME@
380
381
381
382
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
382
383
# it in sync.
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2019, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2019, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* The Universal Permissive License (UPL), Version 1.0
52
52
#include <inttypes.h>
53
53
#include <string.h>
54
54
55
+ /* Undefine macro to avoid generating invalid C code.
56
+ Capstone refactored cs_detail for AArch64 architecture
57
+ from `cs_arm64 arm64` to `cs_aarch64 aarch64`
58
+ and that causes invalid macro expansion.
59
+ */
60
+ #undef aarch64
55
61
#include <capstone.h>
56
62
57
63
#include "hsdis.h"
You can’t perform that action at this time.
0 commit comments