Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],

# Setup OS-dependent LDFLAGS
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-dead_strip"
fi
# FIXME: We should really generalize SetSharedLibraryOrigin instead.
OS_LDFLAGS_JVM_ONLY="-Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.."
OS_LDFLAGS="-mmacosx-version-min=$MACOSX_VERSION_MIN -Wl,-reproducible"
Expand Down
10 changes: 10 additions & 0 deletions src/hotspot/share/oops/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
#include "oops/metadata.hpp"
#include "prims/jvmtiRedefineClasses.hpp"

#if defined(__APPLE__)
extern void* _ZTV8Metadata[];

// avoid code stripping which disturbs the serviceability agent
__attribute__((used))
void* dead_strip_helper() {
return _ZTV8Metadata[0];
}
#endif

void Metadata::set_on_stack(const bool value) {
// nothing to set for most metadata
// Can't inline because this materializes the vtable on some C++ compilers.
Expand Down