Re: TI compiler

Orlando Arias <[email protected]> Sun, 5 Mar 2017 11:49:26 -0500
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--===============2795226570250775926==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="FEiVROjle3KqDnmugr13nLU193HJeSRuK"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--FEiVROjle3KqDnmugr13nLU193HJeSRuK
Content-Type: multipart/mixed; boundary="NcO7P297wwF289Fh46TMo0cJAghSdv2cS";
	protected-headers="v1"
From: Orlando Arias <[email protected]>
To: [email protected]
Message-ID: <[email protected]>
Subject: Re: [Mspgcc-users] TI compiler
References: <[email protected]>
In-Reply-To: <[email protected]>

--NcO7P297wwF289Fh46TMo0cJAghSdv2cS
Content-Type: multipart/mixed; boundary="------------F60A8C90B58444FEF7298426"

This is a multi-part message in MIME format.
--------------F60A8C90B58444FEF7298426
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Ugh... Really sorry, hit reply instead of reply list.

Greetings,

Apologies for hijacking this e-mail chain, but I have had issues with
the ``bloat'' in newlib as well. My issue is with internationalization
support in newlib. I have configured and compiled newlib with the
following flags:

  export CFLAGS_FOR_TARGET=3D"-Os -g -ffunction-sections -fdata-sections"=

  ../configure \
    --prefix=3D/usr \
    --target=3Dmsp430-elf \
    --disable-newlib-supplied-syscalls \
    --enable-newlib-reent-small \
    --disable-newlib-fseek-optimization \
    --disable-newlib-wide-orient \
    --enable-newlib-nano-formatted-io \
    --disable-newlib-io-float \
    --enable-newlib-nano-malloc \
    --disable-newlib-unbuf-stream-opt \
    --enable-lite-exit \
    --enable-newlib-global-atexit \
    --disable-nls

It was my understanding that --disable-nls would disable
internationalization support. Unfortunately, I am observing the
following behaviour with the attached code:

$ msp430-elf-gcc -Os -o uart uart.c -mmcu=3Dmsp430g2553
$ size uart
   text	   data	    bss	    dec	    hex	filename
    778	     16	     90	    884	    374	uart

$ msp430-elf-gcc -Os -o uart uart.c -mmcu=3Dmsp430g2553 -DUSE_TOUPPER
$ size uart
   text	   data	    bss	    dec	    hex	filename
   1476	    398	     92	   1966	    7ae	uart

The function toupper() is pulling in 382 bytes into .data. This accounts
for 74.6% of this particular microcontroller's SRAM. This is not very
nice. Furthermore, I have not really looked into it, but should this new
data actually be mutable? If not, it could very well go into .rodata and
stay in flash memory.

Ideally, I should be able to disable internationalization support
alltoguether even if it goes against the C and POSIX standards. Is there
any way to actually do that I am missing?

Thank you.

Cheers,
Orlando.

On 03/03/2017 01:30 PM, DJ Delorie wrote:
>=20
> This has come up before, and here's what's going on... the new
> msp430-elf-gcc includes all the code required by the standard, partly
> because... well, standards... and partly so that the testsuite can test=

> everything.  The old msp-gcc made lots of assumptions about how the
> compiler would actually be used, and "pre-optimized" the runtime for it=
=2E
>=20
> So you end up with things like "argv handling" when there's no command
> line, or "exit closes files" when you never exit.  A big change is usin=
g
> a float-enabled printf when you don't need it.
>=20
> I put some notes here, way back when, but they're old, and IIRC it's
> been improved even more since then:
>=20
> http://people.redhat.com/~dj/msp430/size-optimizations.html
>=20
> Also, you can use "msp430-elf-gcc -mintr ..." to minimize the runtime
> support.
>=20
> Also, if you're REALLY constrained to size, you might consider getting
> the crt0.S source file from newlib and modifying it yourself to really
> strip out the parts you don't need.  Most embedded code really only
> needs to set up the stack and watchdog, then jump to main().
>=20
> -----------------------------------------------------------------------=
-------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>=20

--------------F60A8C90B58444FEF7298426--

--NcO7P297wwF289Fh46TMo0cJAghSdv2cS--

--FEiVROjle3KqDnmugr13nLU193HJeSRuK
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQQNWDJzd34+k5noE3NTFb9QFn4uoQUCWLxBlgAKCRBTFb9QFn4u
oWsmAJ9TxpX+t9tqFFaiS4DVanIuCcJxxACfT1SEXcqgMeAhbMgQGPrdw3uLMIE=
=4yR1
-----END PGP SIGNATURE-----

--FEiVROjle3KqDnmugr13nLU193HJeSRuK--


--===============2795226570250775926==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--===============2795226570250775926==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

--===============2795226570250775926==--