HomePhabricator

configure: Use CFLAGS_FOR_BUILD when checking native compiler

Description

configure: Use CFLAGS_FOR_BUILD when checking native compiler

Summary:
This fixes a bug where configure would fail or disable static
ecmult tables because it wrongly checks the native compiler using
the target CFLAGS (instead of the native CFLAGS_FOR_BUILD), and
similar for CPPFLAGS and LDFLAGS.

Moreover, this commit adds tests to figure out whether the native
compiler supports the warning flags passed during the build, and it
contains a few minor improvements to the code that checks the native
compiler.

  • Actually pass CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD to linker

This is a backport of secp256k1 PR584

It does not look like any change is required on the cmake build because it build the native eecutable in a different context altogether.

Test Plan:

make check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D4997

Details

Provenance
Tim Ruffing <crypto@timruffing.de>Authored on Jan 16 2019, 16:12
deadalnixCommitted on Jan 17 2020, 16:15
deadalnixPushed on Jan 17 2020, 16:22
Reviewer
Restricted Project
Differential Revision
D4997: configure: Use CFLAGS_FOR_BUILD when checking native compiler
Parents
rSTAGINGbea9546d907e: Respect LDFLAGS and #undef STATIC_PRECOMPUTATION if using basic config
Branches
Unknown
Tags
Unknown