Skip to content

Commit cad1272

Browse files
committed
Merge bitcoin/bitcoin#30257: build: Remove --enable-gprof
fa780e1 build: Remove --enable-gprof (MarcoFalke) Pull request description: It is unclear what benefit this option has, given that: * `gprof` requires re-compilation (`perf` and other tools can instead be used on existing executables) * `gprof` requires hardening to be disabled * `gprof` doesn't work with `clang` * `perf` is documented in the dev-notes, and test notes, and embedded into the functional test framework; `gprof` isn't * Anyone really wanting to use it could pass the required flags to `./configure` * I couldn't find any mention of the use of `gprof` in the discussions in this repo, apart from the initial pull request adding it (cfaac2a) * Keeping it means that it needs to be maintained and ported to CMake Fix all issues by removing it. ACKs for top commit: TheCharlatan: ACK fa780e1 hebasto: ACK fa780e1, I have reviewed the code and it looks OK. willcl-ark: crACK fa780e1 Tree-SHA512: 0a9ff363ac2bec8b743878a4e3147f18bc16823d00c5007568432c36320bd0199b13b6d0ce828a9a83c2cc434c058afaa64eb2eccfbd93ed85b81ce10c41760c
2 parents bd642ee + fa780e1 commit cad1272

File tree

3 files changed

+6
-39
lines changed

3 files changed

+6
-39
lines changed

configure.ac

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ AC_ARG_WITH([qrencode],
206206

207207
AC_ARG_ENABLE([hardening],
208208
[AS_HELP_STRING([--disable-hardening],
209-
[do not attempt to harden the resulting executables (default is to harden when possible)])],
209+
[do not attempt to harden the resulting executables (default is to harden)])],
210210
[use_hardening=$enableval],
211-
[use_hardening=auto])
211+
[use_hardening=yes])
212212

