localedef native build improvements
The tools build of localedef could be improved. It currently only works correctly on a recent version of illumos.
The problems start with $SRC/cmd/localedef/collate.c pulling in collate.h from $SRC/lib/libc/port/locale, which in turn includes <locale.h>. At that point we have mixed build system and target system includes, and it either doesn't build, or may build bad bits.
A reasonable solution to this is to try to separate the knowledge of the file formats (generated by localedef and consumed by libc) from the declarations of the run-time machinery for loading these files in libc.
This was already done for the "runes" files used by ctype support. I've continued that approach for the "collate" data files, so there is now a new header "collatefile.h" that defines the file format, as needed by localedef and libc. That's included by collate.h (now strictly internal to libc).
The localedef program also links with libavl and libgen, where it would be much simpiler (for the native build) to compile those objects.
Updated by Gary Mills about 4 years ago
I had a similar problem on SPARC, using OI release 8 as the build system:
+ /opt/gcc/4.4.4/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm -fdiagnostics-show-option -nodefaultlibs -mno-integer-ldd-std -D__sun -fno-strict-aliasing -fno-unit-at-a-time -fno-optimize-sibling-calls -O2 -m32 -Wall -Wextra -Werror -Wno-missing-braces -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Wno-char-subscripts -Wno-uninitialized -Wno-unused-label -std=gnu89 -fno-inline-small-functions -fno-inline-functions-called-once -fno-ipa-cp -I /dpool/export/home/mills/Downloads/code/illumos-gate/usr/src/lib/libc/port/locale -o native/collate.o -c collate.c -mcpu=v8 -mno-v8plus In file included from /dpool/export/home/mills/Downloads/code/illumos-gate/usr/src/lib/libc/port/locale/collate.h:36, from collate.c:33: /dpool/export/home/mills/Downloads/code/illumos-gate/usr/src/lib/libc/port/locale/localeimpl.h:29:21: error: xlocale.h: No such file or directory
The xlocale.h file doesn't exist on the build system, but it does in usr/src/head and proto/root_sparc/usr/include .
Updated by Electric Monk about 4 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit bc09504ff1ed70f84c9713b732281f14a9ef49b2 Author: Gordon Ross <email@example.com> Date: 2015-10-22T18:43:29.000Z 6350 localedef native build improvements Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Reviewed by: Richard Lowe <email@example.com> Reviewed by: Garrett D'Amore <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>