diff -rupN ../valgrind-orig/configure.ac ./configure.ac --- ../valgrind-orig/configure.ac +++ ./configure.ac @@ -589,9 +589,12 @@ case "${host_os}" in DARWIN_MIN_SDK="10.8" fi - # they changed the names around 11.0 + # Apple removed the 'x' from the option name in macOS 11.0 to match + # the OS name change, but gcc only supports the older option ld_os_min_vers_arg="-macos_version_min ${DARWIN_MIN_SDK}" - clang_os_min_vers_arg="-mmacos-version-min=${DARWIN_MIN_SDK}" + if test $is_clang = applellvm -o $is_clang = clang; then + clang_os_min_vers_arg="-mmacos-version-min=${DARWIN_MIN_SDK}" + fi fi ;; iphoneos) diff -rupN ../valgrind-orig/coregrind/m_syscall.c ./coregrind/m_syscall.c --- ../valgrind-orig/coregrind/m_syscall.c +++ ./coregrind/m_syscall.c @@ -863,7 +863,7 @@ asm( nb here, sizeof(UWord) == sizeof(UInt) */ -__private_extern__ ULong +__attribute__((visibility("hidden"))) ULong do_syscall_unix_WRK ( UWord a1, UWord a2, UWord a3, /* 4(esp)..12(esp) */ UWord a4, UWord a5, UWord a6, /* 16(esp)..24(esp) */ UWord a7, UWord a8, /* 28(esp)..32(esp) */ @@ -883,7 +883,7 @@ asm(".private_extern _do_syscall_unix_WR " 1: ret \n" ); -__private_extern__ UInt +__attribute__((visibility("hidden"))) UInt do_syscall_mach_WRK ( UWord a1, UWord a2, UWord a3, /* 4(esp)..12(esp) */ UWord a4, UWord a5, UWord a6, /* 16(esp)..24(esp) */ UWord a7, UWord a8, /* 28(esp)..32(esp) */ @@ -896,7 +896,7 @@ asm(".private_extern _do_syscall_mach_WR " ret \n" ); -__private_extern__ UInt +__attribute__((visibility("hidden"))) UInt do_syscall_mdep_WRK ( UWord a1, UWord a2, UWord a3, /* 4(esp)..12(esp) */ UWord a4, UWord a5, UWord a6, /* 16(esp)..24(esp) */ UWord a7, UWord a8, /* 28(esp)..32(esp) */ @@ -929,7 +929,7 @@ asm( nb here, sizeof(UWord) == sizeof(ULong) */ -__private_extern__ UWord +__attribute__((visibility("hidden"))) UWord do_syscall_unix_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */ UWord a4, UWord a5, UWord a6, /* rcx, r8, r9 */ UWord a7, UWord a8, /* 8(rsp), 16(rsp) */ @@ -953,7 +953,7 @@ asm(".private_extern _do_syscall_unix_WR " retq \n" /* return 1st result word */ ); -__private_extern__ UWord +__attribute__((visibility("hidden"))) UWord do_syscall_mach_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */ UWord a4, UWord a5, UWord a6, /* rcx, r8, r9 */ UWord a7, UWord a8, /* 8(rsp), 16(rsp) */ diff -rupN ../valgrind-orig/coregrind/m_syswrap/syswrap-darwin.c ./coregrind/m_syswrap/syswrap-darwin.c --- ../valgrind-orig/coregrind/m_syswrap/syswrap-darwin.c +++ ./coregrind/m_syswrap/syswrap-darwin.c @@ -516,7 +516,7 @@ static OpenPort *info_for_port(mach_port // Give a port a name, without changing its refcount // GrP fixme don't override name if it already has a specific one -__private_extern__ void assign_port_name(mach_port_t port, const HChar *name) +__attribute__((visibility("hidden"))) void assign_port_name(mach_port_t port, const HChar *name) { OpenPort *i; if (!port) return; diff -rupN ../valgrind-orig/coregrind/vg_preloaded.c ./coregrind/vg_preloaded.c --- ../valgrind-orig/coregrind/vg_preloaded.c +++ ./coregrind/vg_preloaded.c @@ -159,7 +159,7 @@ void * VG_NOTIFY_ON_LOAD(ifunc_wrapper) /* This string will be inserted into crash logs, so crashes while running under Valgrind can be distinguished from other crashes. */ -__private_extern__ const char *__crashreporter_info__ = "Instrumented by Valgrind " VERSION; +__attribute__((visibility("hidden"))) const char *__crashreporter_info__ = "Instrumented by Valgrind " VERSION; /* --------------------------------------------------------------------- Darwin environment cleanup