Repository navigation
Allow use of dragonfly locale code so non-C locales work. - #56
Bill-Sommerfeld wants to merge 4 commits into
Conversation
From Jonathan Perkin's patch in pkgsrc-extra
3bbee0f to
8aeedbc
Compare
The generic locale implementation chosen naturally by gcc's configure throws an exception if a locale other than "C" is selected. We can do better. Use the DragonflyBSD locale support with a few minor changes. From my illumos-gcc pull request, illumos/gcc#56
The generic locale implementation chosen naturally by gcc's configure throws an exception if a locale other than "C" is selected. We can do better. Use the DragonflyBSD locale support with a few minor changes. From my illumos-gcc pull request, illumos/gcc#56
The generic locale implementation chosen naturally by gcc's configure throws an exception if a locale other than "C" is selected. We can do better. Use the DragonflyBSD locale support with a few minor changes. From my illumos-gcc pull request, illumos/gcc#56
encoded characters. C++'s locale interface can only cope with a single char or a single wchar_t.
8aeedbc to
f0c8bad
Compare
|
On distros where GCC is already configured with Here is an MRE: // test.cpp
#include <iostream>
#include <locale>
#include <stdexcept>
int main()
{
try {
std::locale("");
} catch (const std::runtime_error& e) {
std::cout << e.what() << '\n';
}
}It fails reproducibly as follows: $ g++ -std=c++20 test.cpp -o test
$ LANG=C.UTF-8 LD_PRELOAD=libumem.so.1 UMEM_DEBUG=guards ./test
sh: line 4: 813: Memory fault(coredump)Stack trace from the core dump: |
It appears that this is due to missing member initializers in the Fix looks straightforward. |
|
The fix pending in openindiana avoids the crash: |
As reported in illumos/gcc#56 (comment) testrunner@openindiana:/tmp$ unset LD_PRELOAD_64 testrunner@openindiana:/tmp$ LANG=C.UTF-8 LD_PRELOAD=libumem.so.1 UMEM_DEBUG=guards ./test Segmentation Fault (core dumped) LANG=C.UTF-8 LD_PRELOAD=libumem.so.1 UMEM_DEBUG=guards ./test testrunner@openindiana:/tmp$ export LD_PRELOAD_64=/rpool/oi-userland/components/developer/gcc-14/build/amd64/x86_64-pc-solaris2.11/libstdc++-v3/src/.libs/libstdc++.so.6.0.33 testrunner@openindiana:/tmp$ LANG=C.UTF-8 LD_PRELOAD=libumem.so.1 UMEM_DEBUG=guards ./test Also add patch 1003-clean-up-lconv.patch to address code review comments
|
Sorry for the delay in adding the ctype initialization fix to this pull request. |
|
@Bill-Sommerfeld and @ citrus-it do we have final gcc tests for this? I presume we want to keep this as the full set of four commits that we move from release to release and not squash anything? |
I've been doing some work with gcc16 and trying to get the testsuite in better shape for us in general, for example properly handling the difference in output with |
This tweaks the libstdc++
configurescript to let you pass--enable-clocale=dragonflyto select the dragonfly locale code; this will only work on illumos if you also have the illumos-gate changes in https://code.illumos.org/c/illumos-gate/+/4242The
ctype_members.ccpatch is from Jonathan Perkin's patch in pkgsrc-extra and is needed to avoid undefined symbols.