31 December 2019, 13:05 | #1 |
Registered User
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
|
Basics of gcc
Apologies if this is covered somewhere - I may have even asked myself before
Is there somewhere that explains what all the different options like '-noiexemul' and the like do? And why you might want one over the other or add one in some cases but not others? It feels a bit like this is stuff that you're meant to just know. Maybe it's because I've pretty much always used IDEs when it comes to modern development and maybe they shield you from this kind of stuff? |
31 December 2019, 14:17 | #2 |
Registered User
Join Date: Apr 2013
Location: Mallorca
Posts: 758
|
With gcc in amiga land "-noixemul" makes a turn regarding posix functions: Instead of using ixemul library it uses at link time libnix (no unix): Small size and less overhead, but with the possibility of missing some gnu unix functions. Or something like that.
|
31 December 2019, 14:25 | #3 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,232
|
on latest gcc 6.5 by beebo, if you don't use "-noixemul", it may crash randomly. Didn't happen with 6.4. But 6.5 is much better. So I strongly recommend using the switch, always.
I use IDEs to develop, but I always choose options myself. my base options: -Wall -Wextra -Werror -noixemul (all warnings, no ixemul) debug mode: -O0 -g (don't optimize, add debug symbols) release mode: -O2 -DNDEBUG standard optim switches+define NDEBUG so "assert" checks and other stuff are eliminated from build, making it smaller, faster, and unsafe I still use real time exceptions (C++). I'd like to know if there's a switch that drastically reduces code size, as my program still takes 1.2MB (release mode, no debug), and gets down to 1.0MB when using "strip" on it (even if I never use -g ..., strange). Using powerpacker "reduces" executable to 400MB on disk... |
31 December 2019, 15:18 | #4 |
Registered User
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
|
Thanks for the info guys.
|
31 December 2019, 16:16 | #5 | |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Quote:
|
|
31 December 2019, 16:35 | #6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,232
|
Great it works: "-Wl,--strip-debug" failed, but -s worked...
|
14 January 2020, 15:54 | #7 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 189
|
For a release build I use
Code:
-Os -Wall -Wno-unused-function -fomit-frame-pointer -fno-rtti -fno-exceptions -noixemul -Dlinux Produces a 65k binary for 10.000 lines c++ code:-) |
14 January 2020, 20:06 | #8 |
Registered User
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
|
Why -Dlinux ?
|
14 January 2020, 20:58 | #9 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,232
|
-Wall -Wno-unused-function are warnings options. They don't affect the code generation.
-Os: optimize for size (not necessarily for speed) -fno-exceptions reduces by 20% in my case. But you have to remove/#ifdef all the try/catch statements. -noixemul is just MANDATORY. Without it, it just locks up randomly on system calls. -fno-rtti doesn't save a lot of space, and you probably cannot use dynamic_cast with that. I'll try the other options (not -Dlinux ) Last edited by jotd; 15 January 2020 at 16:59. |
15 January 2020, 09:34 | #10 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 189
|
I had nearly forgotten it, but a look in the code revealed: It defines a macro which is needed because sometimes I also build the project with StormC4.
The macro is used to #include <new> when build in in Linux/gcc6.5, whereas <new.h> must be included for StormC4. Last edited by thyslo; 15 January 2020 at 09:58. |
15 January 2020, 14:33 | #11 |
Registered User
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
|
OK, so that one is pretty specific to your project, or use case. Understood
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking for WB set up with some basics | TenLeftFingers | request.Apps | 9 | 14 July 2015 03:26 |
Help with: Bio Challenge : The Basics | apachacha | support.Games | 19 | 11 November 2012 01:59 |
Amiga basics? | stefcep2 | support.Apps | 7 | 08 September 2010 04:02 |
some basics | diamond | request.UAE Wishlist | 1 | 26 March 2005 03:03 |
Amiga DOS Basics | Fred the Fop | Amiga websites reviews | 3 | 21 August 2002 07:02 |
|
|