213213
AC_ARG_ENABLE([reduce-exports],
214214
[AS_HELP_STRING([--enable-reduce-exports],
@@ -281,13 +281,6 @@ AC_ARG_WITH([sanitizers],
281281
[comma separated list of extra sanitizers to build with (default is none enabled)])],
282282
[use_sanitizers=$withval])
283283

284-
dnl Enable gprof profiling
285-
AC_ARG_ENABLE([gprof],
286-
[AS_HELP_STRING([--enable-gprof],
287-
[use gprof profiling compiler flags (default is no)])],
288-
[enable_gprof=$enableval],
289-
[enable_gprof=no])
290-
291284
dnl Turn warnings into errors
292285
AC_ARG_ENABLE([werror],
293286
[AS_HELP_STRING([--enable-werror],
@@ -844,30 +837,12 @@ if test "$ac_cv_sys_large_files" != "" &&
844837
CORE_CPPFLAGS="$CORE_CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
845838
fi
846839

847-
if test "$enable_gprof" = "yes"; then
848-
dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense,
849-
dnl we simply make them mutually exclusive here. Additionally, hardened toolchains may force
850-
dnl -pie by default, in which case it needs to be turned off with -no-pie.
851-
852-
if test "$use_hardening" = "yes"; then
853-
AC_MSG_ERROR([gprof profiling is not compatible with hardening. Reconfigure with --disable-hardening or --disable-gprof])
854-
fi
855-
use_hardening=no
856-
AX_CHECK_COMPILE_FLAG([-pg],[GPROF_CXXFLAGS="-pg"],
857-
[AC_MSG_ERROR([gprof profiling requested but not available])], [$CXXFLAG_WERROR])
858-
859-
AX_CHECK_LINK_FLAG([-no-pie], [GPROF_LDFLAGS="-no-pie"])
860-
AX_CHECK_LINK_FLAG([-pg], [GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"],
861-
[AC_MSG_ERROR([gprof profiling requested but not available])], [$GPROF_LDFLAGS])
862-
fi
863-
864840
if test "$TARGET_OS" != "windows"; then
865841
dnl All windows code is PIC, forcing it on just adds useless compile warnings
866842
AX_CHECK_COMPILE_FLAG([-fPIC], [PIC_FLAGS="-fPIC"])
867843
fi
868844

869845
if test "$use_hardening" != "no"; then
870-
use_hardening=yes
871846
AX_CHECK_COMPILE_FLAG([-Wstack-protector], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
872847
AX_CHECK_COMPILE_FLAG([-fstack-protector-all], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
873848

@@ -1684,8 +1659,6 @@ AC_SUBST(WARN_CXXFLAGS)
16841659
AC_SUBST(NOWARN_CXXFLAGS)
16851660
AC_SUBST(DEBUG_CXXFLAGS)
16861661
AC_SUBST(ERROR_CXXFLAGS)
1687-
AC_SUBST(GPROF_CXXFLAGS)
1688-
AC_SUBST(GPROF_LDFLAGS)
16891662
AC_SUBST(HARDENED_CXXFLAGS)
16901663
AC_SUBST(HARDENED_CPPFLAGS)
16911664
AC_SUBST(HARDENED_LDFLAGS)
@@ -1793,7 +1766,6 @@ echo " with natpmp = $use_natpmp"
17931766
echo " USDT tracing = $use_usdt"
17941767
echo " sanitizers = $use_sanitizers"
17951768
echo " debug enabled = $enable_debug"
1796-
echo " gprof enabled = $enable_gprof"
17971769
echo " werror = $enable_werror"
17981770
echo
17991771
echo " target os = $host_os"
@@ -1803,8 +1775,8 @@ echo " CC = $CC"
18031775
echo " CFLAGS = $PTHREAD_CFLAGS $SANITIZER_CFLAGS $CFLAGS"
18041776
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS $CPPFLAGS"
18051777
echo " CXX = $CXX"
1806-
echo " CXXFLAGS = $CORE_CXXFLAGS $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $SANITIZER_CXXFLAGS $CXXFLAGS"
1807-
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $SANITIZER_LDFLAGS $CORE_LDFLAGS $LDFLAGS"
1778+
echo " CXXFLAGS = $CORE_CXXFLAGS $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $SANITIZER_CXXFLAGS $CXXFLAGS"
1779+
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $SANITIZER_LDFLAGS $CORE_LDFLAGS $LDFLAGS"
18081780
echo " AR = $AR"
18091781
echo " ARFLAGS = $ARFLAGS"
18101782
echo

doc/developer-notes.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Developer Notes
1313
- [Development tips and tricks](#development-tips-and-tricks)
1414
- [Compiling for debugging](#compiling-for-debugging)
1515
- [Show sources in debugging](#show-sources-in-debugging)
16-
- [Compiling for gprof profiling](#compiling-for-gprof-profiling)
1716
- [`debug.log`](#debuglog)
1817
- [Signet, testnet, and regtest modes](#signet-testnet-and-regtest-modes)
1918
- [DEBUG_LOCKORDER](#debug_lockorder)
@@ -386,10 +385,6 @@ ln -s /path/to/project/root/src src
386385

387386
3. Use `debugedit` to modify debug information in the binary.
388387

389-
### Compiling for gprof profiling
390-
391-
Run configure with the `--enable-gprof` option, then make.
392-
393388
### `debug.log`
394389

395390
If the code is behaving strangely, take a look in the `debug.log` file in the data directory;

src/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ print-%: FORCE
88

99
DIST_SUBDIRS = secp256k1
1010

11-
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) $(CORE_LDFLAGS)
12-
AM_CXXFLAGS = $(CORE_CXXFLAGS) $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS)
11+
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(SANITIZER_LDFLAGS) $(CORE_LDFLAGS)
12+
AM_CXXFLAGS = $(CORE_CXXFLAGS) $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(SANITIZER_CXXFLAGS)
1313
AM_OBJCXXFLAGS = $(AM_CXXFLAGS)
1414
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) $(CORE_CPPFLAGS)
1515
AM_LIBTOOLFLAGS = --preserve-dup-deps

0 commit comments

Comments
 (0)