Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: pedwards@valhalla.cs.wright.edu (Phil Edwards)
Subject: Re: gcc 2.7.2, ld warnings on Digital UNIX v3.2
Date: 1996/05/01	[thread overview]
Message-ID: <4m6a4n$em2@valhalla.cs.wright.edu> (raw)
In-Reply-To: 4lo9l0$n8g@disunms.epfl.ch


With <4lo9l0$n8g@disunms.epfl.ch>,
it seems Radenko Kalajdzic (rkalajdz@di.epfl.ch) sez:

[snip rebuild notes]
+ /usr/bin/ld:
+ Warning: clog defined as GLOBAL DATA but is defined in a shared 
+          lib as a GLOBAL FUNC
+ /usr/bin/ld:
+ Warning: clog defined as GLOBAL DATA but is defined in a shared 
+          lib as a GLOBAL FUNC
+ didec30: ~/projets/adaline >
+ ------

The problem is due to a conflict between iostream.h and libm.a.  The
iostream header file contains this declaration:

	extern _IO_ostream_withassign cout, cerr, clog;

The conflict lies with the complex logarithm function declared in
the mathematics library:

   [11 gamma]> cd /tmp
   [12 gamma]> ar xv /usr/ccs/lib/libm.a clog.o
   x - clog.o
   [13 gamma]> nm clog.o  
   
   Name                                    Value        Type
   Size
   
   __dpml_globals_table             | 0000000000000000 | N | 0000000000000000
   _fpdata                          | 0000000000000000 | U | 0000000000000000
   atan2                            | 0000000000000000 | U | 0000000000000008
*  clog                             | 0000000000000016 | T | 0000000000000008
   hypot                            | 0000000000000000 | U | 0000000000000008
   log                              | 0000000000000000 | U | 0000000000000008
   [14 gamma]> 

The *'ed line is the actual clog(3) function, and therein lies the
conflict:  the GLOBAL DATA is the clog declared in the header file,
and the GLOBAL FUNCtion is the result of g++ automatically linking
in the math library even though one usually doesn't ask g++ to do
so.

The solution is one of:

	1)  Ignore it.  ld(1) is just confused because the kind
	    folks at GNU are making stupid assumptions again.

	2)  Build a g++ which doesn't call for -lm, and thus not
	    link in the math library.  If you do this, be certain
	    to keep backups of the original g++.

	3)  Build a math library which doesn't contain clog(3), and
	    name it libm.a; keep the "real" one as liboldm.a or
	    something.  This is probably easier than (2), since all
	    it requires is lots of time spent with ar(1), but will
	    break any compilations requiring the complex logarithm
	    function.  Probably a bad idea, all in all.

	4)  Find a version of g++ in which "g++" is just a script
	    which calls gcc with command-line arguments, and then
	    remove "-lm" from the script.  Personally, I think GNU
	    made a /big/ mistake when they moved g++ to a separate
	    executable:  their goal of "an integrated compiler" is
	    now further away, and "gcc" doesn't correctly detect a
	    C++ program anymore.  Just my two timeslices there.

I went with option (1), and have been happier ever since.


Luck++;
Phil

-- 
#include<std/disclaimer.h>               The gods do not protect fools. Fools
finger pedwards@gamma.cs.wright.edu      are protected by more capable fools.
email pedwards@valhalla.cs.wright.edu                            -Larry Niven



  reply	other threads:[~1996-05-01  4:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-15  4:00 gcc 2.7.2, ld warnings on Digital UNIX v3.2 Carm Frascatore
1996-04-15  4:00 ` Murray S. Kucherawy
1996-04-17  4:00   ` Allen M. Cohen
1996-04-17  4:00     ` Norbert Berzen
1996-04-25  4:00       ` Radenko Kalajdzic
1996-05-01  4:00         ` Phil Edwards [this message]
1996-04-18  4:00     ` Tim Lucia
1996-05-01  4:00   ` Dale Hagglund
1996-05-01  4:00   ` Daniel S. Riley
1996-05-08  4:00   ` Jason Merrill
1996-05-08  4:00   ` Phil Edwards
1996-05-09  4:00   ` Gary Holt
1996-04-18  4:00 ` John C. Fowler
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox