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

node8 : refreshing patches for HOST build with gcc v6 series #14

Merged
merged 1 commit into from
Jun 28, 2017

Conversation

artynet
Copy link
Contributor

@artynet artynet commented Jun 24, 2017

Pull request for the following patches :

  • 010-execvp-arg-list-too-long.patch

    needed to finalize HOST build on systems running gcc v6 series

  • 011-gyp-force-link-command-to-use-CXX.patch

    forcing CXX link with GYP

  • 012-changing-default-npm-settings.patch

    using loglevel to info and strict-ssl to false for NPM

@nxhack
Copy link
Owner

nxhack commented Jun 26, 2017

Hi @artynet

  • 010-execvp-arg-list-too-long.patch

    needed to finalize HOST build on systems running gcc v6 series

As past LEDE's buildbot, an error occurs on a long pass name. Now it seems modified on the buildbot side, I think that this modification is unnecessary, but how is it?

nodejs/node#9137

  • 011-gyp-force-link-command-to-use-CXX.patch

    forcing CXX link with GYP

I had no problem with cross-compiling.
I would be happy if you could tell me what kind of issues happened.

  • 012-changing-default-npm-settings.patch

    using loglevel to info and strict-ssl to false for NPM

Is there a need for hard-coding?
I think it is better to give it from .npmrc or command line.

@artynet
Copy link
Contributor Author

artynet commented Jun 27, 2017

010-execvp-arg-list-too-long.patch
As past LEDE's buildbot, an error occurs on a long pass name. Now it seems modified on the buildbot side, I think that this modification is unnecessary, but how is it?

I run the build with the latest LEDE SDK on my ubuntu 17.04 x64 vm and bumped into this issue. So at least for my setup is needed....

011-gyp-force-link-command-to-use-CXX.patch
I had no problem with cross-compiling. I would be happy if you could tell me what kind of issues happened.

I hadn't as well but it's just a pedant (and maybe effective somehow in certain cases) measure used in buildroot system

012-changing-default-npm-settings.patch
Is there a need for hard-coding? I think it is better to give it from .npmrc or command line.

I needed to force those settings in my ar71xx build of chaos chalmer for the Yun/Tian

Best, Arturo

@artynet
Copy link
Contributor Author

artynet commented Jun 27, 2017

This instead is my patch to build node8 on chaos calmer running uClibc

diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js
index da019ac4d6..8b81e28940 100644
--- a/deps/npm/lib/config/defaults.js
+++ b/deps/npm/lib/config/defaults.js
@@ -166,7 +166,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
     'legacy-bundling': false,
     link: false,
     'local-address': undefined,
-    loglevel: 'notice',
+    loglevel: 'info',
     logstream: process.stderr,
     'logs-max': 10,
     long: false,
@@ -214,7 +214,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
     'sign-git-tag': false,
     'sso-poll-frequency': 500,
     'sso-type': 'oauth',
-    'strict-ssl': true,
+    'strict-ssl': false,
     tag: 'latest',
     'tag-version-prefix': 'v',
     timing: false,
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
index 64b9dd267b..1ddd95b86b 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
@@ -144,6 +144,30 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
 quiet_cmd_link = LINK($(TOOLSET)) $@
 cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
 
+define xargs
+$(1) $(wordlist 1,1000,$(2))
+$(if $(word 1001,$(2)),$(call xargs,$(1),$(wordlist 1001,$(words $(2)),$(2))))
+endef
+
+define write-to-file
+@: >$(1)
+$(call xargs,@printf "%s\\n" >>$(1),$(2))
+endef
+
+OBJ_FILE_LIST := ar-file-list
+
+define create_archive
+        rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
+define create_thin_archive
+        rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
 # We support two kinds of shared objects (.so):
 # 1) shared_library, which is just bundling together many dependent libraries
 # into a link line.
@@ -188,6 +212,30 @@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
 quiet_cmd_alink_thin = AR($(TOOLSET)) $@
 cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
 
+define xargs
+$(1) $(wordlist 1,1000,$(2))
+$(if $(word 1001,$(2)),$(call xargs,$(1),$(wordlist 1001,$(words $(2)),$(2))))
+endef
+
+define write-to-file
+@: >$(1)
+$(call xargs,@printf "%s\\n" >>$(1),$(2))
+endef
+
+OBJ_FILE_LIST := ar-file-list
+
+define create_archive
+        rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
+define create_thin_archive
+        rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
 # Due to circular dependencies between libraries :(, we wrap the
 # special "figure out circular dependencies" flags around the entire
 # input list during linking.
