Does not compile on gcc <4.3 (engineyard) #4186

fx opened this Issue Oct 23, 2012 · 4 comments

3 participants

fx commented Oct 23, 2012

d3fa0dc breaks compilation with GCC older than 4.3


(Via John Marshall on SO:

EngineYard's current stack uses gcc version 4.1.2 and while grepping out that line in a cookbook is rather easy if you know what's happening, it might be preferable to have some extra output instead of confusing people that might not be able to figure this out.

Node.js Foundation member

gcc 4.1.2... maybe they should consider upgrading.

Can you try this patch? Re-run configure after applying it.

diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp
index 3f4a7fa..297d3de 100644
--- a/deps/openssl/openssl.gyp
+++ b/deps/openssl/openssl.gyp
@@ -3,6 +3,11 @@
 # found in the LICENSE file.

+  'variables': {
+    'is_clang': 0,
+    'gcc_version': 0,
+  },
   'targets': [
       'target_name': 'openssl',
@@ -674,10 +679,10 @@
-          'cflags': [
-            '-Wno-missing-field-initializers',
-            '-Wno-old-style-declaration',
-          ],
+          'cflags': ['-Wno-missing-field-initializers'],
+        }],
+        ['is_clang==1 or gcc_version>=43', {
+          'cflags': ['-Wno-old-style-declaration'],
         ['OS=="solaris"', {
           'defines': ['__EXTENSIONS__'],

I was experiencing the same problem (while installing Node on a Synology NAS), and this patch seems to work.
Now I am running into another (unrelated) error, but the 'MAKE' command now proceeds beyond the original error.

(And yes, gcc 4.1 is ancient, but it is not always an option to upgrade)

fx commented Oct 29, 2012

Oh, I stepped away there for a minute. I'll be working on some EY stuff tomorrow, I'll confirm if it works then.

@bnoordhuis bnoordhuis added a commit that closed this issue Dec 3, 2012
@bnoordhuis bnoordhuis build: avoid -Wno-old-style-declaration with gcc 4.2
Fixes the build on FreeBSD <= 9 with the default compiler.

Fixes #4186.
@bnoordhuis bnoordhuis closed this in f8999da Dec 3, 2012
Node.js Foundation member

Fixed in f8999da.

@knu knu pushed a commit to idaemons/freebsd-ports that referenced this issue Apr 13, 2014
jhale MFH r307220
- Fix build with base gcc

Reported by:	pointyhat via beat
Approved by:	portmgr (tabthorpe)
		makc, avilla (mentors, implicit)
Obtained from:	nodejs/node-v0.x-archive#4186
Feature safe:	yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment