misc/60243: Problem in calling kpathsea library from Python
kris at obsecurity.org
Sun Feb 22 18:50:20 PST 2004
The following reply was made to PR misc/60243; it has been noted by GNATS.
From: Kris Kennaway <kris at obsecurity.org>
To: Jin-Hwan Cho <chofchof at ktug.or.kr>
Cc: Kris Kennaway <kris at obsecurity.org>,
freebsd-gnats-submit at FreeBSD.org
Subject: Re: misc/60243: Problem in calling kpathsea library from Python extension
Date: Sun, 22 Feb 2004 18:48:59 -0800
On Mon, Feb 23, 2004 at 11:41:53AM +0900, Jin-Hwan Cho wrote:
> >>Is there any way to use "hash_create" in the kpathsea library
> >>instead of the standard libc?
> >Sorry for the delay in responding to this. Did you ever resolve this?
> Surely. In my FreeBSD 5 machine, the command above gives exactly.
> Here is another information of my libc.so.5.
> /usr/lib$ ls -al libc.so.5
> -r--r--r-- 1 root wheel 886848 Jun 5 2003 libc.so.5
> /usr/lib$ objdump -f libc.so.5
> libc.so.5: file format elf32-i386-freebsd
> architecture: i386, flags 0x00000150:
> HAS_SYMS, DYNAMIC, D_PAGED
> start address 0x0001c470
OK, you have an old 5.x installation. It was fixed at some point in
the last 8 months.
> >I wonder if you are linking to libc before libkpathsea (e.g. -lc
> >-lkpathsea); symbols are resolved to the first library in the sequence
> >that contains them.
> I already new because there was some discussion on that topic in the
> TeX world. Here is the compiling commands generated by Python.
> ~/test/kpathsea$ python setup.py build
> running build
> running build_ext
> building 'kpse' extension
> creating build
> creating build/temp.freebsd-5.1-RELEASE-i386-2.2
> cc -DNDEBUG -O -pipe -mcpu=pentiumpro -D_THREAD_SAFE -fPIC
> -DHASH_SHARED -I/usr/local/include -I/usr/local/include/python2.2 -c
> kpse_module.c -o build/temp.freebsd-5.1-RELEASE-i386-2.2/kpse_module.o
> creating build/lib.freebsd-5.1-RELEASE-i386-2.2
> cc -shared -lc_r build/temp.freebsd-5.1-RELEASE-i386-2.2/kpse_module.o
> -L/usr/local/lib -lkpathsea -o
> I tried the last link command without -lc_r and -lkpathsea -lc_r, etc.
> But all failed. Could you tell me what I missed?
> >Also, I can't reproduce that libc.so.5 contains the hash_create symbol:
> >kkenn at enigma:/lib objdump -T libc.so.5 | grep hash
> >00000000000000e8 l d .hash 0000000000000000
> >000000000003b4a0 g DF .text 0000000000000020 uuid_hash
> >00000000001ee970 g DO .data 0000000000000008 __default_hash
> >00000000000cff00 g DF .text 0000000000000040 __call_hash
> >00000000000cec80 g DF .text 00000000000003a4 __hash_open
> Is your operating system FreeBSD? My machine does not have the directory
> /lib. Actually I tested my code in another operating systems, but no
> problem yet; even there was no problem in Mac OS X.
FreeBSD 5.2 moved a number of libraries from /usr/lib to /lib to allow
a dynamically-linked root partition. This aspect is unrelated to your
problem, but it sounds like upgrading to 5.2-RELEASE will fix it
More information about the freebsd-bugs