Remove dependencies on default libraries that break cross-compilation with new clang build
@@ -4546,12 +4546,12 @@ module _GO_BASE_UNIT: _BASE_UNIT {
when ($OS_DARWIN) {
GO_TOOLCHAIN_ENV += ${env:"CC=clang"} ${env:"PATH=$(DEFAULT_DARWIN_X86_64)/bin:$MACOS_SDK_RESOURCE_GLOBAL/usr/bin:$CCTOOLS_ROOT_RESOURCE_GLOBAL/bin"}
GO_EXTLD = ++extld clang ++extldflags $LD_SDK_VERSION -undefined dynamic_lookup $C_FLAGS_PLATFORM --sysroot=$MACOS_SDK_RESOURCE_GLOBAL ${rootrel:SRCS_GLOBAL} $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE $OBJADDE_LIB $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES
- CGO2_LDFLAGS += $LD_SDK_VERSION -undefined dynamic_lookup
+ CGO2_LDFLAGS += $LD_SDK_VERSION -undefined dynamic_lookup -nodefaultlibs -lc
}
elsewhen ($OS_LINUX) {
GO_TOOLCHAIN_ENV += ${env:"CC=clang"} ${env:"PATH=$(DEFAULT_LINUX_X86_64)/bin:$OS_SDK_ROOT_RESOURCE_GLOBAL/usr/bin"}
GO_EXTLD = ++extld clang ++extldflags $C_FLAGS_PLATFORM --sysroot=$OS_SDK_ROOT_RESOURCE_GLOBAL ${rootrel:SRCS_GLOBAL} $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE $OBJADDE_LIB $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES
- CGO2_LDFLAGS += -Wl,--unresolved-symbols=ignore-all
+ CGO2_LDFLAGS += -Wl,--unresolved-symbols=ignore-all -nodefaultlibs -lc
}
otherwise {
GO_EXTLD = ++extld gcc
