I'm compiling Node.js for a foreign system (Scientific Linux) and I'm getting this error on compilation. I have checked the prerequisites for building Node in the README and I have Python installed and my version of make is 3.81. I'm not sure why that flag throws cc1 off...
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/nick/node_src/out'
...
...
...
cc '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DL_ENDIAN' '-DOPENSSL_THREADS' '-DPURIFY' '-D_REENTRANT' '-DOPENSSL_NO_DGRAM' '-DOPENSSL_NO_DTLS1' '-DOPENSSL_NO_SCTP' '-DOPENSSL_NO_SOCK' '-DOPENSSL_NO_RDRAND' '-DOPENSSL_NO_GOST' '-DOPENSSL_NO_HW_PADLOCK' '-DENGINESDIR="/dev/null"' '-DOPENSSLDIR="/etc/ssl"' '-DTERMIOS' -I../deps/openssl -I../deps/openssl/openssl -I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/asn1 -I../deps/openssl/openssl/crypto/evp -I../deps/openssl/openssl/crypto/md2 -I../deps/openssl/openssl/crypto/modes -I../deps/openssl/openssl/crypto/store -I../deps/openssl/openssl/include -I../deps/openssl/config/k8 -Wall -Wextra -Wno-unused-parameter -pthread -m64 -Wno-missing-field-initializers -Wno-old-style-declaration -O2 -fno-strict-aliasing -fno-tree-vrp -fno-tree-sink -MMD -MF /home/nick/node_src/out/Release/.deps//home/nick/node_src/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/bio_ssl.o.d.raw -c -o /home/nick/node_src/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/bio_ssl.o ../deps/openssl/openssl/ssl/bio_ssl.c
cc1: error: unrecognized command line option "-Wno-old-style-declaration"
make[1]: *** [/home/nick/node_src/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/bio_ssl.o] Error 1
make[1]: Leaving directory `/home/nick/node_src/out'
make: *** [node] Error 2
Thanks!
This error has come from cc1
(part of GCC), so has nothing to do with make.
The -W[no-]old-style-declaration
warning option was introduced in this GCC change in early 2007, and likely first appeared in GCC 4.3. So it would appear that your GCC predates 4.3.
You could fix this by upgrading GCC, but it would probably be preferable to stick with the GCC that Scientific Linux provides. Conceivably Node.js has a configuration option to control this, or more likely you can just manually edit out -Wno-old-style-declaration
from wherever it appears in the makefile sources.
If Node.js's README does not list GCC 4.3 as a prerequisite, you might want to point this out to the Node.js maintainers.
This dependancy has been confirmed in this node issue, and there is a patch you can use. (Worked for me!)
A workaround would be to (temporarily) switch to a older version of Node which doesnt contain this dependancy.