Enable libunwind in native packages and Docker images. (#19452)
* Enable libunwind in Docker images. * Enable libunwind in DEB native packages. * Enable libunwind in RPM native packages. * Fix typo in CMakeLists.
Austin S. Hemmelgarn committed
Feb 21, 2025 at 06:46 UTC
d44562c27d3fde93f722c0fbca25c49d4af12163
4 files changed
+11
-2
CMakeLists.txt
+1
-1
@@ -2179,7 +2179,7 @@ if(ENABLE_LIBUNWIND)
2179
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(amd64)")
2180
target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-x86_64)
2181
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?.86")
2182
- target_link_libraries(libnetdata PUBLIC PkgCOnfig::LIBUNWIND -lunwind-x86)
2182
+ target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-x86)
2183
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(aarch64)")
2184
target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-aarch64)
2185
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
netdata.spec.in
+3
-1
@@ -160,6 +160,7 @@ BuildRequires: pkgconfig(libcurl)
160
BuildRequires: pkgconfig(liblz4)
161
BuildRequires: pkgconfig(yaml-0.1)
162
BuildRequires: pkgconfig(json-c)
163
+BuildRequires: pkgconfig(libunwind)
164
%if %{_have_log2journal}
165
BuildRequires: pkgconfig(libpcre2-8)
166
%endif
@@ -406,7 +407,8 @@ happened, on your systems and applications.
407
-DENABLE_PLUGIN_SYSTEMD_JOURNAL=On \
408
-DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=On \
409
-DENABLE_BUNDLED_JSONC=Off \
409
- -DENABLE_BUNDLED_YAML=Off
410
+ -DENABLE_BUNDLED_YAML=Off \
411
+ -DENABLE_LBIUNWIND=On
412
413
# Build step
414
%{cmake_build}
packaging/build-package.sh
+6
@@ -51,6 +51,8 @@ add_cmake_option ENABLE_BUNDLED_PROTOBUF Off
51
add_cmake_option ENABLE_BUNDLED_JSONC Off
52
add_cmake_option ENABLE_BUNDLED_YAML Off
53
54
+add_cmake_option ENABLE_LIBUNWIND On
55
+
56
add_cmake_option BUILD_FOR_PACKAGING On
57
58
case "${PKG_TYPE}" in
@@ -64,6 +66,10 @@ case "${PKG_TYPE}" in
66
add_cmake_option ENABLE_PLUGIN_XENSTAT On
67
add_cmake_option ENABLE_PLUGIN_EBPF Off
68
;;
69
+ armhf)
70
+ add_cmake_option ENABLE_PLUGIN_XENSTAT Off
71
+ add_cmake_option ENABLE_PLUGIN_EBPF Off
72
+ ;;
73
*)
74
add_cmake_option ENABLE_PLUGIN_XENSTAT Off
75
add_cmake_option ENABLE_PLUGIN_EBPF Off
packaging/docker/Dockerfile
+1
@@ -27,6 +27,7 @@ WORKDIR /opt/netdata.git
27
RUN chmod +x netdata-installer.sh && \
28
cp -rp /deps/* /usr/local/ && \
29
/bin/echo -e "INSTALL_TYPE='oci'\nPREBUILT_ARCH='$(uname -m)'" > ./system/.install-type && \
30
+ NETDATA_CMAKE_OPTIONS="-DENABLE_LIBUNWIND=On" \
31
CFLAGS="$(packaging/docker/gen-cflags.sh)" LDFLAGS="-Wl,--gc-sections" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \
32
${EXTRA_INSTALL_OPTS} --disable-ebpf --install-no-prefix / "$([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)"
33