Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 61639 - otcl-1.8-r1 (and r2): undefined reference to `Otcl_Init'
Summary: otcl-1.8-r1 (and r2): undefined reference to `Otcl_Init'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: TCL/TK Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-25 07:54 UTC by Alexandros Karypidis
Modified: 2004-08-28 11:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandros Karypidis 2004-08-25 07:54:45 UTC
Often, when I try to emerge otcl the build fails with:

[...]
ar cq libotcl.a otcl.o
ranlib libotcl.a
rm -f libotcl.so
gcc -o otclsh  -O2 -march=athlon-xp -fomit-frame-pointer -pipe -I/usr/lib/tcl8.4/include/generic -I. -I/usr/include -I/usr/include -I/include  otclAppInit.c \
-L. -lotcl -L/usr/lib -ltk8.4 -L/usr/lib -ltcl8.4 -L/usr/X11R6/lib -lXext -lX11  -lnsl -ldl -lm
ld -shared -o libotcl.so otcl.o
rm -f libotcl.so
gcc -o owish  -O2 -march=athlon-xp -fomit-frame-pointer -pipe -I/usr/lib/tcl8.4/include/generic -I. -I/usr/include -I/usr/include -I/include  otkAppInit.c \
-L. -lotcl -L/usr/lib -ltk8.4 -L/usr/lib -ltcl8.4 -L/usr/X11R6/lib -lXext -lX11  -lnsl -ldl -lm
/local/var/tmp/portage/otcl-1.8-r1/temp/ccDhTIb2.o(.text+0x4f): In function `Tcl_AppInit':
: undefined reference to `Otcl_Init'
collect2: ld returned 1 exit status
make: *** [otclsh] Error 1
make: *** Waiting for unfinished jobs....
/local/var/tmp/portage/otcl-1.8-r1/temp/ccNRjpNh.o(.text+0x67): In function `Tcl_AppInit':
: undefined reference to `Otcl_Init'
collect2: ld returned 1 exit status
make: *** [owish] Error 1


The build fails at various points.


Reproducible: Sometimes
Steps to Reproduce:
1. emerge otcl

Actual Results:  
Build fails. 

Expected Results:  
Build should proceed. 

The reason for this is a race condition which appears when MAKEOPTS="-jN" 
where N is larger than one is defined in /etc/make.globals 
 
When more than one target is being compiled concurrently by make, usually it's 
ok. In this case however, for some reason the Makefile deletes libotcl.so and 
libotcl.a at various points during the build and then re-creates them. If one 
target is being linked against the library while the other has just deleted 
it, the undefined symbol error occurs. 
 
Workaround: edit /etc/make.globals and specify MAKEOPTS="-j1" 
 
In a future release, I suggest: 
* The ebuild should check if "-jX" exists and strip it from MAKEOPTS. 
* The Makefile should be patched to not recreate the library for each target.
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2004-08-28 11:14:22 UTC
Fixed.