Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

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

Closed
fx opened this issue Oct 23, 2012 · 4 comments
Closed

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

fx opened this issue Oct 23, 2012 · 4 comments
Labels

Comments

@fx
Copy link

fx commented Oct 23, 2012

d3fa0dc breaks compilation with GCC older than 4.3

See http://gcc.gnu.org/viewcvs?view=revision&revision=120347

(Via John Marshall on SO: http://facebook.stackoverflow.com/questions/13023239/compiling-node-gives-no-old-style-declaration-flag-error/13025257#13025257)

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.

@bnoordhuis
Copy link
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 @@
             'OPENSSLDIR="/etc/ssl"',
             'TERMIOS',
           ],
-          '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__'],

@koesper
Copy link

koesper commented Oct 29, 2012

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
Copy link
Author

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
Copy link
Member

Fixed in f8999da.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants