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.
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.
config.gypi? I don't see that file. May be you mean openssl_common.gypi?
config.gypi is created when you run configure/configure.py.
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).
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.
I'm working on a fix for this issue.
@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++ -
@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, notgcc_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-declarationhaving been added in gcc 4.3. It's obsolete and can be removed.
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
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.
Thanks.