Skip to content

Cross compilation for 32bit on 64bit fails #39736

Open
@Marv-CZ

Description

@Marv-CZ

Version

16.6.1

Platform

Linux (Fedora 34 64bit)

Subsystem

No response

What steps will reproduce the bug?

I cross compile Node.js 16.6.1 from sources on 64bit Intel PC. When I compile for 64bit ARM it is OK. But when I compile for 32bit ARM, it ends with error:

g++ -o /home/cernockym/Devel/modulesnodered/packages/nodejs/node-v16.6.1/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/heap/base/asm/x64/push_registers_asm.o ../deps/v8/src/heap/base/asm/x64/push_registers_asm.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DCAN_USE_VFP3_INSTRUCTIONS' '-DCAN_USE_VFP32DREGS' '-DV8_EMBEDDER_STRING="-node.19"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DENABLE_MINOR_MC' '-DOBJECT_PRINT' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DDISABLE_UNTRUSTED_CODE_MITIGATIONS' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_SNAPSHOT_COMPRESSION' '-DV8_ENABLE_WEBASSEMBLY' '-DUSE_EABI_HARDFLOAT=0' -I../deps/v8 -I../deps/v8/include -I/home/cernockym/Devel/modulesnodered/packages/nodejs/node-v16.6.1/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/home/cernockym/Devel/modulesnodered/packages/nodejs/node-v16.6.1/out/Release/obj/gen -I/home/cernockym/Devel/modulesnodered/packages/nodejs/node-v16.6.1/out/Release/obj/gen/generate-bytecode-output-root -I../deps/v8/third_party/zlib -I../deps/v8/third_party/zlib/google -pthread -Wno-unused-parameter -Wno-return-type -fno-strict-aliasing -m32 -O3 -w -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++14 -MMD -MF /home/cernockym/Devel/modulesnodered/packages/nodejs/node-v16.6.1/out/Release/.deps//home/cernockym/Devel/modulesnodered/packages/nodejs/node-v16.6.1/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/heap/base/asm/x64/push_registers_asm.o.d.raw -c
/tmp/ccFSa7ES.s: Assembler messages:
/tmp/ccFSa7ES.s:8: Error: bad register name %rbp' /tmp/ccFSa7ES.s:9: Error: bad register name %rsp'
/tmp/ccFSa7ES.s:11: Error: bad register name %rbx' /tmp/ccFSa7ES.s:12: Error: bad register name %r12'
/tmp/ccFSa7ES.s:13: Error: bad register name %r13' /tmp/ccFSa7ES.s:14: Error: bad register name %r14'
/tmp/ccFSa7ES.s:15: Error: bad register name %r15' /tmp/ccFSa7ES.s:16: Error: bad register name %rdx'
/tmp/ccFSa7ES.s:17: Error: bad register name %rsp' /tmp/ccFSa7ES.s:18: Error: bad register name %r8'
/tmp/ccFSa7ES.s:19: Error: bad register name %rsp' /tmp/ccFSa7ES.s:20: Error: bad register name %rbp'

GYP selects -m32 cflag but x64 asm source.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Activity

added
buildIssues and PRs related to build files or the CI.
armIssues and PRs related to the ARM platform.
on Aug 12, 2021
creepy-pasta101

creepy-pasta101 commented on Sep 11, 2021

@creepy-pasta101

Well.. this issue is also seen in i686 builds too
termux/termux-packages#7505

Marv-CZ

Marv-CZ commented on Mar 31, 2022

@Marv-CZ
Author
changed the title [-]Cross compilation for 32bit on 64bit[/-] [+]Cross compilation for 32bit on 64bit fails[/+] on Mar 31, 2022
Marv-CZ

Marv-CZ commented on Mar 31, 2022

@Marv-CZ
Author

It has the same issue on 16.14.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    armIssues and PRs related to the ARM platform.buildIssues and PRs related to build files or the CI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @targos@Marv-CZ@creepy-pasta101

        Issue actions

          Cross compilation for 32bit on 64bit fails · Issue #39736 · nodejs/node