Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tons of unknown warning option '-Wno-old-style-declaration' when compiling openssl #25550

Closed
ibc opened this issue Jan 17, 2019 · 11 comments
Closed
Labels
build Issues and PRs related to build files or the CI. help wanted Issues that need assistance from volunteers or PRs that need help to proceed.

Comments

@ibc
Copy link

ibc commented Jan 17, 2019

Version: v10.13.0
Platform: Linux e4b2ecc253f9 4.9.125-linuxkit x86_64 GNU/Linux (Docker in Mac)
clang version: 7.0.0 (tags/RELEASE_700/final)

When compiling openssl tons of warning are printed like this:

warning: unknown warning option '-Wno-old-style-declaration'; did you mean '-Wno-out-of-line-declaration'? [-Wunknown-warning-option]
1 warning generated.
  CC(target) /mediasoup/worker/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/x509v3/v3_akeya.o

It does not happen when using GCC compiler, but just with clang, which seems to not support
this option the cause.

@bnoordhuis bnoordhuis added the build Issues and PRs related to build files or the CI. label Jan 17, 2019
@bnoordhuis
Copy link
Member

There's even an old comment about that in deps/openssl/openssl_common.gypi: :)

TODO: check gcc_version>=4.3

configure.py already knows the gcc version (search for gcc_version) but it needs to be taught to store it in config.gypi. Shouldn't be too hard, pull request welcome.

@bnoordhuis bnoordhuis added the help wanted Issues that need assistance from volunteers or PRs that need help to proceed. label Jan 17, 2019
@ibc
Copy link
Author

ibc commented Jan 17, 2019

config.gypi? I don't see that file. May be you mean openssl_common.gypi?

@bnoordhuis
Copy link
Member

config.gypi is created when you run configure/configure.py.

@richardlau
Copy link
Member

There's even an old comment about that in deps/openssl/openssl_common.gypi: :)

TODO: check gcc_version>=4.3

configure.py already knows the gcc version (search for gcc_version) but it needs to be taught to store it in config.gypi. Shouldn't be too hard, pull request welcome.

It would probably be better to check for clang rather than the gcc version (the minimum supported version of gcc to compile Node.js is > 4.3).

@bnoordhuis
Copy link
Member

Urgh, that's what I mean: clang_version, not gcc_version. It needs to be threaded through from configure.py to config.gypi to openssl_common.gypi.

The comment in openssl_common.gypi is about -Wno-old-style-declaration having been added in gcc 4.3. It's obsolete and can be removed.

@thangktran
Copy link
Contributor

I'm working on a fix for this issue.

@thangktran
Copy link
Contributor

thangktran commented Feb 5, 2019

@ibc Could you please try this command and share the output to us

echo "__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ __clang_major__ __clang_minor__ __clang_patchlevel__" | /usr/bin/clang++-7 -E -P -x c++ -

@thangktran
Copy link
Contributor

thangktran commented Feb 5, 2019

@bnoordhuis I believed the config.gypi already has the clang version via ['variables']['llvm_version']. Or did i misunderstand something?

Urgh, that's what I mean: clang_version, not gcc_version. It needs to be threaded through from configure.py to config.gypi to openssl_common.gypi.

The comment in openssl_common.gypi is about -Wno-old-style-declaration having been added in gcc 4.3. It's obsolete and can be removed.

@ibc
Copy link
Author

ibc commented Feb 5, 2019

Hi @thangktran:

root@74d46ab05a0f:/ uname -a
Linux 74d46ab05a0f 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

root@74d46ab05a0f:/ /usr/local/bin/clang++ --version
clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

root@74d46ab05a0f:/ echo "__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ __clang_major__ __clang_minor__ __clang_patchlevel__" | /usr/local/bin/clang++ -E -P -x c++ -
1 4 2 1 7 0 0

@thangktran
Copy link
Contributor

it seems to be a problem with clang itself.
Run the simple test and the problem occurs:

testaccount@testmachine:~$ echo "__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ __clang_major__ __clang_minor__ __clang_patchlevel__" | /usr/bin/clang-7 -E -P -Wno-old-style-declaration -
warning: unknown warning option '-Wno-old-style-declaration'; did you mean '-Wno-out-of-line-declaration'? [-Wunknown-warning-option]
1 4 2 1 7 0 0
1 warning generated.

This error appears in clang-5 clang-6 and clang-7.
I will contact clang-dev team and find a solution for this.

thangktran added a commit to thangktran/node that referenced this issue Feb 12, 2019
clang doesn't seem to support 'Wno-old-style-declaration', this
is a work-around.

Fixes: nodejs#25550
Refs: nodejs/node-v0.x-archive#4186
targos pushed a commit that referenced this issue Feb 15, 2019
clang doesn't seem to support 'Wno-old-style-declaration', this
is a work-around.

Fixes: #25550
Refs: nodejs/node-v0.x-archive#4186

PR-URL: #25954
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@ibc
Copy link
Author

ibc commented Feb 17, 2019

Thanks.

rvagg pushed a commit that referenced this issue Feb 28, 2019
clang doesn't seem to support 'Wno-old-style-declaration', this
is a work-around.

Fixes: #25550
Refs: nodejs/node-v0.x-archive#4186

PR-URL: #25954
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. help wanted Issues that need assistance from volunteers or PRs that need help to proceed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants