fix build with cgo
@@ -3804,12 +3804,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 $LDFLAGS $LDFLAGS_GLOBAL $GO_LDFLAGS_GLOBAL
+ GO_EXTLD = ++extld clang ++extldflags $LD_SDK_VERSION -undefined dynamic_lookup $C_FLAGS_PLATFORM --sysroot=$MACOS_SDK_RESOURCE_GLOBAL $LDFLAGS $LDFLAGS_GLOBAL $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES
CGO2_LDFLAGS += $LD_SDK_VERSION -undefined dynamic_lookup
}
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 $LDFLAGS $LDFLAGS_GLOBAL $GO_LDFLAGS_GLOBAL
+ GO_EXTLD = ++extld clang ++extldflags $C_FLAGS_PLATFORM --sysroot=$OS_SDK_ROOT_RESOURCE_GLOBAL $LDFLAGS $LDFLAGS_GLOBAL $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES
CGO2_LDFLAGS += -Wl,--unresolved-symbols=ignore-all
}
otherwise {
@@ -3835,6 +3835,13 @@ module GO_PROGRAM: GO_BASE_UNIT {
USE_LINKER()
+ when ($USE_ARCADIA_LIBM == "yes") {
+ PEERDIR+=contrib/libs/libm
+ }
+ when ($USE_ARCADIA_LIBM == "no") {
+ C_SYSTEM_LIBRARIES+=-lm
+ }
+
when ($MSVC == "yes" || $CYGWIN == "yes") {
MODULE_SUFFIX=.exe
}
