From: pedwards@valhalla.cs.wright.edu (Phil Edwards)
Subject: Re: gcc 2.7.2, ld warnings on Digital UNIX v3.2
Date: 1996/05/08 [thread overview]
Message-ID: <4mopm2$tvo@valhalla.cs.wright.edu> (raw)
In-Reply-To: 4kubph$b90@vertex.tor.hookup.net
With <shybnctr78.fsf@lns100.lns.cornell.edu>,
it seems Daniel S. Riley (dsr@lns598.lns.cornell.edu) sez:
[...]
+ [...]
+ pedwards> 3) Build a math library which doesn't contain clog(3), and
+ pedwards> name it libm.a; keep the "real" one as liboldm.a or
+
+ Won't fix it. The problem is with libm.so, not libm.a. If it were
+ libm.a, the linker would just ignore the object module with clog in it,
+ unless clog were actually called somewhere (in which case you have
+ trouble anyway). It doesn't have that option with shared libraries,
+ hence the message. To fix it, you either have to change the name of
+ clog in libm.so, or fix g++ to link explicitly to libm.a instead of -lm.
Good point. IMHO, this might still pop up when compiling statically,
but as you say, they would have trouble anyway. And I'd love to "fix
g++ to link explicitly ...", but see below.
+ pedwards> 4) Find a version of g++ in which "g++" is just a script
+ pedwards> which calls gcc with command-line arguments, and then
+ pedwards> remove "-lm" from the script. Personally, I think GNU
+ pedwards> made a /big/ mistake when they moved g++ to a separate
+ pedwards> executable: their goal of "an integrated compiler" is
+ pedwards> now further away,
+
+ I don't understand this remark at all. g++ is just a front end that
+ calls gcc with the appropriate arguments; whether it is a shell script
+ or a C program makes no difference to how "integrated" the compiler
+ is,
It means I can't get inside the script and "fix g++" now. It used to
be very easy to change and customize without recompiling the entire
package. That flexibility is gone now.
+ as long as the C program has the same functionality as the shell
+ script. The front-ends have very little to do with how "integrated"
+ the compiler is anyway--everything interesting is in the back-ends.
My main beef with the g++ "integration" is...
+ pedwards> and "gcc" doesn't correctly detect a C++ program
+ pedwards> anymore.
+
+ Works for me--the only thing gcc doesn't do is insert the C++
+ libraries and -lm on the link line. And it must work for you, if g++
+ works, since all g++ does is construct an appropriate invocation of
+ gcc (just like the shell script did). Compile with 'g++ -v' if you
+ don't believe me.
1) I never asked GNU to automatically link the math library. Just
because I'm using C++ instead of C doesn't imply that I require the
hefty math functions present only in libm. I used to just invoke gcc
-- since the docs specify that it shouldn't matter, that gcc will see a
.C or .cc file and start looking for C++. Until...
2) I no longer have my little test bed program which would demonstrate
this, but I finally got fed up one day with gcc giving me braindead
errors on two pieces of reasonable C++ code. So I bit my tongue and
tried calling it as g++ instead. The first piece of code turned out to
be just fine -- it was simply a part of C that had been changed in the
C++ specifications, and the compiler was still treating it like illegal
C. The second piece of code still failed, but it failed with a
completely different error -- which turned out to be the /real/ problem
with that code.
I kept that .cc file for a long time, just to be able to demonstrate
that the testing of file extensions is broken in gcc 2.6.x and later,
and that to insure "C++ mode" one must call it as g++ -- which means
putting up with all of the moronic conflicts in the math library. One
/used/ to be able to simply use "gcc -x c++ -x none" along with any
other needed options -- much like the script would do -- and achieve a
perfect compilation. It still does this in 2.7.2, and now the docs
begin to imply that to get a perfect, really-C++-I-mean-it compilation,
one must use g++ because the binary image and only the binary image can
get the options correct.
I'm /this/ close to writing a dammit_i_never_asked_for_libm++
script, which calls g++, grabs the output, and greps out the two
clog-conflict lines, passing the rest onwards. :-|
Luck++;
Phil
--
pedwards@cs.wright.edu http://www.cs.wright.edu/people/students/pedwards/
The gods do not protect fools. Fools are
protected by more capable fools. -Larry Niven
next prev parent reply other threads:[~1996-05-08 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
1996-04-18 4:00 ` Tim Lucia
1996-05-01 4:00 ` Daniel S. Riley
1996-05-01 4:00 ` Dale Hagglund
1996-05-08 4:00 ` Phil Edwards [this message]
1996-05-08 4:00 ` Jason Merrill
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