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

cc versus cc_r ??????

59 views
Skip to first unread message

Carlos da Cunha e Silva

unread,
Mar 10, 1998, 3:00:00 AM3/10/98
to

Hi,

Is there anyone out there who can explain me the difference between
these two methods of compilation ? I'm currently having trouble with an
interface program to an Oracle database, it partially written in
Microfocus cobol and partially written in C (we use the
the OCI functions to connect to the database). After stumbling into some
linking problems we finally managed to create a simple executable . But
when we execute this
we don't get the expected result ! First it displays some messages and
then it tries to connect to the Oracle database and it fails !

We took a trace and this shows us that a there is a connect attempt !!!

Now oracle is trying to persuade us that this could be caused by us
using cc and not cc_r since Oracle version 8 is re-entrant (whatever
this means !)

Is there anyone out there that can shed some light on this re-entrant
thing or explain
me what the difference is between cc and cc_r . I tried Info but I
wasn't very clear.

TIA

Carlos


walter schwendemann

unread,
Mar 10, 1998, 3:00:00 AM3/10/98
to

cc_r links to the "thread safe" library functions (e.g. libc_r)

--
Walter Schwendemann
schw...@mskcc.org
Carlos da Cunha e Silva wrote in message <350577AD...@anhyp.be>...

William E. Hannon Jr.

unread,
Mar 10, 1998, 3:00:00 AM3/10/98
to

"Carlos" == Carlos da Cunha e Silva <cdac...@anhyp.be> writes:
In article <350577AD...@anhyp.be> Carlos da Cunha e Silva <cdac...@anhyp.be> writes:


Carlos> Hi,
Carlos> Is there anyone out there who can explain me the difference between
Carlos> these two methods of compilation ?

cc is the NON-threaded C compiler
cc_r is the threaded C compiler

The threaded C (*_r) compiler allow for one or more pthreads to be used
in the process.

Carlos> I'm currently having trouble with an
Carlos> interface program to an Oracle database, it partially written in
Carlos> Microfocus cobol and partially written in C (we use the
Carlos> the OCI functions to connect to the database). After stumbling into some
Carlos> linking problems we finally managed to create a simple executable . But
Carlos> when we execute this
Carlos> we don't get the expected result ! First it displays some messages and
Carlos> then it tries to connect to the Oracle database and it fails !

Carlos> We took a trace and this shows us that a there is a connect attempt !!!

Carlos> Now oracle is trying to persuade us that this could be caused by us
Carlos> using cc and not cc_r since Oracle version 8 is re-entrant (whatever
Carlos> this means !)

If Oracle is using pthreads (any "pthread_*" function) then the
pthreads must be initialized (which is automagically done by the cc_r
compiler) OR that it uses the reentrant libraries (for example
libc_r.a). If Oracle is indeed threaded or using the reentrant
libraries then you should also ... you should not see any difference
in your program just that it is compiled differently

FYI you can display the Oracle libraries by issuing:
dump -H <oracle library>
(to display the libraries used by oracle
you need to do this for each of libraries displayed)

dump -Tv <oracle library>
(to display the symbol resolution of the library)

Carlos> Is there anyone out there that can shed some light on this re-entrant
Carlos> thing or explain
Carlos> me what the difference is between cc and cc_r . I tried Info but I
Carlos> wasn't very clear.

Carlos> TIA

Carlos> Carlos

================================================================================
Here are the stanzas from the /etc/xlC.cfg file which specify the
different options between the two compilers, if you are interested.
================================================================================
* C compiler, extended mode
cc: use = DEFLT
crt = /lib/crt0.o
mcrt = /lib/mcrt0.o
gcrt = /lib/gcrt0.o
libraries = -lc
proflibs = -L/lib/profiled,-L/usr/lib/profiled
options = -qlanglvl=extended,-qnoro,-qnoroconst

* standard c compiler aliased as cc_r (AIX Threads)
cc_r: use = DEFLT
crt = /lib/crt0_r.o
mcrt = /lib/mcrt0_r.o
gcrt = /lib/gcrt0_r.o
libraries = -L/usr/lib/threads,-lpthreads,-lc_r,/usr/lib/libc.a
proflibs = -L/lib/profiled,-L/usr/lib/profiled
options = -qnoansialias,-qlanglvl=extended,-qnoro,-qnoroconst,-D_THREAD_SAFE

* common definitions
DEFLT: cppcomp = /usr/lpp/xlC/exe/xlCentry
ccomp = /usr/lpp/xlC/exe/xlcentry
code = /usr/lpp/xlC/exe/xlCcode
inline = /usr/lpp/xlC/exe/xlCinline
cpp = /usr/lpp/xlC/exe/xlCcpp
munch = /usr/lpp/xlC/exe/munch
ipa = /usr/lpp/xlC/exe/ipa
dis = /usr/lpp/xlC/exe/dis
cppfilt = /usr/lpp/xlC/bin/c++filt
as = /bin/as
ld = /bin/ld
xlC = /usr/lpp/xlC/bin/xlC
tcovobj = /usr/lpp/xlC/lib/libtcov.o
cppinc = /usr/lpp/xlC/include
options = -D_AIX,-D_AIX32,-D_AIX41,-D_IBMR2,-D_POWER,-bpT:0x10000000,-bpD:0x20000000
ldopt = "b:o:e:u:R:H:Y:Z:L:T:A:V:k:j:"
xlCcopt = -qnoro,-qansialias
--
William E. Hannon Jr. internet:wha...@austin.ibm.com
DCE Service
Austin, Texas 78758 Department B3AS/9132 Phone:(512)838-3238 T/L(678)
'Confidence is what you had, before you understood the situation.' Dr. Dobson

Jens-Uwe Mager

unread,
Mar 10, 1998, 3:00:00 AM3/10/98
to

In article <350577AD...@anhyp.be>, Carlos da Cunha e Silva
<cdac...@anhyp.be> wrote:

> Hi,


>
> Is there anyone out there who can explain me the difference between

> these two methods of compilation ? I'm currently having trouble with an


> interface program to an Oracle database, it partially written in

> Microfocus cobol and partially written in C (we use the

> the OCI functions to connect to the database). After stumbling into some

> linking problems we finally managed to create a simple executable . But

> when we execute this


> we don't get the expected result ! First it displays some messages and

> then it tries to connect to the Oracle database and it fails !
>

> We took a trace and this shows us that a there is a connect attempt !!!
>

> Now oracle is trying to persuade us that this could be caused by us

> using cc and not cc_r since Oracle version 8 is re-entrant (whatever

> this means !)


>
> Is there anyone out there that can shed some light on this re-entrant

> thing or explain


> me what the difference is between cc and cc_r . I tried Info but I

> wasn't very clear.

If Oracle is multithreaded and you link in libraries from them then you
must compile any single executable using cc_r. If you have other libraries
that are in binary only and not compiled using cc_r then you will need the
convince the supplier to deliver cc_r compiled ones.
--
Jens-Uwe Mager <pgp-mailto:62CFDB25>

0 new messages