Bug 696

Summary: Cannot build own libX11.so on Solaris which uses Solaris locale objects
Product: xorg Reporter: Roland Mainz <roland.mainz>
Component: Lib/XlibAssignee: Hidetoshi Tajima <yakiudon>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: lowest CC: alan.coopersmith, erik.andren
Version: git   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 669    
Attachments:
Description Flags
introduce Xi18nLibDirName to be set in hosts.def none

Description Roland Mainz 2004-05-31 13:52:38 UTC
While working on various I18n issues in the tree I realised that I cannot build
a libX11.so from Xorg trunk which uses the Solaris locale objects.

Each time I try to use a non-C locale I get a "locale not supported by Xlib":
-- snip --
% (export LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_ALL=en_US.UTF-8 ; export
LD_LIBRARY_PATH=$PWD/../../exports/lib ; ./xmore)
Warning: locale not supported by Xlib, locale set to C
Warning: X locale modifiers not supported, using default
usage: ./xmore [ x options ] filename
-- snip --

I tried the following build swiches in my host.def:
-- snip --
#define HasFreetype2                   NO
#define XorgServer                     NO
#define XF86Server                     NO
#define XnestServer                    NO
#define XVirtualFramebufferServer      NO
#define BuildXvExt                     NO
#define BuildFonts                     NO
#define ProjectRoot      /usr/openwin
#define ServerConfigDir  /usr/openwin/server/etc
#define XLocaleDir /usr/openwin/lib/locale
#undef OptimizedCDebugFlags
#define OptimizedCDebugFlags -xs -g -DDEBUG_$(LOGNAME)
-- snip --

A "truss -u :: -o logfile.log ./xmore" shows the following failure before the
warning is written:
-- snip --
                        <- libc:strcat() = 0x44008
                      <- libX11:__lc_path() = 0x44008
stat("/usr/openwin/lib/locale/lib/common/xlcUTF-8.so.2", 0xFFBED88C) Err#2
ENOENT
open("/usr/lib/locale/en_US.UTF-8/LC_MESSAGES/SUNW_OST_SGS.mo", O_RDONLY) Err#2
ENOENT
open("/usr/lib/locale/en_US.UTF-8/LC_MESSAGES/SUNW_OST_OSLIB.mo", O_RDONLY)
Err#2 ENOENT
                      -> libc:free(0x44008, 0xff3e96b8, 0x0, 0x1)
                        -> libc:mutex_lock(0xfeec0608, 0x794b8, 0x0, 0xfeebc008)
                        -> libc:_return_zero(0xfeec0608, 0x794b8, 0x0,
0xfeebc008)
                        <- libc:mutex_lock() = 0
                        -> libc:_free_unlocked(0x44008, 0x794b8, 0x0,
0xfeebc008)
                        <- libc:_free_unlocked() = 0xfeec27cc
                      -> libc:mutex_unlock(0xfeec0608, 0xff3e96b8, 0x0, 0x1)
                      -> libc:_return_zero(0xfeec0608, 0xff3e96b8, 0x0, 0x1)
                      <- libc:free() = 0
                    <- libX11:open_object() = 0
                  <- libX11:_XlcDynamicLoad() = 0
                <- libX11:_XOpenLC() = 0
              <- libX11:_XlcCurrentLC() = 0
            <- libX11:XSupportsLocale() = 0
            -> libXt:XtWarning(0xff20b078, 0xfeebfa14, 0xfeebc008, 0xff2227e8)
[snip]
# "Locale not supported" follows:
write(2, " W a r n i n g :  ", 9)		= 9
write(2, " l o c a l e   n o t   s".., 45)	= 45
write(2, "\n", 1)				= 1
-- snip --

Alan:
1. Any idea what I am doing wrong ?
2. What about keeping the Solaris-specific modifications in sun.cf (#ifdef'ed
out by default) that people can enable these flags on demand ?
Comment 1 Alan Coopersmith 2005-02-14 11:35:48 UTC
I know almost nothing about the i18n module code in libX11 in either Solaris or
the X.Org tree - Toshi would be the person to ask about this.
Comment 2 Hidetoshi Tajima 2005-02-14 13:43:00 UTC
I'll have to give a try to see what's actually happening, but 
from the truss output, it goes to /usr/openwin/lib/locale/lib/common
for Xi18n modules, but the right path is /usr/openwin/lib/locale/common
(no 2nd 'lib'). Can you try to work out XlocaleDir setting or else
to manage the path to be correct one?
Comment 3 Hidetoshi Tajima 2005-05-06 18:11:26 UTC
Created attachment 2630 [details] [review]
introduce Xi18nLibDirName to be set in hosts.def

There must be better way.
Comment 4 Hidetoshi Tajima 2005-05-06 18:13:08 UTC
Due to POSTLOCALEDIR= LibDirName in xc/lib/X11 and
xc/lib/X11/xlibi18n/Xi18nLib.conf, Xi18n shared libraries built in Xorg workspace
are installed in /usr/openwin/lib/locale/lib/common/ directory. This isn't good
on Solaris, since the system pre-installed Xi18n libraries are in
/usr/openwin/lib/locale/common.

To hack this, we may use a specific configuration for Xi18n Library location,
say, Xi18nLibDirName, and this should be given in host.def like:
 #define Xi18nLibDirName  /* blank */
Then, xc/lib/X11/Imakefile and xc/lib/X11/xlibi18n/Xi18n.conf can be changed
like https://bugs.freedesktop.org/attachment.cgi?id=2630.
Comment 5 Erik Andren 2006-04-04 05:24:18 UTC
So, any progess on this bug?
Comment 6 Daniel Stone 2006-04-04 23:47:09 UTC
closing really old bug; iirc this is much better with modular anyway

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.