mirror of
https://github.com/netdata/netdata.git
synced 2025-04-13 09:11:50 +00:00
Include libucontext in static builds to vendor libunwind even on POWER. (#19817)
This commit is contained in:
parent
e9b9fb75c4
commit
fcb6217301
3 changed files with 52 additions and 5 deletions
packaging/makeself
|
@ -3,6 +3,8 @@ PACKAGES=("OPENSSL" "CURL" "BASH" "IOPING" "LIBNETFILTER_ACT")
|
||||||
SOURCE_TYPES=("GH_REPO_CLONE" "GH_REPO_CLONE" "DW_TARBALL" "GH_REPO_SOURCE" "DW_TARBALL")
|
SOURCE_TYPES=("GH_REPO_CLONE" "GH_REPO_CLONE" "DW_TARBALL" "GH_REPO_SOURCE" "DW_TARBALL")
|
||||||
OPENSSL_VERSION="openssl-3.4.0"
|
OPENSSL_VERSION="openssl-3.4.0"
|
||||||
OPENSSL_SOURCE="https://github.com/openssl/openssl"
|
OPENSSL_SOURCE="https://github.com/openssl/openssl"
|
||||||
|
LIBUCONTEXT_VERSION="libucontext-1.3.2"
|
||||||
|
LIBUCONTEXT_SOURCE="https://github.com/kaniini/libucontext"
|
||||||
LIBUNWIND_VERSION="177deb5f89c5d792c9618db54fdcebd260e271e8" # Should be updated to a stable version once https://github.com/libunwind/libunwind/issues/742 is fixed.
|
LIBUNWIND_VERSION="177deb5f89c5d792c9618db54fdcebd260e271e8" # Should be updated to a stable version once https://github.com/libunwind/libunwind/issues/742 is fixed.
|
||||||
LIBUNWIND_SOURCE="https://github.com/libunwind/libunwind"
|
LIBUNWIND_SOURCE="https://github.com/libunwind/libunwind"
|
||||||
CURL_VERSION="curl-8_11_1"
|
CURL_VERSION="curl-8_11_1"
|
||||||
|
|
48
packaging/makeself/jobs/15-libucontext.install.sh
Executable file
48
packaging/makeself/jobs/15-libucontext.install.sh
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
# shellcheck source=packaging/makeself/functions.sh
|
||||||
|
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
|
||||||
|
# Source of truth for all the packages we bundle in static builds
|
||||||
|
. "$(dirname "${0}")/../bundled-packages.version"
|
||||||
|
# shellcheck disable=SC2015
|
||||||
|
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building libucontext" || true
|
||||||
|
|
||||||
|
export CFLAGS="${TUNING_FLAGS} -pipe"
|
||||||
|
export CXXFLAGS="${CFLAGS}"
|
||||||
|
export LDFLAGS=""
|
||||||
|
|
||||||
|
if [ -d "${NETDATA_MAKESELF_PATH}/tmp/libucontext" ]; then
|
||||||
|
rm -rf "${NETDATA_MAKESELF_PATH}/tmp/libucontext"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cache="${NETDATA_SOURCE_PATH}/artifacts/cache/${BUILDARCH}/libucontext"
|
||||||
|
|
||||||
|
if [ -d "${cache}" ]; then
|
||||||
|
echo "Found cached copy of build directory for libucontext, using it."
|
||||||
|
cp -a "${cache}/libucontext" "${NETDATA_MAKESELF_PATH}/tmp/"
|
||||||
|
CACHE_HIT=1
|
||||||
|
else
|
||||||
|
echo "No cached copy of build directory for libucontext found, fetching sources instead."
|
||||||
|
run git clone --branch "${LIBUCONTEXT_VERSION}" --single-branch --depth 1 "${LIBUCONTEXT_SOURCE}" "${NETDATA_MAKESELF_PATH}/tmp/libucontext"
|
||||||
|
CACHE_HIT=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${NETDATA_MAKESELF_PATH}/tmp/libucontext" || exit 1
|
||||||
|
|
||||||
|
case "${BUILDARCH}" in
|
||||||
|
armv6l|armv7l) arch=arm ;;
|
||||||
|
ppc64le) arch=ppc64 ;;
|
||||||
|
*) arch="${BUILDARCH}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ "${CACHE_HIT:-0}" -eq 0 ]; then
|
||||||
|
run make ARCH="${arch}" EXPORT_UNPREFIXED="yes" -j "$(nproc)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
run make ARCH="${arch}" EXPORT_UNPREFIXED="yes" DESTDIR="/libucontext-static" -j "$(nproc)" install
|
||||||
|
|
||||||
|
store_cache libucontext "${NETDATA_MAKESELF_PATH}/tmp/libucontext"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2015
|
||||||
|
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::endgroup::" || true
|
|
@ -1,9 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
# Can’t do libunwind on ppc64le with musl, so skip it.
|
|
||||||
[ "${BUILDARCH}" = "ppc64le" ] && exit 0
|
|
||||||
|
|
||||||
# shellcheck source=packaging/makeself/functions.sh
|
# shellcheck source=packaging/makeself/functions.sh
|
||||||
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
|
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
|
||||||
# Source of truth for all the packages we bundle in static builds
|
# Source of truth for all the packages we bundle in static builds
|
||||||
|
@ -11,9 +8,9 @@
|
||||||
# shellcheck disable=SC2015
|
# shellcheck disable=SC2015
|
||||||
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building libunwind" || true
|
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building libunwind" || true
|
||||||
|
|
||||||
export CFLAGS="${TUNING_FLAGS} -fno-lto -pipe"
|
export CFLAGS="${TUNING_FLAGS} -I/libucontext-static/usr/include -fno-lto -pipe"
|
||||||
export CXXFLAGS="${CFLAGS}"
|
export CXXFLAGS="${CFLAGS}"
|
||||||
export LDFLAGS="-static"
|
export LDFLAGS="-static -L/libucontext-static/usr/lib/ -lucontext"
|
||||||
export PKG_CONFIG="pkg-config --static"
|
export PKG_CONFIG="pkg-config --static"
|
||||||
|
|
||||||
if [ -d "${NETDATA_MAKESELF_PATH}/tmp/libunwind" ]; then
|
if [ -d "${NETDATA_MAKESELF_PATH}/tmp/libunwind" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue