0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-02 20:48:06 +00:00

Build optimizations ()

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>
This commit is contained in:
Tasos Katsoulas 2023-07-18 15:05:49 +03:00 committed by GitHub
parent 90a4976bac
commit 2d4e91ab50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View file

@ -28,8 +28,8 @@ 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 && \
CFLAGS="$(packaging/docker/gen-cflags.sh)" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \
${EXTRA_INSTALL_OPTS} --one-time-build "$([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)"
CFLAGS="$(packaging/docker/gen-cflags.sh)" LDFLAGS="-Wl,--gc-sections" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \
${EXTRA_INSTALL_OPTS} --one-time-build --enable-lto "$([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)"
# files to one directory
RUN mkdir -p /app/usr/sbin/ \

View file

@ -3,7 +3,7 @@
if [ -n "${CFLAGS}" ]; then
echo "${CFLAGS}"
elif [ -n "${DEBUG_BUILD}" ]; then
echo "-Og -ggdb -pipe"
echo "-ffunction-sections -fdata-sections -Og -ggdb -pipe"
else
echo "-O2 -pipe"
echo "-ffunction-sections -fdata-sections -O2 -funroll-loops -pipe"
fi

View file

@ -7,12 +7,12 @@
cd "${NETDATA_SOURCE_PATH}" || exit 1
if [ "${NETDATA_BUILD_WITH_DEBUG}" -eq 0 ]; then
export CFLAGS="-static -O2 -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/usr/include/libmnl -pipe"
export CFLAGS="-ffunction-sections -fdata-sections -static -O2 -funroll-loops -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/usr/include/libmnl -pipe"
else
export CFLAGS="-static -O1 -pipe -ggdb -Wall -Wextra -Wformat-signedness -DNETDATA_INTERNAL_CHECKS=1 -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/usr/include/libmnl"
fi
export LDFLAGS="-static -L/openssl-static/lib -L/libnetfilter-acct-static/lib -lnetfilter_acct -L/usr/lib -lmnl"
export LDFLAGS="-Wl,--gc-sections -static -L/openssl-static/lib -L/libnetfilter-acct-static/lib -lnetfilter_acct -L/usr/lib -lmnl"
# We export this to 'yes', installer sets this to .environment.
# The updater consumes this one, so that it can tell whether it should update a static install or a non-static one
@ -34,7 +34,8 @@ run ./netdata-installer.sh \
--require-cloud \
--use-system-protobuf \
--dont-scrub-cflags-even-though-it-may-break-things \
--one-time-build
--one-time-build \
--enable-lto
# shellcheck disable=SC2015
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Finishing netdata install" || true