Author Topic: Linux release binaries are compiled with debug symbols?  (Read 3103 times)

0 Members and 1 Guest are viewing this topic.

Offline niffiwan

  • 211
  • Eluder Class
Linux release binaries are compiled with debug symbols?
chief1983's comment in this sticky about the size of the OSX/Linux binaries got me thinking about reducing the size of said binaries (well, for Linux at least since I don't have a Mac/Xcode - but I guess being gcc based this may apply there too?).

I have noticed that the release builds have all the debug symbols compiled in (-g).  Given that we have debug builds to, well, debug issues, this seems redundant.  We could compile without -g, which will substantially reduce the size of the binary (i.e. <50%).  I presume that something similar is what the Windows binaries currently do?

I guess there's always a chance that a problem will occur in release build, but not in debug. However in that case the person investigating the issue could do a custom compile of "release" with -g.  For the rest of the time though, it just uses extra download bandwidth (assuming that the number of downloads of the Linux binaries are significant... they quite easily may not be)

Comments?
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Linux release binaries are compiled with debug symbols?
chief1983's comment in this sticky about the size of the OSX/Linux binaries got me thinking about reducing the size of said binaries (well, for Linux at least since I don't have a Mac/Xcode - but I guess being gcc based this may apply there too?).

I have noticed that the release builds have all the debug symbols compiled in (-g).  Given that we have debug builds to, well, debug issues, this seems redundant.  We could compile without -g, which will substantially reduce the size of the binary (i.e. <50%).  I presume that something similar is what the Windows binaries currently do?

I guess there's always a chance that a problem will occur in release build, but not in debug. However in that case the person investigating the issue could do a custom compile of "release" with -g.  For the rest of the time though, it just uses extra download bandwidth (assuming that the number of downloads of the Linux binaries are significant... they quite easily may not be)

Comments?
i believe that most linuxers actually self-compile.

AFAIK, the nightly linux binaries are Ubuntu based, and said binaries arent known for running on non-ubuntu/debian distros.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Linux release binaries are compiled with debug symbols?
They may self-compile, but they're still using our autoconf script, and we could probably set it up to pass the strip command to the release binaries so that anyone who builds it gets a smaller executable.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Linux release binaries are compiled with debug symbols?
I've done some testing with "strip". 

.all = strip -s
.only-debug = strip -g

Code: [Select]
-rwxr-xr-x 1 me me 24384059 2011-11-03 07:20 fs2_open_3.6.14_DEBUG_RC1
-rwxr-xr-x 1 me me 25949769 2011-11-03 07:45 fs2_open_3.6.14_RC1
-rwxr-xr-x 1 me me  4115324 2011-11-06 08:23 fs2_open_3.6.14_RC1.all
-rwxr-xr-x 1 me me  4828493 2011-11-06 08:23 fs2_open_3.6.14_RC1.only-debug

And here's the (almost) same binary compiled without -g (it's 64bit vs 32bit above)

Code: [Select]
-rwxr-xr-x 1 me me  4473768 2011-11-06 08:26 fs2_open_3.6.14

The size differences are so small it wouldn't matter which way we go with this.

In any case, removing -g from compile flags is just as easy as adding -s (to strip on compile). If we want to strip after compile it'll need a little more work.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Linux release binaries are compiled with debug symbols?
They may self-compile, but they're still using our autoconf script, and we could probably set it up to pass the strip command to the release binaries so that anyone who builds it gets a smaller executable.
point very well made. silly me.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Linux release binaries are compiled with debug symbols?
Niffiwan, you're right, I was kind of missing the point of what you were talking about earlier.  Removing -g on release builds sounds like the way to go.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Linux release binaries are compiled with debug symbols?
Thanks - committed to trunk in r7957
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...