Size of executable output from gcc

GFA, ASM, STOS, ...

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

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12487
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

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 Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2361
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

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. :)

joska
Hardware Guru
Hardware Guru
Posts: 4162
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

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

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12487
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

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 Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

joska
Hardware Guru
Hardware Guru
Posts: 4162
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

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

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12487
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

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 Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

joska
Hardware Guru
Hardware Guru
Posts: 4162
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

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

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12487
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

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 Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 8 guests