Discussion:
Huge binaries. g++ 3.2.2 on SCO 3.2v5.05
(too old to reply)
John
2004-05-10 17:17:25 UTC
Permalink
After replacing g++ version 2.95.3 with g++ 3.2.2 my binary sizes have
become extremely large on SCO 3.2v5.05.
Only C++ binaries are like this, C compiles are fine (less than 6K for
hello world).


The bin utils package will not build a linker for my SCO platform so I
am using the SCO linker for both g++ compilers.

Hello world generates the following sizes using only the -s flag

g++ 2.95.3 compiler
object code: hello.o 1864 bytes
binary: hello 87728 bytes

g++ 3.2.2 compiler
object code: hello.o 1056 bytes
binary: hello 307516 bytes


The -Os flag does not help.


source code:

#include <iostream>
using namespace std;
int main()
{
cout << "Hello World\n";
return 0;
}



Thanks for any help.
llewelly
2004-05-10 20:45:51 UTC
Permalink
Post by John
After replacing g++ version 2.95.3 with g++ 3.2.2 my binary sizes have
become extremely large on SCO 3.2v5.05.
Only C++ binaries are like this, C compiles are fine (less than 6K for
hello world).
[snip]

Does gcc support shared linking on SCO? Try
$ g++ -shared hello.cc
J. L. Schilling
2004-05-11 16:24:19 UTC
Permalink
Post by llewelly
Post by John
After replacing g++ version 2.95.3 with g++ 3.2.2 my binary sizes have
become extremely large on SCO 3.2v5.05.
Only C++ binaries are like this, C compiles are fine (less than 6K for
hello world).
[snip]
Does gcc support shared linking on SCO? Try
$ g++ -shared hello.cc
That would be creating a shared library, but the poster wants
to create an a.out binary. What the poster needs to do is build
g++ so that libstdc++ is a dynamic library (.so) and not just an
archive (.a). This should keep all the ISO C++ iostreams stuff
(which tends to get large from locale stuff dependencies) from
being pulled into the a.out.

Jonathan Schilling

Loading...