From c14ec852fa83ab8a36db4654915f870497262e04 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 23 May 2023 23:26:54 +0200 Subject: [PATCH] gh-101282: Group and quote BOLT CLI flags --- configure | 5 ++++- configure.ac | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/configure b/configure index bcf2a5c7c7f73c..a4fa63da16f730 100755 --- a/configure +++ b/configure @@ -8398,8 +8398,11 @@ $as_echo "$BOLT_INSTRUMENT_FLAGS" >&6; } $as_echo_n "checking BOLT_APPLY_FLAGS... " >&6; } if test -z "${BOLT_APPLY_FLAGS}" then - BOLT_APPLY_FLAGS=-update-debug-sections -reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions -icf=1 -inline-all -split-eh -reorder-functions-use-hot-size -peepholes=none -jump-tables=aggressive -inline-ap -indirect-call-promotion=all -dyno-stats -use-gnu-stack -frame-opt=hot + BOLT_GENERIC_OPTIONS=" -dyno-stats -update-debug-sections -use-gnu-stack " + BOLT_OPTIMIZATION_OPTIONS=" -frame-opt=hot -icf=1 -indirect-call-promotion=all -inline-all -inline-ap -jump-tables=aggressive -peepholes=none -reorder-blocks=ext-tsp -reorder-functions-use-hot-size -reorder-functions=hfsort+ -split-eh -split-functions " + + BOLT_APPLY_FLAGS="${BOLT_GENERIC_OPTIONS} ${BOLT_OPTIMIZATION_OPTIONS}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOLT_APPLY_FLAGS" >&5 diff --git a/configure.ac b/configure.ac index d5cb822ae8cb6b..b49ed86f1023f6 100644 --- a/configure.ac +++ b/configure.ac @@ -2085,25 +2085,34 @@ AC_ARG_VAR( AC_MSG_CHECKING([BOLT_APPLY_FLAGS]) if test -z "${BOLT_APPLY_FLAGS}" then + AS_VAR_SET( + [BOLT_GENERIC_OPTIONS], + [m4_normalize([" + -dyno-stats + -update-debug-sections + -use-gnu-stack + "])] + ) + AS_VAR_SET( + [BOLT_OPTIMIZATION_OPTIONS], + [m4_normalize([" + -frame-opt=hot + -icf=1 + -indirect-call-promotion=all + -inline-all + -inline-ap + -jump-tables=aggressive + -peepholes=none + -reorder-blocks=ext-tsp + -reorder-functions-use-hot-size + -reorder-functions=hfsort+ + -split-eh + -split-functions + "])] + ) AS_VAR_SET( [BOLT_APPLY_FLAGS], - [m4_join([ ], - [-update-debug-sections], - [-reorder-blocks=ext-tsp], - [-reorder-functions=hfsort+], - [-split-functions], - [-icf=1], - [-inline-all], - [-split-eh], - [-reorder-functions-use-hot-size], - [-peepholes=none], - [-jump-tables=aggressive], - [-inline-ap], - [-indirect-call-promotion=all], - [-dyno-stats], - [-use-gnu-stack], - [-frame-opt=hot] - )] + ["${BOLT_GENERIC_OPTIONS} ${BOLT_OPTIMIZATION_OPTIONS}"] ) fi AC_MSG_RESULT([$BOLT_APPLY_FLAGS])