Bug 70482 - arts/flow/gsl/gslwchunk doesn't link on Solaris (missing "-lm")
Summary: arts/flow/gsl/gslwchunk doesn't link on Solaris (missing "-lm")
Status: RESOLVED FIXED
Alias: None
Product: configure
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-15 09:05 UTC by Torsten Kasch
Modified: 2004-01-12 16:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Kasch 2003-12-15 09:05:00 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc version 2.95.3 20010315 (release) 
OS:          Solaris

trying to compile arts on Solaris 8 (SPARC) breaks for me with:

source='gslwchunk.c' object='gslwchunk.o' libtool=no \
depfile='.deps/gslwchunk.Po' tmpdepfile='.deps/gslwchunk.TPo' \
depmode=gcc /bin/bash ../../admin/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../flow -I../../flow -I../../mcop -I../.. -I/vol/kde-3.2.0/include -I/vol/qt-3.2.3/include -I/usr/openwin/include  -I/vol/local/include -I/vol/graphics/include -I../../libltdl  -DQT_THREAD_SUPPORT  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4 -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include   -DNDEBUG -O2 -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include -DNDEBUG -O2   -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include   -c `test -f 'gslwchunk.c' || echo './'`gslwchunk.c
/bin/bash ../../libtool --silent --mode=link gcc -DNDEBUG -O2 -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include -DNDEBUG -O2   -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include    -R/vol/kde-3.2.0/lib -R/vol/qt-3.2.3/lib -R/vol/local/lib -R/vol/graphics/lib -o gslwchunk  gslwchunk.o libgsl.la
ld: warning: file /vol/gtk-2.2.1/lib/libgmodule-2.0.so: attempted multiple inclusion of file
ld: warning: file /vol/gtk-2.2.1/lib/libgthread-2.0.so: attempted multiple inclusion of file
ld: warning: file /vol/gtk-2.2.1/lib/libglib-2.0.so: attempted multiple inclusion of file
Undefined                       first referenced
 symbol                             in file
tan                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
pow                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
sinh                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
tanh                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
sqrt                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
sin                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
cosh                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
cos                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
ld: fatal: Symbol referencing errors. No output written to .libs/gslwchunk
collect2: ld returned 1 exit status
make[3]: *** [gslwchunk] Error 1
make[3]: Leaving directory `/vol/src/kde/cvs/arts/flow/gsl'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/vol/src/kde/cvs/arts/flow'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/vol/src/kde/cvs/arts'
make: *** [all] Error

applying the following trivial patch to arts/flow/gsl/Makefile.am resolved this issue for me:

diff -u -3 -p -u -r1.32 Makefile.am
--- Makefile.am 2 Oct 2003 11:58:49 -0000       1.32
+++ Makefile.am 15 Dec 2003 08:03:34 -0000
@@ -17,7 +17,7 @@ libgsl_la_LDFLAGS = -no-undefined $(all_
 
 noinst_PROGRAMS = $(GSL_NOINST_PROGS)
 
-GSL_progs_ldadd = libgsl.la $(USE_THREADS)
+GSL_progs_ldadd = libgsl.la -lm $(USE_THREADS)
 GSL_cc_dummy = dummy.cc
 $(srcdir)/dummy.cc: gslconfig.h
Comment 1 Dirk Mueller 2004-01-10 13:07:50 UTC
hmm, weird, there is already a -lm in libgsl_la_LIBADD for me. that should already fix this problem, right?

Comment 2 Torsten Kasch 2004-01-10 15:46:24 UTC
Yes, indeed, I cannot reproduce this error anymore on my x86 box, so I suspect the bug's gone (for whatever reason; I didn't find anything in the cvs logs).
Comment 3 Torsten Kasch 2004-01-12 10:45:08 UTC
Hmmm, I just started a fresh compile on our SPARC systems now, and unfortunately it fails (I've removed the "--silent" option for libtool, and rebuilt libgsl.a; see below).

The only difference between the x86 and SPARC systems I can think of right now is that I use the GNU binutils ony my x86 box whereas I rely on Sun's linker/assembler on the SPARC systems...

It seems that I need the following patch in this case for SPARC (I just successfully compiled arts with it, will try the same on x86 this evening):

tk@neo cvs diff Makefile.am 
Index: Makefile.am
===================================================================
RCS file: /home/kdecvs/kde/arts/flow/gsl/Makefile.am,v
retrieving revision 1.32
diff -u -3 -p -r1.32 Makefile.am
--- Makefile.am 2 Oct 2003 11:58:49 -0000       1.32
+++ Makefile.am 12 Jan 2004 09:38:46 -0000
@@ -17,7 +17,7 @@ libgsl_la_LDFLAGS = -no-undefined $(all_
 
 noinst_PROGRAMS = $(GSL_NOINST_PROGS)
 
-GSL_progs_ldadd = libgsl.la $(USE_THREADS)
+GSL_progs_ldadd = libgsl.la -lm $(USE_THREADS)
 GSL_cc_dummy = dummy.cc
 $(srcdir)/dummy.cc: gslconfig.h



--- snip ---
/bin/ksh ../../libtool --mode=link --tag=CXX g++  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -fno-builtin -g -O2 -fno-exceptions -fno-check-new -fno-common  -ftemplate-depth-99   -R/vol/kde-cvs/lib -R/vol/qt-3.2.3/lib -R/vol/local/lib -R/vol/graphics/lib -o libgsl.la  -no-undefined  -L/usr/openwin/lib -L/vol/qt-3.2.3/lib -L/vol/kde-cvs/lib  -L/vol/local/lib -L/vol/graphics/lib gsldatacache.lo gsldatahandle.lo gslwavechunk.lo gsldatahandle-vorbis.lo gslmath.lo gslfilter.lo gslcommon.lo gsldatautils.lo gslmagic.lo gslloader-wav.lo gslloader-gslwave.lo gslloader-mad.lo gslloader-oggvorbis.lo gslconvert.lo gslfft.lo gslsignal.lo gslloader.lo gslwaveosc.lo gslengine.lo gsloputil.lo gslopmaster.lo gslopschedule.lo gsldatahandle-mad.lo gslosctable.lo gsloscillator.lo gslfilehash.lo gslartsthreads.lo ../../mcop/libmcop.la -lm -lposix4   -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lintl   
rm -fr  .libs/libgsl.a .libs/libgsl.la
ar cru .libs/libgsl.a .libs/gsldatacache.o .libs/gsldatahandle.o .libs/gslwavechunk.o .libs/gsldatahandle-vorbis.o .libs/gslmath.o .libs/gslfilter.o .libs/gslcommon.o .libs/gsldatautils.o .libs/gslmagic.o .libs/gslloader-wav.o .libs/gslloader-gslwave.o .libs/gslloader-mad.o .libs/gslloader-oggvorbis.o .libs/gslconvert.o .libs/gslfft.o .libs/gslsignal.o .libs/gslloader.o .libs/gslwaveosc.o .libs/gslengine.o .libs/gsloputil.o .libs/gslopmaster.o .libs/gslopschedule.o .libs/gsldatahandle-mad.o .libs/gslosctable.o .libs/gsloscillator.o .libs/gslfilehash.o .libs/gslartsthreads.o
ranlib .libs/libgsl.a
creating libgsl.la
(cd .libs && rm -f libgsl.la && ln -s ../libgsl.la libgsl.la)
/bin/ksh ../../libtool --mode=link gcc -g -O2 -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include -g -O2   -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include    -R/vol/kde-cvs/lib -R/vol/qt-3.2.3/lib -R/vol/local/lib -R/vol/graphics/lib -o gslwchunk  gslwchunk.o libgsl.la  
gcc -g -O2 -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include -g -O2 -threads -I/vol/gtk-2.2.1/include/glib-2.0 -I/vol/gtk-2.2.1/lib/glib-2.0/include -o .libs/gslwchunk gslwchunk.o  ./.libs/libgsl.a -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -L/usr/openwin/lib -L/vol/qt-3.2.3/lib -L/vol/kde-cvs/lib -L/vol/local/lib -L/vol/graphics/lib /vol/src/kde/cvs/arts/mcop/.libs/libmcop.so -L/vol/gtk-2.2.1/lib -lsocket -lnsl -lposix4 /vol/gtk-2.2.1/lib/libgmodule-2.0.so -ldl /vol/gtk-2.2.1/lib/libgthread-2.0.so /vol/gtk-2.2.1/lib/libglib-2.0.so -lintl -R/vol/kde-cvs/lib -R/vol/gtk-2.2.1/lib -R/vol/qt-3.2.3/lib -R/vol/local/lib -R/vol/graphics/lib
ld: warning: file /vol/gtk-2.2.1/lib/libgmodule-2.0.so: attempted multiple inclusion of file
ld: warning: file /vol/gtk-2.2.1/lib/libgthread-2.0.so: attempted multiple inclusion of file
ld: warning: file /vol/gtk-2.2.1/lib/libglib-2.0.so: attempted multiple inclusion of file
Undefined                       first referenced
 symbol                             in file
tan                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
pow                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
sinh                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
tanh                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
sqrt                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
sin                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
cosh                                ./.libs/libgsl.a(gslmath.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
cos                                 ./.libs/libgsl.a(gslsignal.o)  (symbol belongs to implicit dependency /usr/lib/libm.so.1)
ld: fatal: Symbol referencing errors. No output written to .libs/gslwchunk
collect2: ld returned 1 exit status
make: *** [gslwchunk] Error 1

Comment 4 Stephan Kulow 2004-01-12 16:31:45 UTC
Subject: arts/flow/gsl

CVS commit by coolo: 

adding -lm - it can't really hurt
CCMAIL: 70482-done@bugs.kde.org


  M +1 -1      Makefile.am   1.33


--- arts/flow/gsl/Makefile.am  #1.32:1.33
@@ -18,5 +18,5 @@
 noinst_PROGRAMS = $(GSL_NOINST_PROGS)
 
-GSL_progs_ldadd = libgsl.la $(USE_THREADS)
+GSL_progs_ldadd = libgsl.la -lm $(USE_THREADS)
 GSL_cc_dummy = dummy.cc
 $(srcdir)/dummy.cc: gslconfig.h