[tex-k] Bug (arguably) in tex-file.c
Norman Gray
norman at astro.gla.ac.uk
Mon Jun 9 20:14:57 CEST 2003
Greetings,
I'd like to report a bug/infelicity
in web2c-7.4.5/texk/kpathsea/tex-file.c, which prevents drawing
libkpathsea.a into a dynamic library on OSX. I have a fix.
I've attached the simple patch.
The patch consists of adding a notional initialisation to the array
kpse_format_info, even though this is elaborately initialised at
runtime elsewhere in this module. Thus:
kpse_format_info_type kpse_format_info[kpse_last_format] = { 0 };
If this is not done, then this uninitialised global
symbol is labelled a `common symbol' by the OSX linker,
and this prevents it being includable in a Mach-O shared library.
This manifests itself in the error message
ld: common symbols not allowed with MH_DYLIB output format
(which I include here so that it'll show up in Google). See
<http://developer.apple.com/techpubs/macosx/DeveloperTools/MachORuntime/2rt_mach-o_overview/chapter_2_section_3.html#163040>
for Mach-specific discussion of this.
With this change, I (or rather, libtool) can successfully build a dynamic
library using code from libkpathsea.a. I don't know if this is the only
such symbol, since I don't know if the linker examines and complains
about all such global symbols in a library, or just the ones used in a
particular link.
I hope this helps. All the best,
Norman
--
---------------------------------------------------------------------------
Norman Gray http://www.astro.gla.ac.uk/users/norman/
Physics and Astronomy, University of Glasgow, UK norman at astro.gla.ac.uk
-------------- next part --------------
*** tex-file.c-orig Sun Jun 8 18:18:00 2003
--- tex-file.c Sun Jun 8 18:39:23 2003
***************
*** 39,43 ****
const_string kpse_fallback_resolutions_string = NULL;
unsigned *kpse_fallback_resolutions = NULL;
! kpse_format_info_type kpse_format_info[kpse_last_format];
/* These are not in the structure
--- 39,49 ----
const_string kpse_fallback_resolutions_string = NULL;
unsigned *kpse_fallback_resolutions = NULL;
! /* Add notional initialisation of kpse_format_info. This stops
! kpse_format_info being labeled as a `common symbol' on OSX, which stops
! it being included in a Mach-O shared library. See
! <http://developer.apple.com/techpubs/macosx/DeveloperTools/MachORuntime/2rt_mach-o_overview/chapter_2_section_3.html>
! for Mach-specific discussion of this.
! */
! kpse_format_info_type kpse_format_info[kpse_last_format] = { 0 };
/* These are not in the structure
More information about the tex-k
mailing list