public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* libstdc++
@ 2012-08-24  8:10 naga raj
  2012-08-24  9:33 ` libstdc++ Andrew Haley
  2012-08-24 13:40 ` libstdc++ Jonathan Wakely
  0 siblings, 2 replies; 9+ messages in thread
From: naga raj @ 2012-08-24  8:10 UTC (permalink / raw)
  To: gcc-help

Hi,

   I have ported Gcc-4.6.2 to an embedded target. My C++ compiler is
generating huge code size.

  #include <iostream>
 using namespace std;
 int main()
 {
   return 0;
 }

   If we execute the above program then all the function in the
iostream library are included in the elf as a result size of elf is
increased....


Please help me in solving this issue..

Thanks in Advance,
Nagaraju

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: libstdc++
  2012-08-24  8:10 libstdc++ naga raj
@ 2012-08-24  9:33 ` Andrew Haley
  2012-08-24 13:40 ` libstdc++ Jonathan Wakely
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Haley @ 2012-08-24  9:33 UTC (permalink / raw)
  To: naga raj; +Cc: gcc-help

On 08/24/2012 08:46 AM, naga raj wrote:
> Hi,
> 
>    I have ported Gcc-4.6.2 to an embedded target. My C++ compiler is
> generating huge code size.
> 
>   #include <iostream>
>  using namespace std;
>  int main()
>  {
>    return 0;
>  }
> 
>    If we execute the above program then all the function in the
> iostream library are included in the elf as a result size of elf is
> increased....
> 
> 
> Please help me in solving this issue..

You're going to have to use custom I/O.  To start, link with
-Wl,-Map,mapfile to see what dependencies are being pulled in.

Andrew.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: libstdc++
  2012-08-24  8:10 libstdc++ naga raj
  2012-08-24  9:33 ` libstdc++ Andrew Haley
@ 2012-08-24 13:40 ` Jonathan Wakely
  2012-08-27  9:27   ` libstdc++ naga raj
  1 sibling, 1 reply; 9+ messages in thread
From: Jonathan Wakely @ 2012-08-24 13:40 UTC (permalink / raw)
  To: naga raj; +Cc: gcc-help

On 24 August 2012 08:46, naga raj wrote:
> Hi,
>
>    I have ported Gcc-4.6.2 to an embedded target. My C++ compiler is
> generating huge code size.
>
>   #include <iostream>
>  using namespace std;
>  int main()
>  {
>    return 0;
>  }
>
>    If we execute the above program then all the function in the
> iostream library are included in the elf as a result size of elf is
> increased....

Including <iostream> causes global objects to be constructed, so even
though you're not explicitly using std::cout or std::cin, those
streams are initialized and code is run (before main) just because
<iostream> is included.  If you don't need to use it then don't
include it.  If you do need to use it then obviously the code size is
larger if you use I/O features than if you don't use them.

That said, libstdc++ isn't really optimised for embedded systems.
Some configure-time options such as building libstdc++ without
exceptions can help reduce code size, if you don't need to use
exceptions.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43852 would also help
avoid dependency on the I/O facilities.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: libstdc++
  2012-08-24 13:40 ` libstdc++ Jonathan Wakely
@ 2012-08-27  9:27   ` naga raj
  0 siblings, 0 replies; 9+ messages in thread
From: naga raj @ 2012-08-27  9:27 UTC (permalink / raw)
  To: Jonathan Wakely, Andrew Haley; +Cc: gcc-help

Hi Jonathan/Andrew

  Thank you very much for your responses.
  I think I have to select a subset of the C++ standard libraries and
implement a smaller library.

Thanks,
Nagaraju



On Fri, Aug 24, 2012 at 3:09 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 24 August 2012 08:46, naga raj wrote:
>> Hi,
>>
>>    I have ported Gcc-4.6.2 to an embedded target. My C++ compiler is
>> generating huge code size.
>>
>>   #include <iostream>
>>  using namespace std;
>>  int main()
>>  {
>>    return 0;
>>  }
>>
>>    If we execute the above program then all the function in the
>> iostream library are included in the elf as a result size of elf is
>> increased....
>
> Including <iostream> causes global objects to be constructed, so even
> though you're not explicitly using std::cout or std::cin, those
> streams are initialized and code is run (before main) just because
> <iostream> is included.  If you don't need to use it then don't
> include it.  If you do need to use it then obviously the code size is
> larger if you use I/O features than if you don't use them.
>
> That said, libstdc++ isn't really optimised for embedded systems.
> Some configure-time options such as building libstdc++ without
> exceptions can help reduce code size, if you don't need to use
> exceptions.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43852 would also help
> avoid dependency on the I/O facilities.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: libstdc++
  1999-11-07  5:16 ` libstdc++ J.H.M. Dassen (Ray)
@ 1999-11-30 23:28   ` J.H.M. Dassen (Ray)
  0 siblings, 0 replies; 9+ messages in thread
From: J.H.M. Dassen (Ray) @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

Inferno <esheesle@bcpl.net> wrote:
>I have an Intel 486 running Solaris 2.5.1.  I am trying to install
>libstdc++(either 2.90.6 or 2.8.1.1) and neither works.

GNU libstdc++ (as well as libg++) is tightly coupled to the compiler
version; you can only compile it using the particular compiler version it is
supposed to work with.

>It used to work fine with GCC2.8.1 but now using GCC 2.95.1 it won't.

As of 2.95, the gcc sources include the libstdc++ source, so if you build
gcc 2.95.2 from source, you should get a working C++ compiler with matching
libstd++.

HTH,
-- 
Ray Dassen <jhm@cistron.nl>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* libstdc++
  1999-11-04 18:42 libstdc++ Inferno
  1999-11-07  5:16 ` libstdc++ J.H.M. Dassen (Ray)
@ 1999-11-30 23:28 ` Inferno
  1 sibling, 0 replies; 9+ messages in thread
From: Inferno @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

I have an Intel 486 running Solaris 2.5.1.  I am trying to install
libstdc++(either 2.90.6 or 2.8.1.1) and neither works.  2.8.1.1 gives
the following failures:
else true ; fi
c++ -c -g -O2 -fno-implicit-templates -I. -I./stl -I../libio
-I./../libio -nostdinc++  -DC `for N in REP MAIN TRAITS ADDSS ADDPS
ADDCS ADDSP ADDSC  EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS
GTPS GTSP  LESS LEPS LESP GESS GEPS GESP; do echo " -D${N}"; done` \
  ./sinst.cc -o cstrmain.o
In file included from ../libio/iostream.h:31,
                 from stl/stl_alloc.h:45,
                 from stl/alloc.h:21,
                 from std/bastring.h:39,
                 from string:6,
                 from ./sinst.cc:36:
../libio/streambuf.h: In method `ios::~ios()':
../libio/streambuf.h:485: warning: `void *' is not a pointer-to-object
type
./sinst.cc: At top level:
./sinst.cc:47: explicit instantiation of `class
string_char_traits<char>' after
std/straits.h:132: explicit specialization here
*** Error code 1
make: Fatal error: Command failed for target `bigstmp-string'
Current working directory /root/libstdc++-2.8.1.1/libraries/libstdc++
*** Error code 1
make: Fatal error: Command failed for target `all-target-libstdc++'
#

It used to work fine with GCC2.8.1 but now using GCC 2.95.1 it won't.
Ideas?

Thanks,
Inferno

--
"Life is the whim of several billion cells to be you for a while."
                                            --Inferno


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: libstdc++
  1999-11-04 18:42 libstdc++ Inferno
@ 1999-11-07  5:16 ` J.H.M. Dassen (Ray)
  1999-11-30 23:28   ` libstdc++ J.H.M. Dassen (Ray)
  1999-11-30 23:28 ` libstdc++ Inferno
  1 sibling, 1 reply; 9+ messages in thread
From: J.H.M. Dassen (Ray) @ 1999-11-07  5:16 UTC (permalink / raw)
  To: help-gcc

Inferno <esheesle@bcpl.net> wrote:
>I have an Intel 486 running Solaris 2.5.1.  I am trying to install
>libstdc++(either 2.90.6 or 2.8.1.1) and neither works.

GNU libstdc++ (as well as libg++) is tightly coupled to the compiler
version; you can only compile it using the particular compiler version it is
supposed to work with.

>It used to work fine with GCC2.8.1 but now using GCC 2.95.1 it won't.

As of 2.95, the gcc sources include the libstdc++ source, so if you build
gcc 2.95.2 from source, you should get a working C++ compiler with matching
libstd++.

HTH,
-- 
Ray Dassen <jhm@cistron.nl>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* libstdc++
@ 1999-11-04 18:42 Inferno
  1999-11-07  5:16 ` libstdc++ J.H.M. Dassen (Ray)
  1999-11-30 23:28 ` libstdc++ Inferno
  0 siblings, 2 replies; 9+ messages in thread
From: Inferno @ 1999-11-04 18:42 UTC (permalink / raw)
  To: help-gcc

I have an Intel 486 running Solaris 2.5.1.  I am trying to install
libstdc++(either 2.90.6 or 2.8.1.1) and neither works.  2.8.1.1 gives
the following failures:
else true ; fi
c++ -c -g -O2 -fno-implicit-templates -I. -I./stl -I../libio
-I./../libio -nostdinc++  -DC `for N in REP MAIN TRAITS ADDSS ADDPS
ADDCS ADDSP ADDSC  EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS
GTPS GTSP  LESS LEPS LESP GESS GEPS GESP; do echo " -D${N}"; done` \
  ./sinst.cc -o cstrmain.o
In file included from ../libio/iostream.h:31,
                 from stl/stl_alloc.h:45,
                 from stl/alloc.h:21,
                 from std/bastring.h:39,
                 from string:6,
                 from ./sinst.cc:36:
../libio/streambuf.h: In method `ios::~ios()':
../libio/streambuf.h:485: warning: `void *' is not a pointer-to-object
type
./sinst.cc: At top level:
./sinst.cc:47: explicit instantiation of `class
string_char_traits<char>' after
std/straits.h:132: explicit specialization here
*** Error code 1
make: Fatal error: Command failed for target `bigstmp-string'
Current working directory /root/libstdc++-2.8.1.1/libraries/libstdc++
*** Error code 1
make: Fatal error: Command failed for target `all-target-libstdc++'
#

It used to work fine with GCC2.8.1 but now using GCC 2.95.1 it won't.
Ideas?

Thanks,
Inferno

--
"Life is the whim of several billion cells to be you for a while."
                                            --Inferno


^ permalink raw reply	[flat|nested] 9+ messages in thread

* libstdc++
@ 1999-10-01  0:00 Inferno
  0 siblings, 0 replies; 9+ messages in thread
From: Inferno @ 1999-10-01  0:00 UTC (permalink / raw)
  To: help-gcc

I have gcc295 installed on my solaris 2.5.1 system.  I had gcc281 with
libstdc++ 2.8.1.1 installed.  I installed gcc295 over top of it.  I
tried to install libstdc++2.90.6 on my system and it gives several
errors during make about the src directory and not finding files.  I
checked the archive and it is fine.  I installed the libstdc++ on
another machine with no problem and one machine did have a problem(same
problem) other than my own machine.  What is going on.   I just used the
commands "configure, make, make install" in that order.  Ideas?

Thanks,
Inferno

--
What is reality?  Reality is what we believe.
What is the answer?  The answer is out there.
What drives us to do what we do?  The question.
We are the future.  We control reality, we
understand what reality really is.  The rest of the
world is blinded to the truth, but we know the truth.
What is the Matrix?  Reality, the universe in general.
Those who understand the matrix shape the matrix.
Because our eyes have been opened, we can
shape reality.
Who are we?  Infinity...
                         -Inferno
                         "The One"


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-27  5:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-24  8:10 libstdc++ naga raj
2012-08-24  9:33 ` libstdc++ Andrew Haley
2012-08-24 13:40 ` libstdc++ Jonathan Wakely
2012-08-27  9:27   ` libstdc++ naga raj
  -- strict thread matches above, loose matches on Subject: below --
1999-11-04 18:42 libstdc++ Inferno
1999-11-07  5:16 ` libstdc++ J.H.M. Dassen (Ray)
1999-11-30 23:28   ` libstdc++ J.H.M. Dassen (Ray)
1999-11-30 23:28 ` libstdc++ Inferno
1999-10-01  0:00 libstdc++ Inferno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).