diff options
Diffstat (limited to 'meta-oe/recipes-devtools')
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-Fix-C-11-ABI-breakage-when-compiled-with-C-17-1668-1.patch | 368 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb | 1 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch | 51 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch | 59 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch | 60 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_22.22.3.bb (renamed from meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb) | 5 |
6 files changed, 370 insertions, 174 deletions
diff --git a/meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-Fix-C-11-ABI-breakage-when-compiled-with-C-17-1668-1.patch b/meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-Fix-C-11-ABI-breakage-when-compiled-with-C-17-1668-1.patch new file mode 100644 index 0000000000..887bf14d2a --- /dev/null +++ b/meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-Fix-C-11-ABI-breakage-when-compiled-with-C-17-1668-1.patch | |||
| @@ -0,0 +1,368 @@ | |||
| 1 | From c67034e4b4c722579ee15fddb8e4af8f04252b08 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jordan Bayles <bayles.jordan@gmail.com> | ||
| 3 | Date: Thu, 9 Apr 2026 10:37:08 -0700 | ||
| 4 | Subject: [PATCH] Fix C++11 ABI breakage when compiled with C++17 #1668 (#1675) | ||
| 5 | |||
| 6 | When JSONCPP_HAS_STRING_VIEW was defined, the library dropped the | ||
| 7 | `const char*` and `const String&` overloads for `operator[]`, `get`, | ||
| 8 | `removeMember`, and `isMember`, breaking ABI compatibility for projects | ||
| 9 | consuming the library with C++11. | ||
| 10 | |||
| 11 | This change unconditionally declares and defines the legacy overloads | ||
| 12 | so they are always exported, restoring compatibility. | ||
| 13 | |||
| 14 | This commit completely eliminates the ABI breakage that occurs across | ||
| 15 | C++ standard boundaries when using `std::string_view`. | ||
| 16 | |||
| 17 | Previously, when the library was built with C++17+, CMake would leak | ||
| 18 | `JSONCPP_HAS_STRING_VIEW=1` as a PUBLIC definition. A C++11 consumer | ||
| 19 | would receive this definition, attempt to parse the header, and fail | ||
| 20 | with compiler errors because `std::string_view` is not available in | ||
| 21 | their environment. | ||
| 22 | |||
| 23 | Conversely, if the library was built in C++11 (without `string_view` | ||
| 24 | symbols), a C++17 consumer would naturally define | ||
| 25 | `JSONCPP_HAS_STRING_VIEW` based on `__cplusplus` inside `value.h`. The | ||
| 26 | consumer would then call the declared `string_view` methods, resulting | ||
| 27 | in linker errors because the methods weren't compiled into the library. | ||
| 28 | |||
| 29 | By moving all `std::string_view` overloads directly into `value.h` as | ||
| 30 | `inline` methods that delegate to the fundamental | ||
| 31 | `const char*, const char*` methods: | ||
| 32 | 1. The consumer's compiler dictates whether the overloads are visible | ||
| 33 | (via `__cplusplus >= 201703L`). | ||
| 34 | 2. The consumer compiles the inline wrappers locally, removing any | ||
| 35 | reliance on the library's exported symbols for `std::string_view`. | ||
| 36 | 3. CMake no longer needs to pollute the consumer's environment with | ||
| 37 | PUBLIC compile definitions. | ||
| 38 | |||
| 39 | Backported only the library/header changes. Upstream CI and example | ||
| 40 | test additions are omitted. | ||
| 41 | |||
| 42 | Upstream-Status: Backport [https://github.com/open-source-parsers/jsoncpp/commit/c67034e4b4c722579ee15fddb8e4af8f04252b08] | ||
| 43 | Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com> | ||
| 44 | --- | ||
| 45 | include/json/value.h | 54 ++++++++++++++++++++---------- | ||
| 46 | src/lib_json/CMakeLists.txt | 9 ----- | ||
| 47 | src/lib_json/json_value.cpp | 66 ------------------------------------- | ||
| 48 | 3 files changed, 36 insertions(+), 93 deletions(-) | ||
| 49 | |||
| 50 | diff --git a/include/json/value.h b/include/json/value.h | ||
| 51 | index f32f45609365..2007e6b4251d 100644 | ||
| 52 | --- a/include/json/value.h | ||
| 53 | +++ b/include/json/value.h | ||
| 54 | @@ -357,7 +357,8 @@ public: | ||
| 55 | Value(const StaticString& value); | ||
| 56 | Value(const String& value); | ||
| 57 | #ifdef JSONCPP_HAS_STRING_VIEW | ||
| 58 | - Value(std::string_view value); | ||
| 59 | + inline Value(std::string_view value) | ||
| 60 | + : Value(value.data(), value.data() + value.length()) {} | ||
| 61 | #endif | ||
| 62 | Value(bool value); | ||
| 63 | Value(std::nullptr_t ptr) = delete; | ||
| 64 | @@ -405,7 +406,14 @@ public: | ||
| 65 | /** Get string_view of string-value. | ||
| 66 | * \return false if !string. (Seg-fault if str is NULL.) | ||
| 67 | */ | ||
| 68 | - bool getString(std::string_view* str) const; | ||
| 69 | + inline bool getString(std::string_view* str) const { | ||
| 70 | + char const* begin; | ||
| 71 | + char const* end; | ||
| 72 | + if (!getString(&begin, &end)) | ||
| 73 | + return false; | ||
| 74 | + *str = std::string_view(begin, static_cast<size_t>(end - begin)); | ||
| 75 | + return true; | ||
| 76 | + } | ||
| 77 | #endif | ||
| 78 | Int asInt() const; | ||
| 79 | UInt asUInt() const; | ||
| 80 | @@ -496,12 +504,19 @@ public: | ||
| 81 | #ifdef JSONCPP_HAS_STRING_VIEW | ||
| 82 | /// Access an object value by name, create a null member if it does not exist. | ||
| 83 | /// \param key may contain embedded nulls. | ||
| 84 | - Value& operator[](std::string_view key); | ||
| 85 | + inline Value& operator[](std::string_view key) { | ||
| 86 | + return resolveReference(key.data(), key.data() + key.length()); | ||
| 87 | + } | ||
| 88 | /// Access an object value by name, returns null if there is no member with | ||
| 89 | /// that name. | ||
| 90 | /// \param key may contain embedded nulls. | ||
| 91 | - const Value& operator[](std::string_view key) const; | ||
| 92 | -#else | ||
| 93 | + inline const Value& operator[](std::string_view key) const { | ||
| 94 | + Value const* found = find(key.data(), key.data() + key.length()); | ||
| 95 | + if (!found) | ||
| 96 | + return nullSingleton(); | ||
| 97 | + return *found; | ||
| 98 | + } | ||
| 99 | +#endif | ||
| 100 | /// Access an object value by name, create a null member if it does not exist. | ||
| 101 | /// \note Because of our implementation, keys are limited to 2^30 -1 chars. | ||
| 102 | /// Exceeding that will cause an exception. | ||
| 103 | @@ -516,7 +531,6 @@ public: | ||
| 104 | /// that name. | ||
| 105 | /// \param key may contain embedded nulls. | ||
| 106 | const Value& operator[](const String& key) const; | ||
| 107 | -#endif | ||
| 108 | /** \brief Access an object value by name, create a null member if it does not | ||
| 109 | * exist. | ||
| 110 | * | ||
| 111 | @@ -533,8 +547,10 @@ public: | ||
| 112 | #ifdef JSONCPP_HAS_STRING_VIEW | ||
| 113 | /// Return the member named key if it exist, defaultValue otherwise. | ||
| 114 | /// \note deep copy | ||
| 115 | - Value get(std::string_view key, const Value& defaultValue) const; | ||
| 116 | -#else | ||
| 117 | + inline Value get(std::string_view key, const Value& defaultValue) const { | ||
| 118 | + return get(key.data(), key.data() + key.length(), defaultValue); | ||
| 119 | + } | ||
| 120 | +#endif | ||
| 121 | /// Return the member named key if it exist, defaultValue otherwise. | ||
| 122 | /// \note deep copy | ||
| 123 | Value get(const char* key, const Value& defaultValue) const; | ||
| 124 | @@ -542,7 +558,6 @@ public: | ||
| 125 | /// \note deep copy | ||
| 126 | /// \param key may contain embedded nulls. | ||
| 127 | Value get(const String& key, const Value& defaultValue) const; | ||
| 128 | -#endif | ||
| 129 | /// Return the member named key if it exist, defaultValue otherwise. | ||
| 130 | /// \note deep copy | ||
| 131 | /// \note key may contain embedded nulls. | ||
| 132 | @@ -588,13 +603,14 @@ public: | ||
| 133 | /// \pre type() is objectValue or nullValue | ||
| 134 | /// \post type() is unchanged | ||
| 135 | #if JSONCPP_HAS_STRING_VIEW | ||
| 136 | - void removeMember(std::string_view key); | ||
| 137 | -#else | ||
| 138 | + inline void removeMember(std::string_view key) { | ||
| 139 | + removeMember(key.data(), key.data() + key.length(), nullptr); | ||
| 140 | + } | ||
| 141 | +#endif | ||
| 142 | void removeMember(const char* key); | ||
| 143 | /// Same as removeMember(const char*) | ||
| 144 | /// \param key may contain embedded nulls. | ||
| 145 | void removeMember(const String& key); | ||
| 146 | -#endif | ||
| 147 | /** \brief Remove the named map member. | ||
| 148 | * | ||
| 149 | * Update 'removed' iff removed. | ||
| 150 | @@ -602,13 +618,14 @@ public: | ||
| 151 | * \return true iff removed (no exceptions) | ||
| 152 | */ | ||
| 153 | #if JSONCPP_HAS_STRING_VIEW | ||
| 154 | - bool removeMember(std::string_view key, Value* removed); | ||
| 155 | -#else | ||
| 156 | + inline bool removeMember(std::string_view key, Value* removed) { | ||
| 157 | + return removeMember(key.data(), key.data() + key.length(), removed); | ||
| 158 | + } | ||
| 159 | +#endif | ||
| 160 | bool removeMember(String const& key, Value* removed); | ||
| 161 | /// Same as removeMember(const char* begin, const char* end, Value* removed), | ||
| 162 | /// but 'key' is null-terminated. | ||
| 163 | bool removeMember(const char* key, Value* removed); | ||
| 164 | -#endif | ||
| 165 | /// Same as removeMember(String const& key, Value* removed) | ||
| 166 | bool removeMember(const char* begin, const char* end, Value* removed); | ||
| 167 | /** \brief Remove the indexed array element. | ||
| 168 | @@ -622,15 +639,16 @@ public: | ||
| 169 | #ifdef JSONCPP_HAS_STRING_VIEW | ||
| 170 | /// Return true if the object has a member named key. | ||
| 171 | /// \param key may contain embedded nulls. | ||
| 172 | - bool isMember(std::string_view key) const; | ||
| 173 | -#else | ||
| 174 | + inline bool isMember(std::string_view key) const { | ||
| 175 | + return isMember(key.data(), key.data() + key.length()); | ||
| 176 | + } | ||
| 177 | +#endif | ||
| 178 | /// Return true if the object has a member named key. | ||
| 179 | /// \note 'key' must be null-terminated. | ||
| 180 | bool isMember(const char* key) const; | ||
| 181 | /// Return true if the object has a member named key. | ||
| 182 | /// \param key may contain embedded nulls. | ||
| 183 | bool isMember(const String& key) const; | ||
| 184 | -#endif | ||
| 185 | /// Same as isMember(String const& key)const | ||
| 186 | bool isMember(const char* begin, const char* end) const; | ||
| 187 | |||
| 188 | diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt | ||
| 189 | index 03e9335525ca..a0695e9eba83 100644 | ||
| 190 | --- a/src/lib_json/CMakeLists.txt | ||
| 191 | +++ b/src/lib_json/CMakeLists.txt | ||
| 192 | @@ -131,9 +131,6 @@ if(BUILD_SHARED_LIBS) | ||
| 193 | |||
| 194 | target_compile_features(${SHARED_LIB} PUBLIC ${REQUIRED_FEATURES}) | ||
| 195 | |||
| 196 | - if(JSONCPP_HAS_STRING_VIEW) | ||
| 197 | - target_compile_definitions(${SHARED_LIB} PUBLIC JSONCPP_HAS_STRING_VIEW=1) | ||
| 198 | - endif() | ||
| 199 | |||
| 200 | target_include_directories(${SHARED_LIB} PUBLIC | ||
| 201 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
| 202 | @@ -168,9 +165,6 @@ if(BUILD_STATIC_LIBS) | ||
| 203 | |||
| 204 | target_compile_features(${STATIC_LIB} PUBLIC ${REQUIRED_FEATURES}) | ||
| 205 | |||
| 206 | - if(JSONCPP_HAS_STRING_VIEW) | ||
| 207 | - target_compile_definitions(${STATIC_LIB} PUBLIC JSONCPP_HAS_STRING_VIEW=1) | ||
| 208 | - endif() | ||
| 209 | |||
| 210 | target_include_directories(${STATIC_LIB} PUBLIC | ||
| 211 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
| 212 | @@ -198,9 +192,6 @@ if(BUILD_OBJECT_LIBS) | ||
| 213 | |||
| 214 | target_compile_features(${OBJECT_LIB} PUBLIC ${REQUIRED_FEATURES}) | ||
| 215 | |||
| 216 | - if(JSONCPP_HAS_STRING_VIEW) | ||
| 217 | - target_compile_definitions(${OBJECT_LIB} PUBLIC JSONCPP_HAS_STRING_VIEW=1) | ||
| 218 | - endif() | ||
| 219 | |||
| 220 | target_include_directories(${OBJECT_LIB} PUBLIC | ||
| 221 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
| 222 | diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp | ||
| 223 | index 74f77896fa7b..a8eb72d6b75f 100644 | ||
| 224 | --- a/src/lib_json/json_value.cpp | ||
| 225 | +++ b/src/lib_json/json_value.cpp | ||
| 226 | @@ -441,14 +441,6 @@ Value::Value(const String& value) { | ||
| 227 | value.data(), static_cast<unsigned>(value.length())); | ||
| 228 | } | ||
| 229 | |||
| 230 | -#ifdef JSONCPP_HAS_STRING_VIEW | ||
| 231 | -Value::Value(std::string_view value) { | ||
| 232 | - initBasic(stringValue, true); | ||
| 233 | - value_.string_ = duplicateAndPrefixStringValue( | ||
| 234 | - value.data(), static_cast<unsigned>(value.length())); | ||
| 235 | -} | ||
| 236 | -#endif | ||
| 237 | - | ||
| 238 | Value::Value(const StaticString& value) { | ||
| 239 | initBasic(stringValue); | ||
| 240 | value_.string_ = const_cast<char*>(value.c_str()); | ||
| 241 | @@ -656,21 +648,6 @@ bool Value::getString(char const** begin, char const** end) const { | ||
| 242 | return true; | ||
| 243 | } | ||
| 244 | |||
| 245 | -#ifdef JSONCPP_HAS_STRING_VIEW | ||
| 246 | -bool Value::getString(std::string_view* str) const { | ||
| 247 | - if (type() != stringValue) | ||
| 248 | - return false; | ||
| 249 | - if (value_.string_ == nullptr) | ||
| 250 | - return false; | ||
| 251 | - const char* begin; | ||
| 252 | - unsigned length; | ||
| 253 | - decodePrefixedString(this->isAllocated(), this->value_.string_, &length, | ||
| 254 | - &begin); | ||
| 255 | - *str = std::string_view(begin, length); | ||
| 256 | - return true; | ||
| 257 | -} | ||
| 258 | -#endif | ||
| 259 | - | ||
| 260 | String Value::asString() const { | ||
| 261 | switch (type()) { | ||
| 262 | case nullValue: | ||
| 263 | @@ -1190,17 +1167,6 @@ Value* Value::demand(char const* begin, char const* end) { | ||
| 264 | "objectValue or nullValue"); | ||
| 265 | return &resolveReference(begin, end); | ||
| 266 | } | ||
| 267 | -#ifdef JSONCPP_HAS_STRING_VIEW | ||
| 268 | -const Value& Value::operator[](std::string_view key) const { | ||
| 269 | - Value const* found = find(key.data(), key.data() + key.length()); | ||
| 270 | - if (!found) | ||
| 271 | - return nullSingleton(); | ||
| 272 | - return *found; | ||
| 273 | -} | ||
| 274 | -Value& Value::operator[](std::string_view key) { | ||
| 275 | - return resolveReference(key.data(), key.data() + key.length()); | ||
| 276 | -} | ||
| 277 | -#else | ||
| 278 | const Value& Value::operator[](const char* key) const { | ||
| 279 | Value const* found = find(key, key + strlen(key)); | ||
| 280 | if (!found) | ||
| 281 | @@ -1221,7 +1187,6 @@ Value& Value::operator[](const char* key) { | ||
| 282 | Value& Value::operator[](const String& key) { | ||
| 283 | return resolveReference(key.data(), key.data() + key.length()); | ||
| 284 | } | ||
| 285 | -#endif | ||
| 286 | |||
| 287 | Value& Value::operator[](const StaticString& key) { | ||
| 288 | return resolveReference(key.c_str()); | ||
| 289 | @@ -1261,18 +1226,12 @@ Value Value::get(char const* begin, char const* end, | ||
| 290 | Value const* found = find(begin, end); | ||
| 291 | return !found ? defaultValue : *found; | ||
| 292 | } | ||
| 293 | -#ifdef JSONCPP_HAS_STRING_VIEW | ||
| 294 | -Value Value::get(std::string_view key, const Value& defaultValue) const { | ||
| 295 | - return get(key.data(), key.data() + key.length(), defaultValue); | ||
| 296 | -} | ||
| 297 | -#else | ||
| 298 | Value Value::get(char const* key, Value const& defaultValue) const { | ||
| 299 | return get(key, key + strlen(key), defaultValue); | ||
| 300 | } | ||
| 301 | Value Value::get(String const& key, Value const& defaultValue) const { | ||
| 302 | return get(key.data(), key.data() + key.length(), defaultValue); | ||
| 303 | } | ||
| 304 | -#endif | ||
| 305 | |||
| 306 | bool Value::removeMember(const char* begin, const char* end, Value* removed) { | ||
| 307 | if (type() != objectValue) { | ||
| 308 | @@ -1288,31 +1247,13 @@ bool Value::removeMember(const char* begin, const char* end, Value* removed) { | ||
| 309 | value_.map_->erase(it); | ||
| 310 | return true; | ||
| 311 | } | ||
| 312 | -#ifdef JSONCPP_HAS_STRING_VIEW | ||
| 313 | -bool Value::removeMember(std::string_view key, Value* removed) { | ||
| 314 | - return removeMember(key.data(), key.data() + key.length(), removed); | ||
| 315 | -} | ||
| 316 | -#else | ||
| 317 | bool Value::removeMember(const char* key, Value* removed) { | ||
| 318 | return removeMember(key, key + strlen(key), removed); | ||
| 319 | } | ||
| 320 | bool Value::removeMember(String const& key, Value* removed) { | ||
| 321 | return removeMember(key.data(), key.data() + key.length(), removed); | ||
| 322 | } | ||
| 323 | -#endif | ||
| 324 | - | ||
| 325 | -#ifdef JSONCPP_HAS_STRING_VIEW | ||
| 326 | -void Value::removeMember(std::string_view key) { | ||
| 327 | - JSON_ASSERT_MESSAGE(type() == nullValue || type() == objectValue, | ||
| 328 | - "in Json::Value::removeMember(): requires objectValue"); | ||
| 329 | - if (type() == nullValue) | ||
| 330 | - return; | ||
| 331 | |||
| 332 | - CZString actualKey(key.data(), unsigned(key.length()), | ||
| 333 | - CZString::noDuplication); | ||
| 334 | - value_.map_->erase(actualKey); | ||
| 335 | -} | ||
| 336 | -#else | ||
| 337 | void Value::removeMember(const char* key) { | ||
| 338 | JSON_ASSERT_MESSAGE(type() == nullValue || type() == objectValue, | ||
| 339 | "in Json::Value::removeMember(): requires objectValue"); | ||
| 340 | @@ -1323,7 +1264,6 @@ void Value::removeMember(const char* key) { | ||
| 341 | value_.map_->erase(actualKey); | ||
| 342 | } | ||
| 343 | void Value::removeMember(const String& key) { removeMember(key.c_str()); } | ||
| 344 | -#endif | ||
| 345 | |||
| 346 | bool Value::removeIndex(ArrayIndex index, Value* removed) { | ||
| 347 | if (type() != arrayValue) { | ||
| 348 | @@ -1353,18 +1293,12 @@ bool Value::isMember(char const* begin, char const* end) const { | ||
| 349 | Value const* value = find(begin, end); | ||
| 350 | return nullptr != value; | ||
| 351 | } | ||
| 352 | -#ifdef JSONCPP_HAS_STRING_VIEW | ||
| 353 | -bool Value::isMember(std::string_view key) const { | ||
| 354 | - return isMember(key.data(), key.data() + key.length()); | ||
| 355 | -} | ||
| 356 | -#else | ||
| 357 | bool Value::isMember(char const* key) const { | ||
| 358 | return isMember(key, key + strlen(key)); | ||
| 359 | } | ||
| 360 | bool Value::isMember(String const& key) const { | ||
| 361 | return isMember(key.data(), key.data() + key.length()); | ||
| 362 | } | ||
| 363 | -#endif | ||
| 364 | |||
| 365 | Value::Members Value::getMemberNames() const { | ||
| 366 | JSON_ASSERT_MESSAGE( | ||
| 367 | -- | ||
| 368 | 2.43.0 | ||
diff --git a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb index 797f093f33..354f4e9115 100644 --- a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb +++ b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb | |||
| @@ -15,6 +15,7 @@ PE = "1" | |||
| 15 | 15 | ||
| 16 | SRCREV = "3455302847cf1e4671f1d8f5fa953fd46a7b1404" | 16 | SRCREV = "3455302847cf1e4671f1d8f5fa953fd46a7b1404" |
| 17 | SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https;tag=${PV} \ | 17 | SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https;tag=${PV} \ |
| 18 | file://0001-Fix-C-11-ABI-breakage-when-compiled-with-C-17-1668-1.patch \ | ||
| 18 | file://run-ptest \ | 19 | file://run-ptest \ |
| 19 | " | 20 | " |
| 20 | 21 | ||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch deleted file mode 100644 index 15de2c1119..0000000000 --- a/meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | From 41ec2d5302b77be27ca972102c29ce12471ed4b0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Thu, 12 Feb 2026 11:09:44 +0100 | ||
| 4 | Subject: [PATCH 2/2] detect aarch64 Neon correctly | ||
| 5 | |||
| 6 | The llhttp vendored dependency of nodejs takes advantage of Arm NEON | ||
| 7 | instructions when they are available, however they are detected by | ||
| 8 | checking for an outdated CPU feature macro: it checks for __ARM_NEON__, | ||
| 9 | however it is not defined by new compilers for aarch64, rather they | ||
| 10 | set __ARM_NEON. The Arm C extension guide[1] refers to __ARM_NEON macro | ||
| 11 | aswell. | ||
| 12 | |||
| 13 | This patch changes the detection to check for both macros when detecting | ||
| 14 | the availability of NEON instructions. | ||
| 15 | |||
| 16 | The code this patch modifies is generated, so the patch itself isn't | ||
| 17 | suitable for upstream submission, as the root cause of the error is | ||
| 18 | in the generator itself. A PR has been submitted[2] to the generator | ||
| 19 | project to rectify this issue. | ||
| 20 | |||
| 21 | [1]: https://developer.arm.com/documentation/ihi0053/d/ - pdf, section 6.9 | ||
| 22 | [2]: https://github.com/nodejs/llparse/pull/84 | ||
| 23 | |||
| 24 | Upstream-Status: Inappropriate [see above] | ||
| 25 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 26 | --- | ||
| 27 | deps/llhttp/src/llhttp.c | 4 ++-- | ||
| 28 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 29 | |||
| 30 | diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c | ||
| 31 | index a0e59e50..b069bbbb 100644 | ||
| 32 | --- a/deps/llhttp/src/llhttp.c | ||
| 33 | +++ b/deps/llhttp/src/llhttp.c | ||
| 34 | @@ -10,7 +10,7 @@ | ||
| 35 | #endif /* _MSC_VER */ | ||
| 36 | #endif /* __SSE4_2__ */ | ||
| 37 | |||
| 38 | -#ifdef __ARM_NEON__ | ||
| 39 | +#if defined(__ARM_NEON__) || defined(__ARM_NEON) | ||
| 40 | #include <arm_neon.h> | ||
| 41 | #endif /* __ARM_NEON__ */ | ||
| 42 | |||
| 43 | @@ -2625,7 +2625,7 @@ static llparse_state_t llhttp__internal__run( | ||
| 44 | goto s_n_llhttp__internal__n_header_value_otherwise; | ||
| 45 | } | ||
| 46 | #endif /* __SSE4_2__ */ | ||
| 47 | - #ifdef __ARM_NEON__ | ||
| 48 | + #if defined(__ARM_NEON__) || defined(__ARM_NEON) | ||
| 49 | while (endp - p >= 16) { | ||
| 50 | uint8x16_t input; | ||
| 51 | uint8x16_t single; | ||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch deleted file mode 100644 index ddbad575f0..0000000000 --- a/meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | From 3f4283dac7d88a89b42f1f2966a862cee5afe486 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Thu, 12 Feb 2026 11:03:53 +0100 | ||
| 4 | Subject: [PATCH 1/2] fix arm Neon intrinsics types | ||
| 5 | |||
| 6 | The current code calls these intrinsics with incorrect datatypes | ||
| 7 | (it uses a vector of uint16 instead of uint8), causing compilation | ||
| 8 | to fail with the following error: | ||
| 9 | |||
| 10 | | ../deps/llhttp/src/llhttp.c: In function 'llhttp__internal__run': | ||
| 11 | | ../deps/llhttp/src/llhttp.c:2645:9: note: use '-flax-vector-conversions' to permit conversions between vectors with differing element types or numbers of subparts | ||
| 12 | | 2645 | ); | ||
| 13 | | | ^ | ||
| 14 | | ../deps/llhttp/src/llhttp.c:2643:11: error: incompatible type for argument 1 of 'vandq_u16' | ||
| 15 | | 2643 | vcgeq_u8(input, vdupq_n_u8(' ')), | ||
| 16 | |||
| 17 | To avoid this, set the correct intrinsics call that matches the | ||
| 18 | actual arguments. | ||
| 19 | |||
| 20 | The code that this patch modifies is generated code, so in itself | ||
| 21 | this change isn't appropriate for upstream. The actual problem | ||
| 22 | is in the code generator itself, for which a PR is already pending | ||
| 23 | for merging[1]. This patch is a port of that PR. | ||
| 24 | |||
| 25 | [1]: https://github.com/nodejs/llparse/pull/79 | ||
| 26 | |||
| 27 | Upstream-Status: Inappropriate [see above] | ||
| 28 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 29 | --- | ||
| 30 | deps/llhttp/src/llhttp.c | 12 ++++++------ | ||
| 31 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
| 32 | |||
| 33 | diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c | ||
| 34 | index aa4c4682..887603fd 100644 | ||
| 35 | --- a/deps/llhttp/src/llhttp.c | ||
| 36 | +++ b/deps/llhttp/src/llhttp.c | ||
| 37 | @@ -2639,17 +2639,17 @@ static llparse_state_t llhttp__internal__run( | ||
| 38 | /* Find first character that does not match `ranges` */ | ||
| 39 | single = vceqq_u8(input, vdupq_n_u8(0x9)); | ||
| 40 | mask = single; | ||
| 41 | - single = vandq_u16( | ||
| 42 | + single = vandq_u8( | ||
| 43 | vcgeq_u8(input, vdupq_n_u8(' ')), | ||
| 44 | vcleq_u8(input, vdupq_n_u8('~')) | ||
| 45 | ); | ||
| 46 | - mask = vorrq_u16(mask, single); | ||
| 47 | - single = vandq_u16( | ||
| 48 | + mask = vorrq_u8(mask, single); | ||
| 49 | + single = vandq_u8( | ||
| 50 | vcgeq_u8(input, vdupq_n_u8(0x80)), | ||
| 51 | vcleq_u8(input, vdupq_n_u8(0xff)) | ||
| 52 | ); | ||
| 53 | - mask = vorrq_u16(mask, single); | ||
| 54 | - narrow = vshrn_n_u16(mask, 4); | ||
| 55 | + mask = vorrq_u8(mask, single); | ||
| 56 | + narrow = vshrn_n_u16(vreinterpretq_u16_u8(mask), 4); | ||
| 57 | match_mask = ~vget_lane_u64(vreinterpret_u64_u8(narrow), 0); | ||
| 58 | match_len = __builtin_ctzll(match_mask) >> 2; | ||
| 59 | if (match_len != 16) { | ||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch deleted file mode 100644 index 683dddcf04..0000000000 --- a/meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | From a63a5faea54055973bf5f0a514444532563cc20d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Telukula Jeevan Kumar Sahu <j-sahu@ti.com> | ||
| 3 | Date: Fri, 27 Feb 2026 20:58:43 +0530 | ||
| 4 | Subject: [PATCH] llhttp: fix NEON header value __builtin_ctzll undefined | ||
| 5 | behavior | ||
| 6 | |||
| 7 | When all 16 bytes match the allowed range, match_mask becomes 0 after | ||
| 8 | the bitwise NOT. Calling __builtin_ctzll(0) is undefined behavior per | ||
| 9 | the C standard. | ||
| 10 | |||
| 11 | The code expects match_len == 16 when all bytes match (so the branch | ||
| 12 | is skipped and p += 16 continues the loop), but this relied on | ||
| 13 | ctzll(0) returning 64, which is not guaranteed. | ||
| 14 | |||
| 15 | GCC at -O2 exploits this UB by deducing that __builtin_ctzll() result | ||
| 16 | is always in range [0, 63], and after >> 2 always in [0, 15], which | ||
| 17 | is never equal to 16. The compiler then optimizes | ||
| 18 | "if (match_len != 16)" to always-true, causing every valid 16-byte | ||
| 19 | chunk to be falsely rejected as containing an invalid character. | ||
| 20 | |||
| 21 | This manifests as HTTP 400 Bad Request (HPE_INVALID_HEADER_TOKEN) for | ||
| 22 | any HTTP header value longer than 16 characters on ARM targets with | ||
| 23 | NEON enabled. | ||
| 24 | |||
| 25 | Fix by explicitly checking for match_mask == 0 and setting | ||
| 26 | match_len = 16, avoiding the undefined behavior entirely. This bug | ||
| 27 | affects both aarch64 and armv7 NEON targets. | ||
| 28 | |||
| 29 | The fix has been merged upstream in llparse 7.3.1 [1] and is included | ||
| 30 | in llhttp 9.3.1. This patch can be dropped when nodejs updates its | ||
| 31 | bundled llhttp to >= 9.3.1. | ||
| 32 | |||
| 33 | [1]: https://github.com/nodejs/llparse/pull/83 | ||
| 34 | |||
| 35 | Upstream-Status: Inappropriate | ||
| 36 | Signed-off-by: Telukula Jeevan Kumar Sahu <j-sahu@ti.com> | ||
| 37 | --- | ||
| 38 | deps/llhttp/src/llhttp.c | 6 +++++- | ||
| 39 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
| 40 | |||
| 41 | diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c | ||
| 42 | index 14b731e..b0a46c6 100644 | ||
| 43 | --- a/deps/llhttp/src/llhttp.c | ||
| 44 | +++ b/deps/llhttp/src/llhttp.c | ||
| 45 | @@ -2651,7 +2651,11 @@ static llparse_state_t llhttp__internal__run( | ||
| 46 | mask = vorrq_u8(mask, single); | ||
| 47 | narrow = vshrn_n_u16(vreinterpretq_u16_u8(mask), 4); | ||
| 48 | match_mask = ~vget_lane_u64(vreinterpret_u64_u8(narrow), 0); | ||
| 49 | - match_len = __builtin_ctzll(match_mask) >> 2; | ||
| 50 | + if (match_mask == 0) { | ||
| 51 | + match_len = 16; | ||
| 52 | + } else { | ||
| 53 | + match_len = __builtin_ctzll(match_mask) >> 2; | ||
| 54 | + } | ||
| 55 | if (match_len != 16) { | ||
| 56 | p += match_len; | ||
| 57 | goto s_n_llhttp__internal__n_header_value_otherwise; | ||
| 58 | -- | ||
| 59 | 2.34.1 | ||
| 60 | |||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.3.bb index 3a1385f70a..a13b71b762 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.3.bb | |||
| @@ -31,9 +31,6 @@ SRC_URI = "https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | |||
| 31 | file://0001-positional-args.patch \ | 31 | file://0001-positional-args.patch \ |
| 32 | file://0001-custom-env.patch \ | 32 | file://0001-custom-env.patch \ |
| 33 | file://0001-build-remove-redundant-mXX-flags-for-V8.patch \ | 33 | file://0001-build-remove-redundant-mXX-flags-for-V8.patch \ |
| 34 | file://0001-fix-arm-Neon-intrinsics-types.patch \ | ||
| 35 | file://0001-detect-aarch64-Neon-correctly.patch \ | ||
| 36 | file://0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch \ | ||
| 37 | file://run-ptest \ | 34 | file://run-ptest \ |
| 38 | " | 35 | " |
| 39 | SRC_URI:append:class-target = " \ | 36 | SRC_URI:append:class-target = " \ |
| @@ -42,7 +39,7 @@ SRC_URI:append:class-target = " \ | |||
| 42 | SRC_URI:append:toolchain-clang:powerpc64le = " \ | 39 | SRC_URI:append:toolchain-clang:powerpc64le = " \ |
| 43 | file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ | 40 | file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ |
| 44 | " | 41 | " |
| 45 | SRC_URI[sha256sum] = "b6bedd3a8cacd5df7df015a5088264b12c74a277ba60684cb9642ae8eb743132" | 42 | SRC_URI[sha256sum] = "f3e6a578db1ab335a4a72785c1e87ad18a2cf6d2fc25747a1d741fb34af0bd0f" |
| 46 | 43 | ||
| 47 | S = "${UNPACKDIR}/node-v${PV}" | 44 | S = "${UNPACKDIR}/node-v${PV}" |
| 48 | 45 | ||