@@ -1581,11 +1629,17 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
             "Spaces in alink input filenames not supported (%s)"  % link_dep)
       if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not
           self.is_standalone_static_library):
-        self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin',
-                        part_of_all, postbuilds=postbuilds)
+        if self.flavor in ('linux', 'android'):
+          self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_thin_archive,$@,$^)'])
+        else:
+          self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin',
+                          part_of_all, postbuilds=postbuilds)
       else:
-        self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all,
-                        postbuilds=postbuilds)
+        if self.flavor in ('linux', 'android'):
+          self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_archive,$@,$^)'])
+        else:
+          self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all,
+                          postbuilds=postbuilds)
     elif self.type == 'shared_library':
       self.WriteLn('%s: LD_INPUTS := %s' % (
             QuoteSpaces(self.output_binary),
diff --git a/deps/uv/src/unix/getaddrinfo.c b/deps/uv/src/unix/getaddrinfo.c
index 2049aea2f3..dde17b9068 100644
--- a/deps/uv/src/unix/getaddrinfo.c
+++ b/deps/uv/src/unix/getaddrinfo.c
@@ -99,6 +99,7 @@ static void uv__getaddrinfo_work(struct uv__work* w) {
   int err;
 
   req = container_of(w, uv_getaddrinfo_t, work_req);
+  req->hints->ai_flags &= ~AI_V4MAPPED;
   err = getaddrinfo(req->hostname, req->service, req->hints, &req->addrinfo);
   req->retcode = uv__getaddrinfo_translate_error(err);
 }
diff --git a/deps/v8/src/base/cpu.cc b/deps/v8/src/base/cpu.cc
index 896c25dab1..54dcb3ce1d 100644
--- a/deps/v8/src/base/cpu.cc
+++ b/deps/v8/src/base/cpu.cc
@@ -144,6 +144,7 @@ int __detect_fp64_mode(void) {
       ".set push\n\t"
       ".set noreorder\n\t"
       ".set oddspreg\n\t"
+      ".set hardfloat\n\t"
       "lui $t0, 0x3FF0\n\t"
       "ldc1 $f0, %0\n\t"
       "mtc1 $t0, $f1\n\t"
diff --git a/deps/v8/src/base/debug/stack_trace_posix.cc b/deps/v8/src/base/debug/stack_trace_posix.cc
index 87c0a73d19..7064e5de87 100644
--- a/deps/v8/src/base/debug/stack_trace_posix.cc
+++ b/deps/v8/src/base/debug/stack_trace_posix.cc
@@ -25,7 +25,7 @@
 #include <string>
 #include <vector>
 
-#if V8_LIBC_GLIBC || V8_LIBC_BSD || V8_LIBC_UCLIBC || V8_OS_SOLARIS
+#if V8_LIBC_GLIBC || V8_LIBC_BSD || V8_OS_SOLARIS
 #define HAVE_EXECINFO_H 1
 #endif
 
diff --git a/deps/v8/src/compiler/node-matchers.h b/deps/v8/src/compiler/node-matchers.h
index d2bdb8bff5..a7dcce3b66 100644
--- a/deps/v8/src/compiler/node-matchers.h
+++ b/deps/v8/src/compiler/node-matchers.h
@@ -168,7 +168,7 @@ struct FloatMatcher final : public ValueMatcher<T, kOpcode> {
     return this->HasValue() && std::isnormal(this->Value());
   }
   bool IsInteger() const {
-    return this->HasValue() && std::nearbyint(this->Value()) == this->Value();
+    return this->HasValue() && nearbyint(this->Value()) == this->Value();
   }
   bool IsPositiveOrNegativePowerOf2() const {
     if (!this->HasValue() || (this->Value() == 0.0)) {
diff --git a/deps/v8/src/wasm/wasm-result.h b/deps/v8/src/wasm/wasm-result.h
index 004ac22d33..eac307c2d0 100644
--- a/deps/v8/src/wasm/wasm-result.h
+++ b/deps/v8/src/wasm/wasm-result.h
@@ -5,6 +5,7 @@
 #ifndef V8_WASM_RESULT_H_
 #define V8_WASM_RESULT_H_
 
+#include <cstdarg>
 #include <memory>
 
 #include "src/base/compiler-specific.h"
diff --git a/lib/module.js b/lib/module.js
index ae6f4ff453..bd912c88f0 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -626,7 +626,8 @@ Module._initPaths = function() {
   } else {
     prefixDir = path.resolve(process.execPath, '..', '..');
   }
-  var paths = [path.resolve(prefixDir, 'lib', 'node')];
+  var paths = [path.resolve(prefixDir, 'lib', 'node'),
+               path.resolve(prefixDir, 'lib', 'node_modules')];
 
   if (homeDir) {
     paths.unshift(path.resolve(homeDir, '.node_libraries'));
diff --git a/src/backtrace_posix.cc b/src/backtrace_posix.cc
index 8fd798757a..8328b59439 100644
--- a/src/backtrace_posix.cc
+++ b/src/backtrace_posix.cc
@@ -4,9 +4,7 @@
 #include <features.h>
 #endif
 
-#if defined(__linux__) && !defined(__GLIBC__) || \
-    defined(__UCLIBC__) || \
-    defined(_AIX)
+#if defined(__linux__) && defined(__UCLIBC__)
 #define HAVE_EXECINFO_H 0
 #else
 #define HAVE_EXECINFO_H 1
diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py
index f7f519b3e6..6f7cc23442 100644
--- a/tools/gyp/pylib/gyp/generator/make.py
+++ b/tools/gyp/pylib/gyp/generator/make.py
@@ -149,6 +149,30 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
 quiet_cmd_link = LINK($(TOOLSET)) $@
 cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group
 
+define xargs
+$(1) $(wordlist 1,1000,$(2))
+$(if $(word 1001,$(2)),$(call xargs,$(1),$(wordlist 1001,$(words $(2)),$(2))))
+endef
+
+define write-to-file
+@: >$(1)
+$(call xargs,@printf "%s\\n" >>$(1),$(2))
+endef
+
+OBJ_FILE_LIST := ar-file-list
+
+define create_archive
+        rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
+define create_thin_archive
+        rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
 # We support two kinds of shared objects (.so):
 # 1) shared_library, which is just bundling together many dependent libraries
 # into a link line.
@@ -177,7 +201,7 @@ quiet_cmd_alink = LIBTOOL-STATIC $@
 cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
 
 quiet_cmd_link = LINK($(TOOLSET)) $@
-cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
+cmd_link = $(CXX.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
 
 quiet_cmd_solink = SOLINK($(TOOLSET)) $@
 cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
@@ -193,6 +217,30 @@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
 quiet_cmd_alink_thin = AR($(TOOLSET)) $@
 cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
 
+define xargs
+$(1) $(wordlist 1,1000,$(2))
+$(if $(word 1001,$(2)),$(call xargs,$(1),$(wordlist 1001,$(words $(2)),$(2))))
+endef
+
+define write-to-file
+@: >$(1)
+$(call xargs,@printf "%s\\n" >>$(1),$(2))
+endef
+
+OBJ_FILE_LIST := ar-file-list
+
+define create_archive
+        rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
+define create_thin_archive
+        rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+        $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+        $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
 # Due to circular dependencies between libraries :(, we wrap the
 # special "figure out circular dependencies" flags around the entire
 # input list during linking.
@@ -1589,11 +1637,17 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
             "Spaces in alink input filenames not supported (%s)"  % link_dep)
       if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not
           self.is_standalone_static_library):
-        self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin',
-                        part_of_all, postbuilds=postbuilds)
+        if self.flavor in ('linux', 'android'):
+          self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_thin_archive,$@,$^)'])
+        else:
+          self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin',
+                          part_of_all, postbuilds=postbuilds)
       else:
-        self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all,
-                        postbuilds=postbuilds)
+        if self.flavor in ('linux', 'android'):
+          self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_archive,$@,$^)'])
+        else:
+          self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all,
+                          postbuilds=postbuilds)
     elif self.type == 'shared_library':
       self.WriteLn('%s: LD_INPUTS := %s' % (
             QuoteSpaces(self.output_binary),

Best, again.

@nxhack
Copy link
Owner

nxhack commented Jun 28, 2017

@artynet

  • 012-changing-default-npm-settings.patch

oooh Is this... npm/npm#16862
OK. I will begin the test.

@nxhack nxhack merged commit 6f89b21 into nxhack:master Jun 28, 2017
@nxhack
Copy link
Owner

nxhack commented Jun 28, 2017

merged.

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

Successfully merging this pull request may close these issues.

2 participants