HomePhabricator

[secp256k1] build: Improve `SECP_TRY_APPEND_DEFAULT_CFLAGS` macro

Description

[secp256k1] build: Improve SECP_TRY_APPEND_DEFAULT_CFLAGS macro

Summary:

While the SECP_TRY_APPEND_DEFAULT_CFLAGS macro works with the current compiler flag set, it is not perfect.

For example, it will accept -fvisibility-inlines-hidden flag, which actually causes:

cc1: warning: command-line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C

This PR improves robustness of the SECP_TRY_APPEND_DEFAULT_CFLAGS macro.

FWIW, the same approach is used in our CMake-based build system, and in Bitcoin Core.

Co-authored-by: Tim Ruffing <crypto@timruffing.de>

This is a backport of secp256k1#1241

Test Plan:
build wit autotools

cd src/secp256k1
./autogen.sh
mkdir build && cd build
../configure
make

Reviewers: #bitcoin_abc, bytesofman

Reviewed By: #bitcoin_abc, bytesofman

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

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Mar 26 2023, 09:38
PiRKCommitted on Apr 17 2026, 12:43
PiRKPushed on Apr 17 2026, 12:43
Reviewer
Restricted Project
Differential Revision
D19847: [secp256k1] build: Improve `SECP_TRY_APPEND_DEFAULT_CFLAGS` macro
Parents
rABCae130cf08d7b: [secp256k1] Set ARM ASM symbol visibility to `hidden`
Branches
Unknown
Tags
Unknown