Skip to content

LoongArch64 architecture build failed #60258

@Xiao-Tao

Description

@Xiao-Tao

Version

main

Platform

Linux mingtaoxt 6.6.25+ #8 SMP Mon Sep  2 08:33:06 EDT 2024 loongarch64 GNU/Linux

Subsystem

v8

What steps will reproduce the bug?

Compile the main branch code to reproduce.
"'CODETYPE' was not declared in this scope" appears when compiling after upgrading V8 to 14.1

13:25:59   loongarch64-unknown-linux-gnu-g++ -o /home/iojs/build/workspace/node-test-commit-loongarch64/out/Release/obj.target/v8_initializers/gen/torque-generated/src/builtins/array-reduce-tq-csa.o /home/iojs/build/workspace/node-test-commit-loongarch64/out/Release/obj/gen/torque-generated/src/builtins/array-reduce-tq-csa.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_FILE_OFFSET_BITS=64' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DICU_NO_USER_DATA_OVERRIDE' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DV8_TARGET_ARCH_LOONG64' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_LINUX' '-DV8_EMBEDDER_STRING="-node.10"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DNDEBUG' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_USE_ZLIB' '-DV8_ENABLE_LEAPTIERING' '-DV8_ENABLE_SPARKPLUG' '-DV8_ENABLE_TURBOFAN' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_ADVANCED_BIGINT_ALGORITHMS' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/v8 -I../deps/v8/include -I/home/iojs/build/workspace/node-test-commit-loongarch64/out/Release/obj/gen -I/home/iojs/build/workspace/node-test-commit-loongarch64/out/Release/obj/gen/generate-bytecode-output-root -I../deps/v8/third_party/fp16/src/include -I../deps/v8/third_party/abseil-cpp -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common  -pthread -Wno-unused-parameter -Wno-strict-overflow -Wno-return-type -Wno-int-in-bool-context -Wno-deprecated -Wno-stringop-overflow -Wno-stringop-overread -Wno-restrict -Wno-array-bounds -Wno-nonnull -Wno-dangling-pointer -flax-vector-conversions -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++20 -Wno-invalid-offsetof -MMD -MF /home/iojs/build/workspace/node-test-commit-loongarch64/out/Release/.deps//home/iojs/build/workspace/node-test-commit-loongarch64/out/Release/obj.target/v8_initializers/gen/torque-generated/src/builtins/array-reduce-tq-csa.o.d.raw   -c
13:25:59 ../deps/v8/src/builtins/loong64/builtins-loong64.cc: In function ‘void v8::internal::GetSharedFunctionInfoBytecodeOrBaseline(MacroAssembler*, Register, Register, Register, Label*, Label*)’:
13:25:59 ../deps/v8/src/builtins/loong64/builtins-loong64.cc:331:54: 错误:‘CODETYPE’ was not declared in this scope; did you mean ‘CODE_TYPE’?
13:26:02   331 |       __ Branch(&not_baseline, ne, scratch1, Operand(CODETYPE));
13:26:04       |                                                      ^~~~~~~~
13:26:04       |                                                      CODE_TYPE

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

This issue can be reproduced after upgrading v8 to 14.1.
This has been fixed in the latest commit for the v8 loong64 architecture.
Ref:https://chromium-review.googlesource.com/c/v8/v8/+/7031299

What is the expected behavior? Why is that the expected behavior?

The expected behavior is that it can pass CI build and test normally.
Currently, LoongArch CI is in a failed state (https://ci.nodejs.org/job/node-test-commit-loongarch64/nodes=clfs23-64/)

What do you see instead?

https://ci.nodejs.org/job/node-test-commit-loongarch64/nodes=clfs23-64/786/

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions