Skip to content

MacOS build with EVMONE_PRECOMPILES_SILKPRE=1 fails, Xcode 16.3 removed base template for std::char_traits #1184

@JasonCoombs

Description

@JasonCoombs

The work-around temporarily is to downgrade to Xcode 16.2

Note that GMP was built (with clang/clang++) and installed, and make check passed all tests prior to attempting to build evmone with precompiles activated. To build GMP successfully required using --disable-assembly in my build environment.

jason@Mac-mini gmp-6.3.0 $ ./configure --disable-assembly CC=clang CC_FOR_BUILD=clang --enable-cxx CXX=clang++

See: https://gmplib.org/gmp-man-6.3.0.pdf

Error building evmone with precompiles as shown below:

$ cmake -S . -B build -DEVMONE_TESTING=ON -DEVMONE_PRECOMPILES_SILKPRE=1 -G Xcode

...
-- GMP: /usr/local/lib/libgmp.dylib, /usr/local/include
-- Found Git: /usr/bin/git (found version "2.39.5 (Apple Git-154)")
-- Configuring done (34.9s)
-- Generating done (0.3s)
-- Build files have been written to: /Users/jason/evmone/build

$ cmake --build build --parallel

...
-o /Users/jason/evmone/build/build/silkpre.build/Debug/Objects-normal/x86_64/precompile.o
In file included from /Users/jason/evmone/build/_deps/silkpre-src/lib/silkpre/precompile.cpp:26:
In file included from /Users/jason/.hunter/_Base/26c79d5/fde453a/8f00a61/Install/include/intx/intx.hpp:18:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/string:821:42:
 error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  821 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
      |                                          ^
/Users/jason/evmone/build/_deps/silkpre-src/lib/silkpre/precompile.cpp:43:12: note: in instantiation of template class 'std::basic_string<unsigned char>' requested here
   43 |     if (str.length() < min_size) {
      |            ^
In file included from /Users/jason/evmone/build/_deps/silkpre-src/lib/silkpre/precompile.cpp:19:
In file included from /usr/local/include/gmp.h:35:
...

See: https://developer.apple.com/documentation/xcode-release-notes/xcode-16_3-release-notes

The base template for std::char_traits has been removed. If you are using std::char_traits with types other than char, wchar_t, char8_t, char16_t, char32_t or a custom character type for which you specialized std::char_traits, your code will stop working. The Standard does not mandate that a base template is provided, and such a base template is bound to be incorrect for some types, which could previously cause unexpected behavior while going undetected.

Also: https://reviews.llvm.org/D138307

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions