Skip to content

Unable to build with latest next branch on darwin/aarch64 #2206

Open
@galderz

Description

@galderz

OpenJDK can be configured with capstone but latest next branch fails to build with it.

After updating the capstone arch to -DCAPSTONE_ARCH=CS_ARCH_AARCH64, I still see this issue:

/bin/rm -f /Users/galder/1/jdk/build/fast/support/hsdis/hsdis-capstone.o.log && /usr/bin/clang -MMD -MF /Users/galder/1/jdk/build/fast/support/hsdis/hsdis-capstone.d.tmp -I/Users/galder/1/jdk/build/fast/support/modules_include/java.base -I/Users/galder/1/jdk/build/fast/support/modules_include/java.base/darwin -I/Users/galder/1/jdk/src/java.base/share/native/libjava -I/Users/galder/1/jdk/src/java.base/unix/native/libjava -I/Users/galder/1/jdk/src/hotspot/share/include -I/Users/galder/1/jdk/src/hotspot/os/posix/include -DMAC_OS_X_VERSION_MIN_REQUIRED=110000 -mmacosx-version-min=11.00.00 -DLIBC=default -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT -DMACOSX -DDEBUG -Wall -Wextra -Wformat=2 -Wpointer-arith -Wsign-compare -Wreorder -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -g -gdwarf-4 -gdwarf-aranges -std=c11 -arch arm64 -D_LITTLE_ENDIAN -DARCH='"aarch64"' -Daarch64 -D_LP64=1 -I/Users/galder/opt/capstone/include/capstone -DCAPSTONE_ARCH=CS_ARCH_AARCH64 -DCAPSTONE_MODE=CS_MODE_ARM -I/Users/galder/1/jdk/src/utils/hsdis/capstone -I/Users/galder/1/jdk/src/utils/hsdis -g -gdwarf-4 -gdwarf-aranges -Wno-unknown-warning-option -Wno-unused-parameter -Wno-unused -Wno-undef -Wno-format-nonliteral -Werror -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks -c -o /Users/galder/1/jdk/build/fast/support/hsdis/hsdis-capstone.o /Users/galder/1/jdk/src/utils/hsdis/capstone/hsdis-capstone.c -frandom-seed="hsdis-capstone.c"

In file included from /Users/galder/1/jdk/src/utils/hsdis/capstone/hsdis-capstone.c:55:
/Users/galder/opt/capstone/include/capstone/capstone.h:341:14: error: expected member name or ';' after declaration specifiers
                cs_aarch64 aarch64; ///< AARCH64 architecture (aka AArch64)
                ~~~~~~~~~~ ^
<command line>:9:17: note: expanded from macro 'aarch64'
#define aarch64 1
                ^
In file included from /Users/galder/1/jdk/src/utils/hsdis/capstone/hsdis-capstone.c:55:
/Users/galder/opt/capstone/include/capstone/capstone.h:341:13: error: expected ';' at end of declaration list
                cs_aarch64 aarch64; ///< AARCH64 architecture (aka AArch64)
                          ^
                          ;
2 errors generated.

Could this be a macro expansion issue?

Is there any stable branch/version for using capstone that will work on darwin/aarch64? I've tried the commit before ef89b18 and that fails with:

/bin/rm -f /Users/galder/1/jdk/build/fast/support/hsdis/BUILD_HSDIS_link.log && /usr/bin/clang -mmacosx-version-min=11.00.00 -arch arm64 -L/Users/galder/1/jdk/build/fast/support/modules_libs/java.base -L/Users/galder/1/jdk/build/fast/support/modules_libs/java.base/server -dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 -L/Users/galder/opt/capstone/lib -dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 -Wl,-install_name,@rpath/libhsdis.dylib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks -o /Users/galder/1/jdk/build/fast/support/hsdis/libhsdis.dylib /Users/galder/1/jdk/build/fast/support/hsdis/hsdis-capstone.o
...
ld: warning: search path '/Users/galder/opt/capstone/lib' not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions