Hi all!
When compiling icu4c
with additional locales in the most recent ICU 78.1 the build stops with a 'string storage overflow' error.
echo "$ICUDATA_LIST_CONTENT" > ./out/tmp/icudata.lst
echo timestamp > build-local
LD_LIBRARY_PATH=../stubdata:../tools/ctestfw:../lib:$LD_LIBRARY_PATH ../bin/pkgdata -O ../data/icupkg.inc -q -c -s /home/build/devel/EXTLIBS/linux/clang21el10/ICU/78.1/shared/data/out/build/icudt78l -d ../lib -e icudt78 -T ./out/tmp -p icudt78l -m dll -r 78.1 -L icudata ./out/tmp/icudata.lst
icupkg: string storage overflow
make[1]: *** [Makefile:162: packagedata] Error 15
When building icu4c I would like to package additional locales by adding them into the directory icu4c/source/data/mappings - this worked well up to ICU 76.1
Debugging the root cause shows, that the current icu4c packagedata almost hits the configured maximum value of 100000 characters.
DebuggingPatched Package::writePackage() of ICU 78.1
--- icu4c/source/tools/toolutil/package.cpp 2025-11-20 07:41:36.000000000 +0100
+++ icu4c.modified/source/tools/toolutil/package.cpp 2025-11-21 10:54:34.798047432 +0100
@@ -795,9 +795,11 @@
sortItems();
}
+ fprintf(stderr, "Target items: %i\n", itemCount);
// create the output item names in sorted order, with the package name prepended to each
for(i=0; i<itemCount; ++i) {
length = static_cast<int32_t>(strlen(items[i].name));
+ fprintf(stderr, "%05d: %s %06d\n", i, items[i].name, outStringTop);
name=allocString(false, length+prefixLength);
memcpy(name, prefix, prefixLength);
memcpy(name+prefixLength, items[i].name, length+1);
Output of the patched run:
Target items: 4305
...
04303: zu.res 099069
04304: zu_ZA.res 099085
Is there anything I can do? Maybe just increase the STRING_STORE_SIZE?
icu4c\source\tools\toolutil\package.h
#define STRING_STORE_SIZE 100000