|
| 1 | +--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py |
| 2 | ++++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py |
| 3 | +@@ -151,6 +151,32 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOL |
| 4 | + quiet_cmd_link = LINK($(TOOLSET)) $@ |
| 5 | + cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group |
| 6 | + |
| 7 | ++define xargs |
| 8 | ++ $(1) $(wordlist 1,100,$(2)) |
| 9 | ++ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) |
| 10 | ++endef |
| 11 | ++ |
| 12 | ++define write-to-file |
| 13 | ++ @echo >$(1) |
| 14 | ++ $(call xargs,printf "%s\\n" >>$(1),$(2)) |
| 15 | ++endef |
| 16 | ++ |
| 17 | ++OBJ_FILE_LIST_SFX := ar-file-list |
| 18 | ++ |
| 19 | ++define create_archive |
| 20 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 21 | ++ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 22 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 23 | ++ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) |
| 24 | ++endef |
| 25 | ++ |
| 26 | ++define create_thin_archive |
| 27 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 28 | ++ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 29 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 30 | ++ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) |
| 31 | ++endef |
| 32 | ++ |
| 33 | + # We support two kinds of shared objects (.so): |
| 34 | + # 1) shared_library, which is just bundling together many dependent libraries |
| 35 | + # into a link line. |
| 36 | +@@ -195,6 +221,32 @@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) |
| 37 | + quiet_cmd_alink_thin = AR($(TOOLSET)) $@ |
| 38 | + cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) |
| 39 | + |
| 40 | ++define xargs |
| 41 | ++ $(1) $(wordlist 1,100,$(2)) |
| 42 | ++ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) |
| 43 | ++endef |
| 44 | ++ |
| 45 | ++define write-to-file |
| 46 | ++ @echo >$(1) |
| 47 | ++ $(call xargs,printf "%s\\n" >>$(1),$(2)) |
| 48 | ++endef |
| 49 | ++ |
| 50 | ++OBJ_FILE_LIST_SFX := ar-file-list |
| 51 | ++ |
| 52 | ++define create_archive |
| 53 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 54 | ++ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 55 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 56 | ++ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) |
| 57 | ++endef |
| 58 | ++ |
| 59 | ++define create_thin_archive |
| 60 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 61 | ++ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 62 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 63 | ++ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) |
| 64 | ++endef |
| 65 | ++ |
| 66 | + # Due to circular dependencies between libraries :(, we wrap the |
| 67 | + # special "figure out circular dependencies" flags around the entire |
| 68 | + # input list during linking. |
| 69 | +@@ -1612,11 +1664,17 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj) |
| 70 | + "Spaces in alink input filenames not supported (%s)" % link_dep) |
| 71 | + if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not |
| 72 | + self.is_standalone_static_library): |
| 73 | +- self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin', |
| 74 | +- part_of_all, postbuilds=postbuilds) |
| 75 | ++ if self.flavor in ('linux', 'android'): |
| 76 | ++ self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_thin_archive,$@,$^)']) |
| 77 | ++ else: |
| 78 | ++ self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin', |
| 79 | ++ part_of_all, postbuilds=postbuilds) |
| 80 | + else: |
| 81 | +- self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, |
| 82 | +- postbuilds=postbuilds) |
| 83 | ++ if self.flavor in ('linux', 'android'): |
| 84 | ++ self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_archive,$@,$^)']) |
| 85 | ++ else: |
| 86 | ++ self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, |
| 87 | ++ postbuilds=postbuilds) |
| 88 | + elif self.type == 'shared_library': |
| 89 | + self.WriteLn('%s: LD_INPUTS := %s' % ( |
| 90 | + QuoteSpaces(self.output_binary), |
| 91 | +--- a/tools/gyp/pylib/gyp/generator/make.py |
| 92 | ++++ b/tools/gyp/pylib/gyp/generator/make.py |
| 93 | +@@ -155,6 +155,32 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOL |
| 94 | + quiet_cmd_link = LINK($(TOOLSET)) $@ |
| 95 | + cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group |
| 96 | + |
| 97 | ++define xargs |
| 98 | ++ $(1) $(wordlist 1,100,$(2)) |
| 99 | ++ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) |
| 100 | ++endef |
| 101 | ++ |
| 102 | ++define write-to-file |
| 103 | ++ @echo >$(1) |
| 104 | ++ $(call xargs,printf "%s\\n" >>$(1),$(2)) |
| 105 | ++endef |
| 106 | ++ |
| 107 | ++OBJ_FILE_LIST_SFX := ar-file-list |
| 108 | ++ |
| 109 | ++define create_archive |
| 110 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 111 | ++ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 112 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 113 | ++ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) |
| 114 | ++endef |
| 115 | ++ |
| 116 | ++define create_thin_archive |
| 117 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 118 | ++ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 119 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 120 | ++ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) |
| 121 | ++endef |
| 122 | ++ |
| 123 | + # We support two kinds of shared objects (.so): |
| 124 | + # 1) shared_library, which is just bundling together many dependent libraries |
| 125 | + # into a link line. |
| 126 | +@@ -199,6 +225,32 @@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) |
| 127 | + quiet_cmd_alink_thin = AR($(TOOLSET)) $@ |
| 128 | + cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) |
| 129 | + |
| 130 | ++define xargs |
| 131 | ++ $(1) $(wordlist 1,100,$(2)) |
| 132 | ++ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) |
| 133 | ++endef |
| 134 | ++ |
| 135 | ++define write-to-file |
| 136 | ++ @echo >$(1) |
| 137 | ++ $(call xargs,printf "%s\\n" >>$(1),$(2)) |
| 138 | ++endef |
| 139 | ++ |
| 140 | ++OBJ_FILE_LIST_SFX := ar-file-list |
| 141 | ++ |
| 142 | ++define create_archive |
| 143 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 144 | ++ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 145 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 146 | ++ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) |
| 147 | ++endef |
| 148 | ++ |
| 149 | ++define create_thin_archive |
| 150 | ++ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) |
| 151 | ++ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` |
| 152 | ++ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) |
| 153 | ++ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) |
| 154 | ++endef |
| 155 | ++ |
| 156 | + # Due to circular dependencies between libraries :(, we wrap the |
| 157 | + # special "figure out circular dependencies" flags around the entire |
| 158 | + # input list during linking. |
| 159 | +@@ -1766,21 +1818,35 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj) |
| 160 | + self.flavor not in ("mac", "openbsd", "netbsd", "win") |
| 161 | + and not self.is_standalone_static_library |
| 162 | + ): |
| 163 | +- self.WriteDoCmd( |
| 164 | +- [self.output_binary], |
| 165 | +- link_deps, |
| 166 | +- "alink_thin", |
| 167 | +- part_of_all, |
| 168 | +- postbuilds=postbuilds, |
| 169 | +- ) |
| 170 | ++ if self.flavor in ('linux', 'android'): |
| 171 | ++ self.WriteMakeRule( |
| 172 | ++ [self.output_binary], |
| 173 | ++ link_deps, |
| 174 | ++ actions = ['$(call create_thin_archive,$@,$^)'] |
| 175 | ++ ) |
| 176 | ++ else: |
| 177 | ++ self.WriteDoCmd( |
| 178 | ++ [self.output_binary], |
| 179 | ++ link_deps, |
| 180 | ++ 'alink_thin', |
| 181 | ++ part_of_all, |
| 182 | ++ postbuilds=postbuilds |
| 183 | ++ ) |
| 184 | + else: |
| 185 | +- self.WriteDoCmd( |
| 186 | +- [self.output_binary], |
| 187 | +- link_deps, |
| 188 | +- "alink", |
| 189 | +- part_of_all, |
| 190 | +- postbuilds=postbuilds, |
| 191 | +- ) |
| 192 | ++ if self.flavor in ('linux', 'android'): |
| 193 | ++ self.WriteMakeRule( |
| 194 | ++ [self.output_binary], |
| 195 | ++ link_deps, |
| 196 | ++ actions = ['$(call create_archive,$@,$^)'] |
| 197 | ++ ) |
| 198 | ++ else: |
| 199 | ++ self.WriteDoCmd( |
| 200 | ++ [self.output_binary], |
| 201 | ++ link_deps, |
| 202 | ++ 'alink', |
| 203 | ++ part_of_all, |
| 204 | ++ postbuilds=postbuilds |
| 205 | ++ ) |
| 206 | + elif self.type == "shared_library": |
| 207 | + self.WriteLn( |
| 208 | + "%s: LD_INPUTS := %s" |
0 commit comments