Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

undefined reference to `__ctype_b' (ATTN: Paul Pluzhnikov)

535 views
Skip to first unread message

Tristan Miller

unread,
Nov 6, 2005, 5:40:37 PM11/6/05
to
Greetings.

I'm trying to rebuild an application from a third-party vendor. Only some
source is provided; the rest of the package consists of compiled libraries
which I presume use an outdated Red Hat glibc-2.0. When I try to build on
my SuSE 9.3 glibc-2.3.4 system, I get many errors of the following form:

/tmp/inquery-3.2/obj/inqr.o(.text+0x8cc): In function
`inqr_write_top_n_docs':
/usr/wag/users1/connell/inquery/linux-build/src/inqr.c:610: undefined
reference to `__ctype_b'

The same error occurs for the symbols __ctype_tolower and __ctype_toupper.

I found a recent Usenet post by Paul Pluzhnikov at
<news:m3slyqn...@somewhere.in.california.localhost> which suggested
recompiling my glibc from the source RPM, except with a patched
locale/lc-ctype.c file as follows:

-compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
-compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
-compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);
+versioned_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
+versioned_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
+versioned_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);

I did this. However, upon recompiling, I now get the following errors when
the make gets to lc-ctype.c:

gcc lc-ctype.c -c -std=gnu99 -DNDEBUG=1 -O2 -Wall -Winline
-Wstrict-prototypes -Wwrite-strings -fmessage-length=0 -g -march=i586
-mcpu=i686 -mpreferred-stack-boundary=2 -fPIC
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -DHAVE_CONFIG_H -Iprograms
-I../include -I. -I/home/psy/rpm/BUILD/glibc-2.3/cc/locale -I.. -I../libio
-I/home/psy/rpm/BUILD/glibc-2.3/cc -I../sysdeps/i386/elf
-I../linuxthreads/sysdeps/unix/sysv/linux/i386
-I../linuxthreads/sysdeps/unix/sysv/linux
-I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread
-I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix
-I../linuxthreads/sysdeps/i386/i586 -I../linuxthreads/sysdeps/i386
-I../libidn/sysdeps/unix -I../sysdeps/unix/sysv/linux/i386
-I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common
-I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386
-I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/i386/i586 -I../sysdeps/i386/i486
-I../sysdeps/i386/fpu -I../sysdeps/i386 -I../sysdeps/wordsize-32
-I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64
-I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf
-I../sysdeps/generic -nostdinc
-isystem /usr/lib/gcc-lib/i586-suse-linux/3.3.5/include
-isystem /home/psy/rpm/BUILD/kernel-headers -D_LIBC_REENTRANT
-include ../include/libc-symbols.h -DPIC -DSHARED
-o /home/psy/rpm/BUILD/glibc-2.3/cc/locale/lc-ctype.os -MD -MP
-MF /home/psy/rpm/BUILD/glibc-2.3/cc/locale/lc-ctype.os.dt
-MT /home/psy/rpm/BUILD/glibc-2.3/cc/locale/lc-ctype.os
/tmp/ccaZWLwZ.s: Assembler messages:
/tmp/ccaZWLwZ.s:5805: Error: invalid attempt to declare external version
name as default in symbol `__ctype_b@@GLIBC_2.0'
/tmp/ccaZWLwZ.s:5805: Error: invalid attempt to declare external version
name as default in symbol `__ctype_tolower@@GLIBC_2.0'
/tmp/ccaZWLwZ.s:5805: Error: invalid attempt to declare external version
name as default in symbol `__ctype_toupper@@GLIBC_2.0'

Any idea what's wrong or how to fix it?

Regards,
Tristan

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you

Paul Pluzhnikov

unread,
Nov 6, 2005, 11:12:28 PM11/6/05
to
Tristan Miller <psych...@nothingisreal.com> writes:

> I found a recent Usenet post by Paul Pluzhnikov at
> <news:m3slyqn...@somewhere.in.california.localhost> which suggested
> recompiling my glibc from the source RPM, except with a patched
> locale/lc-ctype.c file as follows:
>
> -compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
> -compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
> -compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);
> +versioned_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
> +versioned_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
> +versioned_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);

The magic incantation has changed.
For libc-2.3.5-10, the new "spell" is this:

--- locale/lc-ctype.c.orig 2005-11-06 20:13:29.000000000 -0800
+++ locale/lc-ctype.c 2005-11-06 20:13:41.000000000 -0800
@@ -94,9 +94,9 @@
We need those relocations so that a versioned definition with a COPY
reloc in an executable will override the libc.so definition. */



-compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
-compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
-compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);

+// compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
+// compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
+// compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);
compat_symbol (libc, __ctype32_b, __ctype32_b, GLIBC_2_0);
compat_symbol (libc, __ctype32_tolower, __ctype32_tolower, GLIBC_2_2);
compat_symbol (libc, __ctype32_toupper, __ctype32_toupper, GLIBC_2_2);


--- ctype/ctype-info.c.orig 2005-11-06 20:11:07.000000000 -0800
+++ ctype/ctype-info.c 2005-11-06 20:11:19.000000000 -0800
@@ -55,9 +55,9 @@
const __uint32_t *__ctype32_tolower = b (__uint32_t, tolower, 128);
const __uint32_t *__ctype32_toupper = b (__uint32_t, toupper, 128);



-compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
-compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
-compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);

+// compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
+// compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
+// compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);
compat_symbol (libc, __ctype32_b, __ctype32_b, GLIBC_2_0);
compat_symbol (libc, __ctype32_tolower, __ctype32_tolower, GLIBC_2_2);
compat_symbol (libc, __ctype32_toupper, __ctype32_toupper, GLIBC_2_2);


Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

0 new messages