Size of executable output from gcc

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Size of executable output from gcc

Postby wongck » Thu Sep 24, 2009 1:52 pm

The output executable from gcc are large.
A simple hello world executable was size over 100K+. Stripping it reduce it to 80K+.
Are there any switches to reduce the size?
My Atari Stuff: Falcon CT63 14+512MB 20GB DVD / TT030 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
User avatar
wongck
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 3478
Joined: Sat May 03, 2008 2:09 pm
Location: Far East

Re: Size of executable output from gcc

Postby lp » Thu Sep 24, 2009 4:16 pm

Edit: Never mind, reread your message. You already used strip. :)
User avatar
lp
Atari Super Hero
Atari Super Hero
 
Posts: 944
Joined: Wed Nov 12, 2003 11:09 pm

Re: Size of executable output from gcc

Postby joska » Thu Sep 24, 2009 7:50 pm

wongck wrote:The output executable from gcc are large.
A simple hello world executable was size over 100K+. Stripping it reduce it to 80K+.
Are there any switches to reduce the size?


If you want to develop Atari/GEM-software, you are probably better off using PureC or AHCC. They produce much smaller binaries and does it a lot quicker. PureC can compile an entire project with a megabyte of source in a fraction of the time it takes gcc to compile hello.c.
Jo Even

Milan060 - Falcon040 - Falcon030 - FreeMiNT - XaAES
joska
Atari Super Hero
Atari Super Hero
 
Posts: 525
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: Size of executable output from gcc

Postby wongck » Fri Sep 25, 2009 1:35 pm

Pure C... yes. I been using that for the last 18 years or so.... and Laser C before that. :mrgreen:
I am at home with Pure C, just that I am thinking of some Mint programming.
Guess I am stuck with gcc, and the older version that I got from sparemint RPM don't help :(
My Atari Stuff: Falcon CT63 14+512MB 20GB DVD / TT030 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
User avatar
wongck
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 3478
Joined: Sat May 03, 2008 2:09 pm
Location: Far East

Re: Size of executable output from gcc

Postby joska » Fri Sep 25, 2009 5:08 pm

wongck wrote:Pure C... yes. I been using that for the last 18 years or so.... and Laser C before that. :mrgreen:
I am at home with Pure C, just that I am thinking of some Mint programming.


What kind of "MiNT programming" are you thinking of? There's nothing in MiNT that prevents you from using PureC. Or are you thinking about ported stuff?
Jo Even

Milan060 - Falcon040 - Falcon030 - FreeMiNT - XaAES
joska
Atari Super Hero
Atari Super Hero
 
Posts: 525
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: Size of executable output from gcc

Postby wongck » Sat Sep 26, 2009 7:33 am

joska wrote:What kind of "MiNT programming" are you thinking of? There's nothing in MiNT that prevents you from using PureC. Or are you thinking about ported stuff?

I am thinking of writting a device driver for a serial-USB thingy - USBwiz, or at least for the last 2 years or so :roll: among other things.
I read from somewhere that there are differences in the way the functions are called and sizes of integers/long which may give interfacing issues.
Of course I have seen XIF written in Assembler (like for the EtherNEC) so it may be just to keep an eye on the bytes that is required.
My Atari Stuff: Falcon CT63 14+512MB 20GB DVD / TT030 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
User avatar
wongck
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 3478
Joined: Sat May 03, 2008 2:09 pm
Location: Far East

Re: Size of executable output from gcc

Postby joska » Sat Sep 26, 2009 2:11 pm

wongck wrote:
joska wrote:What kind of "MiNT programming" are you thinking of? There's nothing in MiNT that prevents you from using PureC. Or are you thinking about ported stuff?

I am thinking of writting a device driver for a serial-USB thingy - USBwiz, or at least for the last 2 years or so :roll: among other things.
I read from somewhere that there are differences in the way the functions are called and sizes of integers/long which may give interfacing issues.


This is not a problem. You can set PureC to call functions by putting the arguments on the stack like MiNT expects. And long is the same in PureC and gcc, but PureC has 16 bit ints instead of gcc's 32 bit. Just use longs, or use AHCC which is PureC-compatible (and almost as fast) but can also use 32 bit ints.

However, you have to figure out how to access the kernel lib. I have never done this using PureC, so I don't know how to do that.
Jo Even

Milan060 - Falcon040 - Falcon030 - FreeMiNT - XaAES
joska
Atari Super Hero
Atari Super Hero
 
Posts: 525
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: Size of executable output from gcc

Postby wongck » Sat Sep 26, 2009 2:42 pm

joska wrote:This is not a problem. You can set PureC to call functions by putting the arguments on the stack like MiNT expects. And long is the same in PureC and gcc, but PureC has 16 bit ints instead of gcc's 32 bit. Just use longs, or use AHCC which is PureC-compatible (and almost as fast) but can also use 32 bit ints.

Thanks for the pointers. I will keep them in mind.
My Atari Stuff: Falcon CT63 14+512MB 20GB DVD / TT030 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
User avatar
wongck
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 3478
Joined: Sat May 03, 2008 2:09 pm
Location: Far East


Return to Coding

Who is online

Users browsing this forum: CommonCrawl [Bot], Yandex [Bot] and 0 guests