Browse Source

Tweak static build process to improve build speed and debuggability. (#12708)

- Switch from `-O3` to `-O2` for optimization CFLAGS, bringing us
  in-line with all of our other builds. This should help avoid strange
  edge cases specific to static builds resulting from the build process.
- Stop stripping binaries in static builds so that we can get proper
  symbolic backtraces when the agent crashes in the static builds.
Austin S. Hemmelgarn 2 years ago
parent
commit
2946bd8c00
1 changed files with 1 additions and 7 deletions
  1. 1 7
      packaging/makeself/jobs/70-netdata-git.install.sh

+ 1 - 7
packaging/makeself/jobs/70-netdata-git.install.sh

@@ -7,7 +7,7 @@
 cd "${NETDATA_SOURCE_PATH}" || exit 1
 
 if [ "${NETDATA_BUILD_WITH_DEBUG}" -eq 0 ]; then
-  export CFLAGS="-static -O3 -I/openssl-static/include"
+  export CFLAGS="-static -O2 -I/openssl-static/include"
 else
   export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness -fstack-protector-all -D_FORTIFY_SOURCE=2 -DNETDATA_INTERNAL_CHECKS=1 -I/openssl-static/include"
 fi
@@ -54,11 +54,5 @@ if run readelf -l "${NETDATA_INSTALL_PATH}"/bin/netdata | grep 'INTERP'; then
   exit 1
 fi
 
-if [ "${NETDATA_BUILD_WITH_DEBUG}" -eq 0 ]; then
-  run strip "${NETDATA_INSTALL_PATH}"/bin/netdata
-  run strip "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/apps.plugin
-  run strip "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/cgroup-network
-fi
-
 # shellcheck disable=SC2015
 [ "${GITHUB_ACTIONS}" = "true" ] && echo "::endgroup::" || true