Skip to content

build: suppress OpenSSL asm warnings with clang - #66023

Open
richardlau wants to merge 1 commit into
nodejs:mainfrom
richardlau:unusedargs
Open

richardlau wants to merge 1 commit into
nodejs:mainfrom
richardlau:unusedargs

Conversation

@richardlau

@richardlau richardlau commented Sep 14, 2026

Copy link
Copy Markdown
Member

Unlike gcc, clang warns when arguments are passed that are not used. For OpenSSL, this includes passing C preprocessor directives when compiling .s files.

Suppress the warning (-Wno-unused-command-line-argument) when using clang.


Without this we see, e.g.

clang-19: warning: argument unused during compilation: '-MMD' [-Wunused-command-line-argument]
clang-19: warning: argument unused during compilation: '-MF /home/runner/work/node/node/node/out/Release/.deps//home/runner/work/node/node/node/out/Release/obj.target/openssl/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aes-x86_64.o.d.raw' [-Wunused-command-line-argument]
clang-19: warning: argument unused during compilation: '-D _GLIBCXX_USE_CXX11_ABI=1' [-Wunused-command-line-argument]
clang-19: warning: argument unused during compilation: '-D _FILE_OFFSET_BITS=64' [-Wunused-command-line-argument]
clang-19: warning: argument unused during compilation: '-D NODE_OPENSSL_CONF_NAME=nodejs_conf' [-Wunused-command-line-argument]
clang-19: warning: argument unused during compilation: '-D ICU_NO_USER_DATA_OVERRIDE' [-Wunused-command-line-argument]
clang-19: warning: argument unused during compilation: '-D __STDC_FORMAT_MACROS' [-Wunused-command-line-argument]
...
08:01:04 clang-19: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-O3' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-O3' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-O3' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-fno-omit-frame-pointer' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-D _GLIBCXX_USE_CXX11_ABI=1' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-D _FILE_OFFSET_BITS=64' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-D NODE_OPENSSL_CONF_NAME=nodejs_conf' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-D ICU_NO_USER_DATA_OVERRIDE' [-Wunused-command-line-argument]
08:01:04 clang-19: warning: argument unused during compilation: '-D __STDC_FORMAT_MACROS' [-Wunused-command-line-argument]
...

Suppressing the warning for OpenSSL asm when clang is used seems simpler than trying to untangle the .s compilation from .c sources.

Unlike gcc, clang warns when arguments are passed that are not used.
For OpenSSL, this includes passing C preprocessor directives when
compiling `.s` files.

Suppress the warning (`-Wno-command-line-argument`) when using clang.

Signed-off-by: Richard Lau <richard.lau@ibm.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run. openssl Issues and PRs related to the OpenSSL dependency. labels Sep 14, 2026
@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 14, 2026
@panva panva added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 14, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 14, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@richardlau richardlau added the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 15, 2026
@richardlau richardlau self-assigned this Sep 15, 2026
@richardlau richardlau removed the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 15, 2026
@richardlau

Copy link
Copy Markdown
Member Author

Commit message contains a typo (should be -Wno-unused-command-line-argument). Will fix when landing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run. openssl Issues and PRs related to the OpenSSL dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants