I thought there might be a chance of some binary incompatibility between the
Debian unstable version of gcc/binutils etc., when
/usr/lib/yorick/lib/main.o was built and my present Debian testing version
of gcc/binutils, etc.
Therefore, I rebuilt all the yorick packages using
apt-src build yorick
and installed them.
My attempt to use "make debug" to build a standalone version of yorick failed
in exactly the same way. Here are the exact
results when I attempt to do this by hand.
[EMAIL PROTECTED]> cc -g -Wl,-E -o yplot /usr/lib/yorick/lib/main.o yinit.o -L. -lyplot
-L/usr/lib/yorick/lib -L/home/software/plplot_cvs/installcmake/lib -lplplotd -lltdl -ldl -lm
-lcsirocsa -lcsironn -lqhull -lfreetype -Wl,-rpath
-Wl,/home/software/plplot_cvs/installcmake/lib `/usr/lib/yorick/lib/libdep.sh
"/usr/lib/yorick" ` -lyor -lX11 -lm -ldl
/usr/bin/ld: error in /usr/lib/yorick/lib/main.o(.eh_frame); no .eh_frame_hdr
table will be created.
/usr/lib/gcc/x86_64-linux-gnu/4.3.1/../../../../lib/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
I then looked carefully at the above debian build messages for
all instances where main.o was mentioned. It is built using the Unix version
of pmain.c.
I then copied pmain.c to my own directory as main.c, and built a local main.o
using the exact same command as used in the deb build (with the -I option
changed to point to the absolute location of the play directory rather than
the relative location as in the deb build.
[EMAIL PROTECTED]> gcc -g -I/home/software/apt-src/yorick-2.1.05+dfsg/play -c
main.c
Then, I repeated the above yplot build by hand using this local version of
main.o. No errors resulted, and yplot worked fine as a standalone version
of yorick with interface to PLplot plotting.
Since the compilation and link steps used to generate the bad yplot build
result above and the good yplot build result are identical, the only
possibility I could think of was the strip of
/usr/lib/yorick/lib/main.o in preparation for putting that file
into the yorick-dev package was causing the problem.
Indeed, if I use the same strip on my local main.o, i.e.,
strip --remove-section=.comment --remove-section=.note main.o
I get the same build error. Furthermore, I get the same build error if I
just use either one of the above strip options or strip with no options at
all.
I then tried the attached patch (which removes the strip command from
rules) to the yorick source tree built above, rebuilt and installed the
debs, and all was well.
So it appears that application of the attached patch is the correct fix for
this important issue. This makes sense since main.o is just a compiled
object where the symbols should not be stripped since symbols are actually
needed in order to link a viable executable using main.o
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
--- rules.old 2008-07-14 09:57:49.000000000 -0700
+++ rules 2008-07-14 09:58:05.000000000 -0700
@@ -60,7 +60,6 @@
cd build/lib/yorick/lib; \
mv codger install.grp install.sh libdep.sh libyor.a main.o \
$(CURDIR)/build/yorick-dev/lib/yorick/lib
- strip --remove-section=.comment --remove-section=.note
build/yorick-dev/lib/yorick/lib/main.o
cp emacs/yorick-auto.el build/50yorick-auto.el
convert icons/yicon32.png build/yorick32x32.xpm
convert icons/yicon16.png build/yorick16x16.xpm