Skip to content

Commit d94a37a

Browse files
build: Remove CC_FOR_BUILD stuff
1 parent ad63bb4 commit d94a37a

File tree

3 files changed

+0
-217
lines changed

3 files changed

+0
-217
lines changed

.cirrus.yml

-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ task:
294294
- name: "UBSan, ASan, LSan"
295295
env:
296296
CFLAGS: "-fsanitize=undefined,address -g"
297-
CFLAGS_FOR_BUILD: "-fsanitize=undefined,address -g"
298297
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
299298
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
300299
LSAN_OPTIONS: "use_unaligned=1"

build-aux/m4/ax_prog_cc_for_build.m4

-125
This file was deleted.

configure.ac

-91
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,7 @@ AC_PATH_TOOL(AR, ar)
1919
AC_PATH_TOOL(RANLIB, ranlib)
2020
AC_PATH_TOOL(STRIP, strip)
2121

22-
# Save definition of AC_PROG_CC because AM_PROG_CC_C_O in automake<=1.13 will
23-
# redefine AC_PROG_CC to exit with an error, which avoids the user calling it
24-
# accidentally and screwing up the effect of AM_PROG_CC_C_O. However, we'll need
25-
# AC_PROG_CC later on in AX_PROG_CC_FOR_BUILD, where its usage is fine, and
26-
# we'll carefully make sure not to call AC_PROG_CC anywhere else.
27-
m4_copy([AC_PROG_CC], [saved_AC_PROG_CC])
2822
AM_PROG_CC_C_O
29-
# Restore AC_PROG_CC
30-
m4_rename_force([saved_AC_PROG_CC], [AC_PROG_CC])
31-
3223
AC_PROG_CC_C89
3324
if test x"$ac_cv_prog_cc_c89" = x"no"; then
3425
AC_MSG_ERROR([c89 compiler support required])
@@ -208,7 +199,6 @@ else
208199
# We still add it here because passing it twice is not an issue, and handling
209200
# this case would just add unnecessary complexity (see #896).
210201
SECP_CFLAGS="-O2 $SECP_CFLAGS"
211-
SECP_CFLAGS_FOR_BUILD="-O2 $SECP_CFLAGS_FOR_BUILD"
212202
fi
213203

214204
if test x"$req_asm" = x"auto"; then
@@ -320,77 +310,6 @@ fi
320310
# Add -Werror and similar flags passed from the outside (for testing, e.g., in CI)
321311
SECP_CFLAGS="$SECP_CFLAGS $WERROR_CFLAGS"
322312

323-
# Handle static precomputation (after everything which modifies CFLAGS and friends)
324-
if test x"$use_ecmult_static_precomputation" != x"no"; then
325-
if test x"$cross_compiling" = x"no"; then
326-
set_precomp=yes
327-
if test x"${CC_FOR_BUILD+x}${CFLAGS_FOR_BUILD+x}${CPPFLAGS_FOR_BUILD+x}${LDFLAGS_FOR_BUILD+x}" != x; then
328-
AC_MSG_WARN([CC_FOR_BUILD, CFLAGS_FOR_BUILD, CPPFLAGS_FOR_BUILD, and/or LDFLAGS_FOR_BUILD is set but ignored because we are not cross-compiling.])
329-
fi
330-
# If we're not cross-compiling, simply use the same compiler for building the static precompation code.
331-
CC_FOR_BUILD="$CC"
332-
CPPFLAGS_FOR_BUILD="$CPPFLAGS"
333-
SECP_CFLAGS_FOR_BUILD="$SECP_CFLAGS"
334-
CFLAGS_FOR_BUILD="$CFLAGS"
335-
LDFLAGS_FOR_BUILD="$LDFLAGS"
336-
else
337-
AX_PROG_CC_FOR_BUILD
338-
339-
# Temporarily switch to an environment for the native compiler
340-
save_cross_compiling=$cross_compiling
341-
cross_compiling=no
342-
SAVE_CC="$CC"
343-
CC="$CC_FOR_BUILD"
344-
SAVE_CPPFLAGS="$CPPFLAGS"
345-
CPPFLAGS="$CPPFLAGS_FOR_BUILD"
346-
SAVE_CFLAGS="$CFLAGS"
347-
CFLAGS="$CFLAGS_FOR_BUILD"
348-
SAVE_LDFLAGS="$LDFLAGS"
349-
LDFLAGS="$LDFLAGS_FOR_BUILD"
350-
351-
SECP_TRY_APPEND_DEFAULT_CFLAGS(SECP_CFLAGS_FOR_BUILD)
352-
353-
AC_MSG_CHECKING([for working native compiler: ${CC_FOR_BUILD}])
354-
AC_RUN_IFELSE(
355-
[AC_LANG_PROGRAM([], [])],
356-
[working_native_cc=yes],
357-
[working_native_cc=no],[:])
358-
359-
# Restore the environment
360-
cross_compiling=$save_cross_compiling
361-
CC="$SAVE_CC"
362-
CPPFLAGS="$SAVE_CPPFLAGS"
363-
CFLAGS="$SAVE_CFLAGS"
364-
LDFLAGS="$SAVE_LDFLAGS"
365-
366-
if test x"$working_native_cc" = x"no"; then
367-
AC_MSG_RESULT([no])
368-
set_precomp=no
369-
m4_define([please_set_for_build], [Please set CC_FOR_BUILD, CPPFLAGS_FOR_BUILD, CFLAGS_FOR_BUILD, and/or LDFLAGS_FOR_BUILD.])
370-
if test x"$use_ecmult_static_precomputation" = x"yes"; then
371-
AC_MSG_ERROR([native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
372-
else
373-
AC_MSG_WARN([Disabling statically generated ecmult table because the native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
374-
fi
375-
else
376-
AC_MSG_RESULT([yes])
377-
set_precomp=yes
378-
fi
379-
fi
380-
381-
AC_SUBST(CC_FOR_BUILD)
382-
AC_SUBST(CPPFLAGS_FOR_BUILD)
383-
AC_SUBST(SECP_CFLAGS_FOR_BUILD)
384-
AC_SUBST(CFLAGS_FOR_BUILD)
385-
AC_SUBST(LDFLAGS_FOR_BUILD)
386-
else
387-
set_precomp=no
388-
fi
389-
390-
if test x"$set_precomp" = x"yes"; then
391-
AC_DEFINE(USE_ECMULT_STATIC_PRECOMPUTATION, 1, [Define this symbol to use a statically generated ecmult table])
392-
fi
393-
394313
###
395314
### Handle module options
396315
###
@@ -456,7 +375,6 @@ AM_CONDITIONAL([ENABLE_COVERAGE], [test x"$enable_coverage" = x"yes"])
456375
AM_CONDITIONAL([USE_TESTS], [test x"$use_tests" != x"no"])
457376
AM_CONDITIONAL([USE_EXHAUSTIVE_TESTS], [test x"$use_exhaustive_tests" != x"no"])
458377
AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" = x"yes"])
459-
AM_CONDITIONAL([USE_ECMULT_STATIC_PRECOMPUTATION], [test x"$set_precomp" = x"yes"])
460378
AM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x"$enable_module_ecdh" = x"yes"])
461379
AM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x"$enable_module_recovery" = x"yes"])
462380
AM_CONDITIONAL([ENABLE_MODULE_EXTRAKEYS], [test x"$enable_module_extrakeys" = x"yes"])
@@ -473,7 +391,6 @@ AC_OUTPUT
473391

474392
echo
475393
echo "Build Options:"
476-
echo " with ecmult precomp = $set_precomp"
477394
echo " with external callbacks = $use_external_default_callbacks"
478395
echo " with benchmarks = $use_benchmark"
479396
echo " with tests = $use_tests"
@@ -497,11 +414,3 @@ echo " CPPFLAGS = $CPPFLAGS"
497414
echo " SECP_CFLAGS = $SECP_CFLAGS"
498415
echo " CFLAGS = $CFLAGS"
499416
echo " LDFLAGS = $LDFLAGS"
500-
echo
501-
if test x"$set_precomp" = x"yes"; then
502-
echo " CC_FOR_BUILD = $CC_FOR_BUILD"
503-
echo " CPPFLAGS_FOR_BUILD = $CPPFLAGS_FOR_BUILD"
504-
echo " SECP_CFLAGS_FOR_BUILD = $SECP_CFLAGS_FOR_BUILD"
505-
echo " CFLAGS_FOR_BUILD = $CFLAGS_FOR_BUILD"
506-
echo " LDFLAGS_FOR_BUILD = $LDFLAGS_FOR_BUILD"
507-
fi

0 commit comments

Comments
 (0)