| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
LIEF's lief.gyp explicitly sets -std=gnu++17 in cflags_cc and xcode_settings, while common.gypi already sets -std=gnu++20 project-wide. This results in both flags being passed to the compiler (-std=gnu++20 -std=gnu++17). Since the last flag wins, LIEF was silently compiling as C++17 instead of the intended project-wide C++20. Remove the explicit -std=gnu++17 flags from cflags_cc and xcode_settings.OTHER_CPLUSPLUSFLAGS, and the msvs_settings LanguageStandard override (stdcpp17), so LIEF uses the project-wide C++20 standard. Additionally, fix LIEF compilation with C++20 by explicitly qualifying fmt::format and fmt::join in Section.cpp, and converting joined views into std::string values prior to passing them into final formatting calls. This prevents conflicts between fmt::join_view and std::format when compiling under C++20. Fixes: nodejs#62129
|
Gentle ping this PR has been open for 3 weeks without any review. This is the companion fix to #62683 (which landed) together they fully The fix also resolves C++20 compilation failures on GCC 14 and Xcode 16.4 The change touches 7 files but is a net -8 lines (removing overrides). CI @joyeecheung @richardlau @lpinca since you all reviewed the related |
Sorry, something went wrong.
|
Can you upstream the changes to deps/LIEF to LIEF first? After it goes out in a LIEF release you can run tools/dep_updaters/update-lief.sh to pull it into the deps folder. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
LIEF's lief.gyp explicitly sets -std=gnu++17 in cflags_cc and
xcode_settings, while common.gypi already sets -std=gnu++20
project-wide. This results in both flags being passed to the compiler
(-std=gnu++20 -std=gnu++17). Since the last flag wins, LIEF was
silently compiling as C++17 instead of the intended project-wide C++20.
Additionally, upgrading LIEF to C++20 triggered compile-time conflicts in Section.cpp on modern compilers (like GCC 14 and Xcode 16.4) due to overlapping definitions between {fmt} and C++20 std::format.
Changes
Why C++20 is safe for LIEF
SPDLOG_USE_STD_FORMAT is not defined in the build, so spdlog uses its
bundled fmt library rather than <format>, avoiding any C++20 conflicts once the Section.cpp syntax is properly isolated.
Risk
LIEF was previously compiling as C++17 (last flag wins). With this change it
will compile as C++20. While C++20 is a superset, reviewers should confirm
no subtle deprecations or narrowing issues arise.
Note: A separate stray debug string issue in the same file is addressed
in PR #62683.
Fixes: #62129