Page MenuHomePhabricator

[secp256k1] build: Improve `SECP_TRY_APPEND_DEFAULT_CFLAGS` macro
ClosedPublic

Authored by PiRK on Apr 16 2026, 08:55.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Apr 16 2026, 08:55

Tail of the build log:

      at Object.<anonymous> (../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/client.js:37:20)
      at Object.<anonymous> (../node_modules/.pnpm/@testing-library+react@16.3.2_@testing-library+dom@10.4.1_@types+react-dom@19.2.3_@type_7582ba9fea33608682f607e03268f97e/node_modules/@testing-library/react/dist/pure.js:45:46)
      at Object.<anonymous> (../node_modules/.pnpm/@testing-library+react@16.3.2_@testing-library+dom@10.4.1_@types+react-dom@19.2.3_@type_7582ba9fea33608682f607e03268f97e/node_modules/@testing-library/react/dist/index.js:7:13)
      at Object.require (src/components/Receive/__tests__/QRCode.test.js:6:1)

FAIL src/components/Common/__tests__/UncontrolledLink.test.tsx
  ● Test suite failed to run

    Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
      - react:      19.2.3
      - react-dom:  19.2.5
    Learn more: https://react.dev/warnings/version-mismatch

       6 | import { ThemeProvider } from 'styled-components';
       7 | import { theme } from 'assets/styles/theme';
    >  8 | import { render, screen } from '@testing-library/react';
         | ^
       9 | import '@testing-library/jest-dom';
      10 | import UncontrolledLink from 'components/Common/UncontrolledLink';
      11 | import { MemoryRouter } from 'react-router';

      at ../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.development.js:27935:15
      at ../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.development.js:27940:7
      at Object.<anonymous> (../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.development.js:28121:5)
      at Object.<anonymous> (../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/client.js:37:20)
      at Object.<anonymous> (../node_modules/.pnpm/@testing-library+react@16.3.2_@testing-library+dom@10.4.1_@types+react-dom@19.2.3_@type_7582ba9fea33608682f607e03268f97e/node_modules/@testing-library/react/dist/pure.js:45:46)
      at Object.<anonymous> (../node_modules/.pnpm/@testing-library+react@16.3.2_@testing-library+dom@10.4.1_@types+react-dom@19.2.3_@type_7582ba9fea33608682f607e03268f97e/node_modules/@testing-library/react/dist/index.js:7:13)
      at Object.require (src/components/Common/__tests__/UncontrolledLink.test.tsx:8:1)

FAIL src/wallet/__tests__/useWallet.test.js
  ● Test suite failed to run

    Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
      - react:      19.2.3
      - react-dom:  19.2.5
    Learn more: https://react.dev/warnings/version-mismatch

      4 |
      5 | import useWallet from 'wallet/useWallet';
    > 6 | import { renderHook, waitFor, act } from '@testing-library/react';
        | ^
      7 | import 'fake-indexeddb/auto';
      8 | import localforage from 'localforage';
      9 | import { FEE_SATS_PER_KB_XEC_MINIMUM } from 'constants/transactions';

      at ../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.development.js:27935:15
      at ../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.development.js:27940:7
      at Object.<anonymous> (../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.development.js:28121:5)
      at Object.<anonymous> (../node_modules/.pnpm/react-dom@19.2.5_react@19.2.3/node_modules/react-dom/client.js:37:20)
      at Object.<anonymous> (../node_modules/.pnpm/@testing-library+react@16.3.2_@testing-library+dom@10.4.1_@types+react-dom@19.2.3_@type_7582ba9fea33608682f607e03268f97e/node_modules/@testing-library/react/dist/pure.js:45:46)
      at Object.<anonymous> (../node_modules/.pnpm/@testing-library+react@16.3.2_@testing-library+dom@10.4.1_@types+react-dom@19.2.3_@type_7582ba9fea33608682f607e03268f97e/node_modules/@testing-library/react/dist/index.js:7:13)
      at Object.require (src/wallet/__tests__/useWallet.test.js:6:1)


Test Suites: 28 failed, 15 passed, 43 total
Tests:       933 passed, 933 total
Snapshots:   0 total
Time:        11.114 s
 ELIFECYCLE  Test failed. See above for more details.
Build cashtab-tests failed with exit code 1
This revision is now accepted and ready to land.Apr 17 2026, 00:07