diff --git a/ChangeLog b/ChangeLog index d50df121..663e711c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,7 +10,6 @@ module; fall back to Javascript on these. counterpart. - Added a workaround for Visual Studio 2010 bug causing CPU features not to be detected. - - The library now enables compilation with retpoline by default. - Portability improvements. - Test vectors from Project Wycheproof have been added. - New low-level APIs for arithmetic mod the order of the prime order group: diff --git a/configure.ac b/configure.ac index d4078d71..addf47bf 100644 --- a/configure.ac +++ b/configure.ac @@ -149,6 +149,17 @@ AC_ARG_WITH(ctgrind, ]) ]) +AC_ARG_ENABLE(retpoline, +[AS_HELP_STRING(--enable-retpoline,Use return trampolines for indirect calls)], +[AS_IF([test "x$enableval" = "xyes"], [ + AX_CHECK_COMPILE_FLAG([-mindirect-branch=thunk-inline], + [CFLAGS="$CFLAGS -mindirect-branch=thunk-inline"], + [AX_CHECK_COMPILE_FLAG([-mretpoline], [CFLAGS="$CFLAGS -mretpoline"])] + ) + AX_CHECK_COMPILE_FLAG([-mindirect-branch-register]) + ]) +]) + ENABLE_CWFLAGS=no AC_ARG_ENABLE(debug, [AS_HELP_STRING(--enable-debug,For maintainers only - please do not use)], @@ -197,13 +208,6 @@ AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [ [CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"]) ]) -AS_IF([test "x$EMSCRIPTEN" = "x" -a "$host_os" != "pnacl"], [ - AX_CHECK_COMPILE_FLAG([-mindirect-branch=thunk], - [CFLAGS="$CFLAGS -mindirect-branch=thunk"], - [AX_CHECK_COMPILE_FLAG([-mretpoline], [CFLAGS="$CFLAGS -mretpoline"])] - ) -]) - AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CFLAGS="$CFLAGS -fvisibility=hidden"])