1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-12 18:59:50 +03:00
aports/community/netdata/build-enable-cgo.patch
2024-10-25 18:36:51 +00:00

15 lines
1 KiB
Diff

Description: enable CGO because buildmode=pie requries external linking
Upstream: no
diff --git a/packaging/cmake/Modules/NetdataGoTools.cmake b/packaging/cmake/Modules/NetdataGoTools.cmake
index c8b8b9c..9396f81 100644
--- a/packaging/cmake/Modules/NetdataGoTools.cmake
+++ b/packaging/cmake/Modules/NetdataGoTools.cmake
@@ -33,7 +33,7 @@ macro(add_go_target target output build_src build_dir)
add_custom_command(
OUTPUT ${output}
- COMMAND "${CMAKE_COMMAND}" -E env GOROOT=${GO_ROOT} CGO_ENABLED=0 GOPROXY=https://proxy.golang.org,direct "${GO_EXECUTABLE}" build -buildvcs=false -ldflags "${GO_LDFLAGS}" -o "${CMAKE_BINARY_DIR}/${output}" "./${build_dir}"
+ COMMAND "${CMAKE_COMMAND}" -E env GOROOT=${GO_ROOT} CGO_ENABLED=1 GOPROXY=https://proxy.golang.org,direct "${GO_EXECUTABLE}" build -buildvcs=false -ldflags "${GO_LDFLAGS}" -o "${CMAKE_BINARY_DIR}/${output}" "./${build_dir}"
DEPENDS ${${target}_DEPS}
COMMENT "Building Go component ${output}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/${build_src}"