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 failure with GCC 14 in nodejs with -O2 -march=znver2 #2175

Closed
thesamesam opened this issue May 7, 2024 · 3 comments
Closed

Build failure with GCC 14 in nodejs with -O2 -march=znver2 #2175

thesamesam opened this issue May 7, 2024 · 3 comments

Comments

@thesamesam
Copy link

thesamesam commented May 7, 2024

Describe the bug

Carrying on from nodejs/node#52876 (comment).

I get a consistent build failure with GCC 14 and NodeJS 22.1.0 in simdjson:

../../deps/simdjson/simdjson.cpp:19023:49: error: inlining failed in call to ‘always_inline’ ‘simdjson::error_code simdjson::haswell::{anonymous}::stage2::json_iterator::walk_document(V&) noexcept [with bool STREAMING = false; V = simdjson::haswell::{anonymous}::stage2::tape_builder]’: target specific option mismatch

See below for details.

To Reproduce

I have tried to reproduce this outside of NodeJS and I can't yet. It's possible it's a bug in Ninja or NodeJS's build system, but I'm not able to say yet if that's the case. Nevermind, I can reproduce with v3.8.0 in simdjson.git.

The following steps trigger it for me:

mkdir /tmp/node && cd /tmp/node
wget "https://github.com/nodejs/node/archive/refs/tags/v22.1.0.tar.gz"
tar xvf v22.1.0.tar.gz && cd node-22.1.0
CXXFLAGS="-O2 -march=znver2" ./configure --ninja
make # (although I'm calling make here, the node build system makes a Makefile to call ninja, it's their supported configuration)

It fails like:


$ make
ninja -C out/Release
ninja: Entering directory `out/Release'
[10/1613] ACTION icudata: icudata_cc7672230cb6f4a4cb1b079ff599d36f
c++ -MMD -MF obj/deps/simdjson/simdjson.simdjson.o.d -D_GLIBCXX_USE_CXX11_ABI=1 -DNODE_OPENSSL_CONF_NAME=nodejs_conf -DNODE_OPENSSL_HAS_QUIC -DICU_NO_USER_DATA_OVERRIDE -D__STDC_FORMAT_MACROS -DOPENSSL_NO_PINSHARED -DOPENSSL_THREADS -I../../deps/simdjson -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -O2 -march=znver2 -fno-rtti -fno-exceptions -std=gnu++17  -c ../../deps/simdjson/simdjson.cpp -o obj/deps/simdjson/simdjson.simdjson.o
../../deps/simdjson/simdjson.cpp:14153:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
14153 |     simdjson_inline simd8<bool>() : base8() {}
      |                                ^
../../deps/simdjson/simdjson.cpp:14153:32: note: remove the ‘< >’
../../deps/simdjson/simdjson.cpp:14154:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
14154 |     simdjson_inline simd8<bool>(const __m256i _value) : base8<bool>(_value) {}
      |                                ^
../../deps/simdjson/simdjson.cpp:14154:32: note: remove the ‘< >’
../../deps/simdjson/simdjson.cpp:14156:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
14156 |     simdjson_inline simd8<bool>(bool _value) : base8<bool>(splat(_value)) {}
      |                                ^
../../deps/simdjson/simdjson.cpp:14156:32: note: remove the ‘< >’
../../deps/simdjson/simdjson.cpp:20331:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
20331 |     simdjson_inline simd8<bool>() : base8() {}
      |                                ^
../../deps/simdjson/simdjson.cpp:20331:32: note: remove the ‘< >’
../../deps/simdjson/simdjson.cpp:20332:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
20332 |     simdjson_inline simd8<bool>(const __m512i _value) : base8<bool>(_value) {}
      |                                ^
../../deps/simdjson/simdjson.cpp:20332:32: note: remove the ‘< >’
../../deps/simdjson/simdjson.cpp:20334:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
20334 |     simdjson_inline simd8<bool>(bool _value) : base8<bool>(splat(_value)) {}
      |                                ^
../../deps/simdjson/simdjson.cpp:20334:32: note: remove the ‘< >’
../../deps/simdjson/simdjson.cpp: In static member function ‘static simdjson::error_code simdjson::haswell::{anonymous}::stage2::tape_builder::parse_document(simdjson::haswell::dom_parser_implementation&, simdjson::dom::document&) [with bool STREAMING = false]’:
../../deps/simdjson/simdjson.cpp:19023:49: error: inlining failed in call to ‘always_inline’ ‘simdjson::error_code simdjson::haswell::{anonymous}::stage2::json_iterator::walk_document(V&) noexcept [with bool STREAMING = false; V = simdjson::haswell::{anonymous}::stage2::tape_builder]’: target specific option mismatch
19023 | simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
      |                                                 ^~~~~~~~~~~~~
../../deps/simdjson/simdjson.cpp:19654:39: note: called from here
19654 |   return iter.walk_document<STREAMING>(builder);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../../deps/simdjson/simdjson.cpp:19023:49: error: inlining failed in call to ‘always_inline’ ‘simdjson::error_code simdjson::haswell::{anonymous}::stage2::json_iterator::walk_document(V&) noexcept [with bool STREAMING = false; V = simdjson::haswell::{anonymous}::stage2::tape_builder]’: target specific option mismatch
19023 | simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
      |                                                 ^~~~~~~~~~~~~
../../deps/simdjson/simdjson.cpp:19654:39: note: called from here
19654 |   return iter.walk_document<STREAMING>(builder);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
[53/1613] CXX obj/tools/v8_gypfiles/gen/torque-generated/src/builtins/v8_initializers_slow.wasm-to-js-tq-csa.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:149: node] Error 1

But if I replace the last two steps like so, it builds fine (without --ninja, it'll build using make):

CXXFLAGS="-O2 -march=znver2" ./configure
make

Please let me know if it'd be helpful to provide a Dockerfile to reproduce the issue, or if I should provide any other information. Thank you.

simjdson release

I cannot yet reproduce this from a simdjson release or git repo, but I am trying. nodejs-22.1.0, where I can reproduce this, seems to be at simdjson-3.8.0.

Configuration (please complete the following information if relevant)

  • OS: Gentoo
  • Compiler: gcc version 14.1.0 (Gentoo Hardened 14.1.0 p1)
  • Version: N/A (rolling)
  • Optimization setting: -O2 -march=znver2

Additional information:

$ make --version
GNU Make 4.4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ ninja --version
1.12.0

Indicate whether you are willing or able to provide a bug fix as a pull request

I don't think I'm able at this point, but if the issue becomes more more clear, I can try.

@thesamesam
Copy link
Author

thesamesam commented May 7, 2024

@lemire I can't yet reproduce this with standalone simdjson, only from a nodejs tarball (per above). I'm going to keep trying.

Do you want me to try make a Fedora/Ubuntu/$YOUR_PREFERENCE_HERE or Gentoo dockerfile?

Let me know if I can try or provide anything else too.

@thesamesam
Copy link
Author

thesamesam commented May 7, 2024

Huh, wait. I was convinced I'd tried backporting your fixes into nodejs' version before, but no. I must have missed some patches (the generated file in nodejs makes it hard to do). If I git checkout v3.8.0, then simdjson standalone fails.

-> I think we just need to get simdjson updated in node?

@lemire
Copy link
Member

lemire commented May 7, 2024

Thanks. The fix for GCC 14 is in release 3.9.1.

So I am going to close this. Please don't hesitate to open an issue should it prove necessary.

@lemire lemire closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants