Skip to content

Commit

Permalink
Enable libunwind in native packages and Docker images. (netdata#19452)
Browse files Browse the repository at this point in the history
* Enable libunwind in Docker images.

* Enable libunwind in DEB native packages.

* Enable libunwind in RPM native packages.

* Fix typo in CMakeLists.
  • Loading branch information
Ferroin authored Feb 21, 2025
1 parent 48bdd9b commit d44562c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,7 @@ if(ENABLE_LIBUNWIND)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(amd64)")
target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-x86_64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?.86")
target_link_libraries(libnetdata PUBLIC PkgCOnfig::LIBUNWIND -lunwind-x86)
target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-x86)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(aarch64)")
target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-aarch64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
Expand Down
4 changes: 3 additions & 1 deletion netdata.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(yaml-0.1)
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(libunwind)
%if %{_have_log2journal}
BuildRequires: pkgconfig(libpcre2-8)
%endif
Expand Down Expand Up @@ -406,7 +407,8 @@ happened, on your systems and applications.
-DENABLE_PLUGIN_SYSTEMD_JOURNAL=On \
-DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=On \
-DENABLE_BUNDLED_JSONC=Off \
-DENABLE_BUNDLED_YAML=Off
-DENABLE_BUNDLED_YAML=Off \
-DENABLE_LBIUNWIND=On

# Build step
%{cmake_build}
Expand Down
6 changes: 6 additions & 0 deletions packaging/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ add_cmake_option ENABLE_BUNDLED_PROTOBUF Off
add_cmake_option ENABLE_BUNDLED_JSONC Off
add_cmake_option ENABLE_BUNDLED_YAML Off

add_cmake_option ENABLE_LIBUNWIND On

add_cmake_option BUILD_FOR_PACKAGING On

case "${PKG_TYPE}" in
Expand All @@ -64,6 +66,10 @@ case "${PKG_TYPE}" in
add_cmake_option ENABLE_PLUGIN_XENSTAT On
add_cmake_option ENABLE_PLUGIN_EBPF Off
;;
armhf)
add_cmake_option ENABLE_PLUGIN_XENSTAT Off
add_cmake_option ENABLE_PLUGIN_EBPF Off
;;
*)
add_cmake_option ENABLE_PLUGIN_XENSTAT Off
add_cmake_option ENABLE_PLUGIN_EBPF Off
Expand Down
1 change: 1 addition & 0 deletions packaging/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ WORKDIR /opt/netdata.git
RUN chmod +x netdata-installer.sh && \
cp -rp /deps/* /usr/local/ && \
/bin/echo -e "INSTALL_TYPE='oci'\nPREBUILT_ARCH='$(uname -m)'" > ./system/.install-type && \
NETDATA_CMAKE_OPTIONS="-DENABLE_LIBUNWIND=On" \
CFLAGS="$(packaging/docker/gen-cflags.sh)" LDFLAGS="-Wl,--gc-sections" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \
${EXTRA_INSTALL_OPTS} --disable-ebpf --install-no-prefix / "$([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)"

Expand Down

0 comments on commit d44562c

Please sign in to comment.