Opened 11 days ago

Last modified 8 days ago

#69805 new defect

macports-libcxx: sync with the latest compatible version of LLVM

Reported by: aeiouaeiouaeiouaeiouaeiouaeiou Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mascguy (Christopher Nielsen)
Port: macports-libcxx, bitcoin

Description (last modified by aeiouaeiouaeiouaeiouaeiouaeiou)

Bitcoin 27.0 now uses the std::bit_width function, which was only properly implemented in LLVM 12.

https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/228575/steps/install-port/logs/stdio

In file included from addrman.cpp:10:
In file included from ./addrman.h:9:
In file included from ./netaddress.h:11:
./random.h:207:25: error: no member named 'bit_width' in namespace 'std'
        int bits = std::bit_width(range);
                   ~~~~~^

Also more:

In file included from addrdb.cpp:10:
In file included from ./addrdb.h:10:
./util/fs.h:65:30: error: no matching constructor for initialization of 'const std::u8string &' (aka 'const basic_string<char8_t> &')
        const std::u8string& utf8_str{std::filesystem::path::u8string()};
                             ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/libcxx/v1/string:791:40: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'const allocator_type' (aka 'const std::allocator<char8_t>') for 1st argument
    _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
                                       ^

Change History (4)

comment:1 Changed 11 days ago by aeiouaeiouaeiouaeiouaeiouaeiou

Description: modified (diff)

comment:2 Changed 11 days ago by aeiouaeiouaeiouaeiouaeiouaeiou

Port: bitcoin added

comment:3 Changed 10 days ago by kencu (Ken)

just a heads-up that libcxx makes no attempt to maintain compatibility between versions. Requests to upstream to maintain object layouts to maintain compatibilty between libcxx versions have been declined — it’s not something they want to have to support.

I chose the libcxx from clang-11 to be the one used in macports-libcxx so as to try to be the most compatible with the libcxx installed in the system on the needed systems.

When/if macports-libcxx is inevitably updated, it is quite possible more ABI incompatibilities might creep in, much like what happened with gcc and libstdc++. Some testing will be needed. We have seen a few minor ABI issues already using the macports-libcxx we have, but all-in it’s been more successful than I had expected. That might change.

comment:4 Changed 8 days ago by mascguy (Christopher Nielsen)

Cc: mascguy added
Note: See TracTickets for help on using tickets.