Consultor Eletrônico



Kbase P101259: probuild and oebuild fails on Linux with undefined references __ctype_b, __ctype_tolower or __ctype_
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   28/06/2010
Status: Verified

SYMPTOM(s):

Fatal error when running probuild ldpro script on Linux

undefined reference to '__ctype_b'

undefined reference to '__ctype_tolower'

undefined reference to '__ctype_toupper'

probuild on Linux fails with undefined references __ctype_b __ctype_tolower __ctype_toupper

FACT(s) (Environment):

Progress 9.1E
OpenEdge 10.x
RedHat Enterprise Linux 3.0
RedHat Enterprise Linux 4.0
SuSe Enterprise Server 9

CAUSE:

The problem is related to glibc version shipped with the Linux versions listed above: the newer versions of glibc do not export __ctype_b() and 2 other functions.

The last one was glibc-2.3.2-5, and since Progress 9.1E, OpenEdge 10.0x, 32-bit OpenEdge 10.1A and 10.1B are built on RedHat 2.1, the version of glibc there contains these definitions.

FIX:

Quick workaround is to probuild your binary on RH 2.1 and deploy it on your Linux flavor.

If you do not have RH 2.1 in house, the following can be used in order to solve the problem:

1) Create "libctype.c" file containing

#include <stdlib.h>
#include <ctype.h>

__const unsigned short int * __ctype_b;
__const __int32_t * __ctype_tolower;
__const __int32_t * __ctype_toupper;

void __attribute__((constructor)) my_init() {
__ctype_b = * __ctype_b_loc();
__ctype_tolower = * __ctype_tolower_loc();
__ctype_toupper = * __ctype_toupper_loc();
}

void __attribute__((destructor)) my_clean() {
}

2) Compile the c code using "gcc -O2 -shared -o libctype.so libctype.c"

3) Amend "ldpro" script, or "build_rx.sh" for OpenEdge 10, to contain a referrence to "libctype.so" library

4) Execute "ldpro" script, or "build_rx.sh" for OpenEdge 10, the build of progress binary will now succeed

5) Do not forget to deploy "libctype.so" together with the progress binary you just built, as it depends on this library now.