[PATCH libXfont] Eliminate calls back to X server or font server functions by name (v2)
Emil Velikov
emil.l.velikov at gmail.com
Thu Sep 10 05:31:26 PDT 2015
On 10 September 2015 at 02:41, Keith Packard <keithp at keithp.com> wrote:
> Emil Velikov <emil.l.velikov at gmail.com> writes:
>
>> From a very quick look, only fontstruct.h seems to be used. If truly
>> so, one can rework it (rename or fold into libxfont2.h, rename the
>> symbols ?) and drop the rest from libXfontinclude_HEADERS.
>
> fontstruct.h comes from proto/fontsproto
>
> However, fontutil.h does come from libXfont, and has only a small
> handful of functions used by the server. Moving those to libXfont2.h
> would be simple.
>
> None of the other headers from libXfont are used in the X server, but
> many are used in the other font utilities (bdftopcf et al).
>
Had a long hard look at the Archlinux repos and did not see (m)any
libxfont users outside of xserver. Would you/others know if they're
still a thing or they share the same faith as the print server :-)
>> Additionally it'll be great to sanitise the list of exported symbols,
>> as things might go nasty as we end up with both libXfont.so
>> libXfont2.so opened at the same time.
>
> libXfont is used only by the X server, the font server, and the
> various font utilities, so I think it's safe to assume that no
> application will use both versions.
>
As usual I'm thinking of various 'smart' moves that users opt for - in
particular $LD_PRELOAD=...libXfont.so startx.
Obviously the LD_PRELOAD is likely to be set in some crazy script, as
it "made app X work" and it won't be immediately obvious.
>> As previously this just a suggestion, so feel free to take it or leave it.
>
> I hadn't changed the common header files, but you are most correct in
> asserting that we cannot install them from both versions of the library;
> that would cause packaging problems, even if the contents of the files
> were identical.
>
> So, two simple solutions:
>
> 1) Rename the install target to X11/fonts2/
> 2) Merge all of the library API definitions into the new libxfont2.h
>
> I'm tempted to select option 2) as I'm not a huge fans of file names
> differing only in their directory component, but 1) would be simpler.
>
Fwiw I'd vote for 2) as it will make it harder for anyone to mix
and/or match headers between the two version.
Of course it helps nicely with the LD_PRELOAD 'issue'. Namely:
- Add the ~10 functions from fontutil.h to libxfont2.h
- Change/add a common prefix (break the API) for all
- Hide the other ~210 symbols from libXfont.so :-)
Admittedly it will be more work, but it sounds like a nice, robust
(cough idiot proof :-P) solution. Fwiw I might be able to help a bit,
if that's the major concern.
-Emil
More information about the xorg-devel
mailing list