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

build: don't pass DESTCPU to configure unless set #13160

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 60 additions & 80 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ ifdef DISABLE_V8_I18N
V8_BUILD_OPTIONS += i18nsupport=off
endif

# Use Node arch names rather than V8 ones.
ifeq ($(DESTCPU),ia32)
override DESTCPU=x86
endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ia32 is the node/v8 arch name; either the comment is wrong or the logic is.

ifeq ($(DESTCPU),aarch64)
override DESTCPU=arm64
endif

ifdef DESTCPU
# TODO(gib): only add if not already there
CONFIG_FLAGS += --dest-cpu=$(DESTCPU)
endif

BUILDTYPE_LOWER := $(shell echo $(BUILDTYPE) | tr '[A-Z]' '[a-z]')

# Determine EXEEXT
Expand Down Expand Up @@ -564,86 +577,53 @@ RELEASE=$(shell sed -ne 's/\#define NODE_VERSION_IS_RELEASE \([01]\)/\1/p' src/n
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/')

UNAME_M=$(shell uname -m)
ifeq ($(findstring x86_64,$(UNAME_M)),x86_64)
DESTCPU ?= x64
else
ifeq ($(findstring ppc64,$(UNAME_M)),ppc64)
DESTCPU ?= ppc64
else
ifeq ($(findstring ppc,$(UNAME_M)),ppc)
DESTCPU ?= ppc
else
ifeq ($(findstring s390x,$(UNAME_M)),s390x)
DESTCPU ?= s390x
else
ifeq ($(findstring s390,$(UNAME_M)),s390)
DESTCPU ?= s390
else
ifeq ($(findstring arm,$(UNAME_M)),arm)
DESTCPU ?= arm
else
ifeq ($(findstring aarch64,$(UNAME_M)),aarch64)
DESTCPU ?= aarch64
else
ifeq ($(findstring powerpc,$(shell uname -p)),powerpc)
DESTCPU ?= ppc64
else
DESTCPU ?= x86
endif
endif
endif
endif
endif
endif
endif
endif
ifeq ($(DESTCPU),x64)
ARCH=x64
else
ifeq ($(DESTCPU),arm)
ARCH=arm
else
ifeq ($(DESTCPU),aarch64)
ARCH=arm64
else
ifeq ($(DESTCPU),ppc64)
ARCH=ppc64
else
ifeq ($(DESTCPU),ppc)
ARCH=ppc
ifdef DESTCPU
ARCH = $(DESTCPU)
else
ifeq ($(DESTCPU),s390)
ARCH=s390
else
ifeq ($(DESTCPU),s390x)
ARCH=s390x
else
ARCH=x86
endif
endif
endif
endif
endif
endif
endif

# node and v8 use different arch names (e.g. node 'x86' vs v8 'ia32').
# pass the proper v8 arch name to $V8_ARCH based on user-specified $DESTCPU.
ifeq ($(DESTCPU),x86)
UNAME_M=$(shell uname -m)
ifeq ($(findstring x86_64,$(UNAME_M)),x86_64)
ARCH ?= x64
else
ifeq ($(findstring ppc64,$(UNAME_M)),ppc64)
ARCH ?= ppc64
else
ifeq ($(findstring ppc,$(UNAME_M)),ppc)
ARCH ?= ppc
else
ifeq ($(findstring s390x,$(UNAME_M)),s390x)
ARCH ?= s390x
else
ifeq ($(findstring s390,$(UNAME_M)),s390)
ARCH ?= s390
else
ifeq ($(findstring arm,$(UNAME_M)),arm)
ARCH ?= arm
else
ifeq ($(findstring aarch64,$(UNAME_M)),aarch64)
ARCH ?= aarch64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arm64

else
ifeq ($(findstring powerpc,$(shell uname -p)),powerpc)
ARCH ?= ppc64
else
ARCH ?= x86
endif
endif
endif
endif
endif
endif
endif
endif
endif

# Handle Node and V8 arch name differences for x86 and arm64.
ifeq ($(ARCH),x86)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be:

V8_ARCH = $(ARCH)  # Maybe get rid of this in favor of DESTCPU
ifeq ($(ARCH),ia32)
ARCH = x86
endif

Assuming I read it right.

V8_ARCH=ia32
else
V8_ARCH ?= $(DESTCPU)

endif

# enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel
ifeq ($(ARCH),ia32)
override ARCH=x86
endif
ifeq ($(DESTCPU),ia32)
override DESTCPU=x86
ifeq ($(ARCH),arm64)
V8_ARCH ?= aarch64
endif
V8_ARCH ?= $(ARCH)

TARNAME=node-$(FULLVERSION)
TARBALL=$(TARNAME).tar
Expand Down Expand Up @@ -762,7 +742,6 @@ doc-upload: doc
$(TARBALL)-headers: release-only
$(PYTHON) ./configure \
--prefix=/ \
--dest-cpu=$(DESTCPU) \
--tag=$(TAG) \
--release-urlbase=$(RELEASE_URLBASE) \
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
Expand All @@ -789,12 +768,12 @@ ifeq ($(XZ), 0)
ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done"
endif

$(BINARYTAR): release-only
$(BINARYTAR): #release-only
echo arch=$(ARCH), destcpu=$(DESTCPU), binaryname=$(BINARYNAME), binarytar=$(BINARYTAR) #&& exit 1
$(RM) -r $(BINARYNAME)
$(RM) -r out/deps out/Release
$(PYTHON) ./configure \
--prefix=/ \
--dest-cpu=$(DESTCPU) \
--tag=$(TAG) \
--release-urlbase=$(RELEASE_URLBASE) \
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
Expand All @@ -813,7 +792,8 @@ endif
binary: $(BINARYTAR)

binary-upload: binary
ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
echo arch=$(ARCH), destcpu=$(DESTCPU) #&& exit 1
#ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz.done"
Expand Down
4 changes: 2 additions & 2 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ An alias of [`assert.ok()`][].
<!-- YAML
added: v0.1.21
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/12142
description: Set and Map content is also compared
- version: v6.4.0, v4.7.1
Expand Down Expand Up @@ -102,7 +102,7 @@ parameter is undefined, a default error message is assigned.
<!-- YAML
added: v1.2.0
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/12142
description: Set and Map content is also compared
- version: v6.4.0, v4.7.1
Expand Down
16 changes: 8 additions & 8 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ actual byte length is returned.
<!-- YAML
added: v0.11.13
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10236
description: The arguments can now be `Uint8Array`s.
-->
Expand Down Expand Up @@ -736,7 +736,7 @@ console.log(arr.sort(Buffer.compare));
<!-- YAML
added: v0.7.11
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10236
description: The elements of `list` can now be `Uint8Array`s.
-->
Expand Down Expand Up @@ -984,7 +984,7 @@ console.log(buffer.buffer === arrayBuffer);
<!-- YAML
added: v0.11.13
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10236
description: The `target` parameter can now be a `Uint8Array`.
- version: v5.11.0
Expand Down Expand Up @@ -1146,7 +1146,7 @@ for (const pair of buf.entries()) {
<!-- YAML
added: v0.11.13
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10236
description: The arguments can now be `Uint8Array`s.
-->
Expand Down Expand Up @@ -1257,7 +1257,7 @@ console.log(buf.includes('this', 4));
<!-- YAML
added: v1.5.0
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10236
description: The `value` can now be a `Uint8Array`.
- version: v5.7.0, v4.4.0
Expand Down Expand Up @@ -1374,7 +1374,7 @@ for (const key of buf.keys()) {
<!-- YAML
added: v6.0.0
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10236
description: The `value` can now be a `Uint8Array`.
-->
Expand Down Expand Up @@ -1503,7 +1503,7 @@ console.log(buf.length);

### buf.parent
<!-- YAML
deprecated: REPLACEME
deprecated: REPLACED
-->

> Stability: 0 - Deprecated: Use [`buf.buffer`] instead.
Expand Down Expand Up @@ -2517,7 +2517,7 @@ Note that this is a property on the `buffer` module returned by
<!-- YAML
added: v7.1.0
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10236
description: The `source` parameter can now be a `Uint8Array`.
-->
Expand Down
8 changes: 4 additions & 4 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ getVersion();
<!-- YAML
added: v0.5.0
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10866
description: The `stdio` option can now be a string.
- version: v6.4.0
Expand Down Expand Up @@ -638,7 +638,7 @@ configuration at startup.
<!-- YAML
added: v0.11.12
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
- version: v6.2.1, v4.5.0
Expand Down Expand Up @@ -685,7 +685,7 @@ throw. The [`Error`][] object will contain the entire result from
<!-- YAML
added: v0.11.12
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
-->
Expand Down Expand Up @@ -737,7 +737,7 @@ execution.**
<!-- YAML
added: v0.11.12
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
- version: v6.2.1, v4.5.0
Expand Down
12 changes: 6 additions & 6 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Throw errors for deprecations.

### `--pending-deprecation`
<!-- YAML
added: REPLACEME
added: REPLACED
-->

Emit pending deprecation warnings.
Expand All @@ -160,7 +160,7 @@ Silence all process warnings (including deprecations).

### `--napi-modules`
<!-- YAML
added: REPLACEME
added: REPLACED
-->

Enable loading native modules compiled with the ABI-stable Node.js API (N-API)
Expand All @@ -175,7 +175,7 @@ Print stack traces for process warnings (including deprecations).

### `--redirect-warnings=file`
<!-- YAML
added: REPLACEME
added: REPLACED
-->

Write process warnings to the given file instead of printing to stderr. The
Expand Down Expand Up @@ -399,7 +399,7 @@ When set to `1`, process warnings are silenced.

### `NODE_OPTIONS=options...`
<!-- YAML
added: REPLACEME
added: REPLACED
-->

`options...` are interpreted as if they had been specified on the command line
Expand Down Expand Up @@ -437,7 +437,7 @@ V8 options that are allowed are:

### `NODE_PENDING_DEPRECATION=1`
<!-- YAML
added: REPLACEME
added: REPLACED
-->

When set to `1`, emit pending deprecation warnings.
Expand Down Expand Up @@ -519,7 +519,7 @@ OpenSSL, it may cause them to trust the same CAs as node.

### `NODE_REDIRECT_WARNINGS=file`
<!-- YAML
added: REPLACEME
added: REPLACED
-->

When set, process warnings will be emitted to the given file instead of
Expand Down
2 changes: 1 addition & 1 deletion doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ myConsole.warn(`Danger ${name}! Danger!`);
## Class: Console
<!-- YAML
changes:
- version: REPLACEME
- version: REPLACED
pr-url: https://github.com/nodejs/node/pull/9744
description: Errors that occur while writing to the underlying streams
will now be ignored.
Expand Down
Loading