WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline aus9

  • Full Member
  • ***
  • Posts: 177
[Solved] compile flag --enable-no_rtti
« on: July 29, 2020, 06: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 29, 2020, 10:15:20 PM by Rich »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 7928
Re: compile flag --enable-no_rtti
« Reply #1 on: July 29, 2020, 07: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:
https://www.linuxsecrets.com/tinycorelinux-wiki/wiki:creating_extensions.html#installing

Offline aus9

  • Full Member
  • ***
  • Posts: 177
Re: compile flag --enable-no_rtti
« Reply #2 on: July 29, 2020, 09:18:46 PM »
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.

Online Rich

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

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