WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] compile flag --enable-no_rtti  (Read 2057 times)

aus9

  • Guest
[Solved] compile flag --enable-no_rtti
« on: July 29, 2020, 09:56:53 PM »
Hi

I am aware of the wiki for TCE creation and the flags used for TC64. I came across this flag for a bit of software. configure --help
Code: [Select]
--enable-no_rtti   Enable compilation without creation of C++ RTTI information in object files.
                            This will speed-up compilation and reduce binary size.

The reduction interests me. Any problems if I enable it in a build?
« Last Edit: July 30, 2020, 01:15:20 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: compile flag --enable-no_rtti
« Reply #1 on: July 29, 2020, 10:31:35 PM »
Hi aus9
Quote
If you wish to try to get a lower sized C++ app, you can try adding "-fno-exceptions -fno-rtti" to CXXFLAGS. Use only on C++ applications, libraries should use the same flags as in CFLAGS above.
Found here:
http://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#installing
« Last Edit: October 27, 2022, 10:52:12 PM by Rich »

aus9

  • Guest
Re: compile flag --enable-no_rtti
« Reply #2 on: July 30, 2020, 12:18:46 AM »
trust me to use the wrong term.

I am aware of the TC64 normal flags
Quote
export CFLAGS="-mtune=generic -Os -pipe"
export CXXFLAGS="-mtune=generic -Os -pipe"
export LDFLAGS="-Wl,-O1"

what I should have said in subject was configure option. its a configure option that I have never seen before.

eg
Code: [Select]
./configure --prefix=/usr/local --enable-no_rtti
anyhow all I can do it test the size by rebuilding it and checking unsquashed on disk size,
I am interested because the resultant exe is huge. I have not compared .so files yet.

anyhow I shall try 4 permutations to see whats what.

export CFLAGS="-mtune=generic -Os -pipe"
export CXXFLAGS="-mtune=generic -Os -pipe -fno-exceptions -fno-rtti"
export LDFLAGS="-Wl,-O1"

with and without that configure option.

anyhow
@Rich please mark as solved.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: [Solved] compile flag --enable-no_rtti
« Reply #3 on: July 30, 2020, 01:18:44 AM »
Hi aus9
Most likely
Code: [Select]
./configure --enable-no_rttijust adds  -fno-rtti  to  CXXFLAGS.

... @Rich please mark as solved.
So marked. :)