Skip to content

Commit c4fcd5f

Browse files
do sanity check that the -Wa,-mbranches-within-32B-boundaries is supported for cases where CC=gcc is really clang
1 parent 5ecacfd commit c4fcd5f

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

configure.ac

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,21 @@ DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_WOLFSSL"
178178
LIB_ADD=
179179
LIB_STATIC_ADD=
180180

181-
EXTRA_OPTS_CFLAGS=
182-
if test "$host_cpu" = "x86_64"
181+
CAN_USE_32B_BOUNDARIES_FLAG=no
182+
AX_CHECK_COMPILE_FLAG([-Wa,-mbranches-within-32B-boundaries],
183+
[CAN_USE_32B_BOUNDARIES_FLAG=yes],
184+
[CAN_USE_32B_BOUNDARIES_FLAG=no],
185+
[-Werror],[])
186+
187+
if test "$CAN_USE_32B_BOUNDARIES_FLAG" = "yes"
183188
then
184-
if test "$CC" = "gcc" || test "$CC" = "icc"
189+
EXTRA_OPTS_CFLAGS=
190+
if test "$host_cpu" = "x86_64"
185191
then
186-
EXTRA_OPTS_CFLAGS="$EXTRA_OPTS_CFLAGS -Wa,-mbranches-within-32B-boundaries -falign-loops=64"
192+
if test "$GCC" = "yes" || test "$CC" = "icc"
193+
then
194+
EXTRA_OPTS_CFLAGS="$EXTRA_OPTS_CFLAGS -Wa,-mbranches-within-32B-boundaries -falign-loops=64"
195+
fi
187196
fi
188197
fi
189198
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS $EXTRA_OPTS_CFLAGS"

0 commit comments

Comments
 (0)