
This noticeably cuts down the size of the generated binary; on x86_64: 6.1M before 3.7M after Or if the symbols are in some way useful, it wouldn't be difficult to add a command line option to not strip. Adam

How portable? vogt.adam:
This noticeably cuts down the size of the generated binary; on x86_64:
6.1M before 3.7M after
Or if the symbols are in some way useful, it wouldn't be difficult to add a command line option to not strip.
Adam
Wed Feb 4 19:30:00 EST 2009 Adam Vogt
* Strip symbols from generated xmonad binary New patches:
[Strip symbols from generated xmonad binary Adam Vogt
**20090205003000 Ignore-this: 8ed282d8007c511bc9485b3faf48b0f4 ] hunk ./XMonad/Core.hs 419 -- temporarily disable SIGCHLD ignoring: uninstallSignalHandlers status <- bracket (openFile err WriteMode) hClose $ \h -> do - waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir) + waitForProcess =<< runProcess "ghc" ["--make", "-optl-s", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir) Nothing Nothing Nothing (Just h) -- re-enable SIGCHLD:
Context:
[Support for custom event hooks Daniel Schoepe
**20090203155536 Ignore-this: f22f1a7ae2d958ba1b3625aa923b7efd ] [Make X an instance of Typeable Daniel Schoepe **20090128215406 Ignore-this: bb155e62ea4e451460e3b94508dc49d2 ] [Add uninstallSignalHandlers, use in spawn Spencer Janssen **20090122002643 Ignore-this: d91bde6f965341a2619fe2dde83cc099 ] [Create a new session for forked processes Spencer Janssen **20090122000423 Ignore-this: f5d9cf254a0b07ddbf204457b7783880 ] [TAG 0.8.1 Spencer Janssen **20090118083910] [Close stdin in spawned processes Spencer Janssen **20090117040024 Ignore-this: 2e372ed6215160adae8da1c44cdede3d ] [Document spawnPID Spencer Janssen **20090117035907 Ignore-this: 1641bdcf5055b2ec7b9455265f5b1d52 ] [Asynchronously recompile/restart xmonad on mod-q Spencer Janssen **20090117035300 Ignore-this: 753d8746034f818b81df79003ae5ee0d ] [Add --restart, a command line flag to cause a running xmonad process to restart Spencer Janssen **20090117034959 Ignore-this: 45c8c8aba7cc7391b95c7e3fb01e5bf9 ] [Bump version to 0.8.1 Spencer Janssen **20090116223621 Ignore-this: 2e8e9dc7b6ca725542f4afe04253dc57 ] [Remove doubleFork, handle SIGCHLD Spencer Janssen **20090116204742 Ignore-this: f9b1a65b4f0622922f80ad2ab6c5a52f This is a rather big change. Rather than make spawned processes become children of init, we handle them in xmonad. As a side effect of this change, we never need to use waitForProcess in any contrib module -- in fact, doing so will raise an exception. The main benefit to handling SIGCHLD is that xmonad can now be started with 'exec', and will correctly clean up after inherited child processes. ] [Main.hs: escape / in Haddocks gwern0@gmail.com**20081207020915 Ignore-this: 2c4525280fbe73c46f3abd8fc13628e9 This lets haddocks for Main.hs, at least, to build with 2.3.0. ] [More flexible userCode function Daniel Schoepe **20090110221852] [Call logHook as the very last action in windows Spencer Janssen **20081209233700 Ignore-this: 4396ad891b607780f8e4b3b6bbce87e ] [Accept inferior crossing events. This patch enables fmouse-focus-follows-screen Spencer Janssen **20081205045130 Ignore-this: 3ac329fb92839827aed0a4370784cabd ] [Tile all windows at once Spencer Janssen **20081118074447] [Factor rational rect scaling into a separate function Spencer Janssen **20081118072849] [Change screen focus by clicking on the root window. Spencer Janssen **20081106224031 This is a modification of a patch from Joachim Breitner. ] [Fix #192. Spencer Janssen **20081021220059] [select base < 4 for building on ghc 6.10 Adam Vogt **20081013214509] [add killWindow function Joachim Breitner **20081005001804 This is required to kill anything that is not focused, without having to focus it first. ] [add'l documentation Devin Mullins **20080927234639] [Regression: ungrab buttons on *non* root windows Spencer Janssen **20081007214351] [Partial fix for #40 Spencer Janssen **20081007212053 Improvements: - clicking on the root will change focus to that screen - moving the mouse from a window on a screen to an empty screen changes focus to that screen The only remaining issue is that moving the mouse between two empty screens does not change focus. In order to solve this, we'd have to select motion events on the root window, which is potentially expensive. ] [Track mouse position via events received Spencer Janssen **20081007203953] [Fix haddock Spencer Janssen **20081007094641] [Move screen locating code into pointScreen Spencer Janssen **20081007094207] [Make pointWithin a top-level binding Spencer Janssen **20081007090229] [sp README, CONFIG, STYLE, TODO gwern0@gmail.com**20080913024457] [Use the same X11 dependency as xmonad-contrib Spencer Janssen **20080921061508] [Export focusUp' and focusDown' -- work entirely on stacks Spencer Janssen **20080911214803] [add W.shiftMaster, fix float/tile-reordering bug Devin Mullins **20080911053909] [TAG 0.8 Spencer Janssen **20080905195412] Patch bundle hash: d8a498a6691876079c5b9e5a1f7020dd7ed681d8
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Wed, Feb 4, 2009 at 7:51 PM, Don Stewart
How portable?
By a funny coincidence, I was messing with strip a few days ago (for yi), and my discussion with dcoutts covered just this. He told me that -optl-s was considered bad, as that option gets passed to the linker and -s is apparently specific to GNU ld. The recommended approach (if you aren't going via Cabal, which strips by default) is to invoke the 'strip' executable. (My opinion on this is that it's nice to have but not imperative - with yi, adding a strip call saved more than 10M!) -- gwern

On 2009 Feb 4, at 20:39, Gwern Branwen wrote:
On Wed, Feb 4, 2009 at 7:51 PM, Don Stewart
wrote: How portable?
By a funny coincidence, I was messing with strip a few days ago (for yi), and my discussion with dcoutts covered just this.
He told me that -optl-s was considered bad, as that option gets passed to the linker and -s is apparently specific to GNU ld.
Er? ld -s has worked since Version 7 UNIX. Or is this about e.g. Cygwin/mingw not implementing it? -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Thu, Feb 5, 2009 at 10:43 AM, Brandon S. Allbery KF8NH
On 2009 Feb 4, at 20:39, Gwern Branwen wrote:
On Wed, Feb 4, 2009 at 7:51 PM, Don Stewart
wrote: How portable?
By a funny coincidence, I was messing with strip a few days ago (for yi), and my discussion with dcoutts covered just this.
He told me that -optl-s was considered bad, as that option gets passed to the linker and -s is apparently specific to GNU ld.
Er? ld -s has worked since Version 7 UNIX. Or is this about e.g. Cygwin/mingw not implementing it?
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com
http://tunes.org/~nef/logs/haskell/09.02.01
06:55:03 <gwern> dcoutts: so I was looking into having yi strip its
recompiled binaries
06:55:09 <gwern> and I couldn't remember the ghc option for that
06:55:30 <gwern> was it -optl-s?
06:55:34 --- quit: zachk ("http://www.mibbit.com ajax IRC Client")
06:55:43 <dcoutts> gwern: that is not portable
06:55:51 <dcoutts> gwern: just calling strip is more portable
06:56:08 <gwern> hm. where is -optl-s not portable?
06:57:15 --- join: Workybo__ (n=workybob@d5153048F.access.telenet.be)
joined #haskell
06:57:20 <gwern> (since yi goes from 30M to 19M, I do intend some sort
of stripping)
06:58:54 <Olathe> Bah.
06:59:08 --- quit: dmwit_ (Read error: 54 (Connection reset by peer))
06:59:20 <Olathe> return Constructor a b c causes all sorts of unrelated errors.
06:59:34 --- quit: Workybob (Connection timed out)
06:59:38 --- join: vixey` (n=vicky@amcant.demon.co.uk) joined #haskell
06:59:39 --- quit: jinjing ()
06:59:39 --- quit: vixey` (Read error: 104 (Connection reset by peer))
07:00:00 --- join: dmwit (n=dmwit@c-76-99-55-17.hsd1.pa.comcast.net)
joined #haskell
07:00:04 <gwern> @hoogle runProcess
07:00:04 <PeakerLambda> System.Process runProcess :: FilePath ->
[String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe Handle
-> Maybe Handle -> Maybe Handle -> IO ProcessHandle
07:00:17 --- quit: vixey (Read error: 113 (No route to host))
07:00:58 --- join: vixey (n=vicky@amcant.demon.co.uk) joined #haskell
07:01:23 --- quit: Workybob_ (Connection timed out)
07:01:29

On 2009 Feb 5, at 11:24, Gwern Branwen wrote:
On 2009 Feb 4, at 20:39, Gwern Branwen wrote:
On Wed, Feb 4, 2009 at 7:51 PM, Don Stewart
wrote: How portable?
By a funny coincidence, I was messing with strip a few days ago (for yi), and my discussion with dcoutts covered just this.
He told me that -optl-s was considered bad, as that option gets passed to the linker and -s is apparently specific to GNU ld.
Er? ld -s has worked since Version 7 UNIX. Or is this about e.g. Cygwin/mingw not implementing it?07:02:19 <dcoutts> gwern: -s is specific to the GNU linker I think. So
On Thu, Feb 5, 2009 at 10:43 AM, Brandon S. Allbery KF8NH
wrote: probably does not work on OSX, BSD, Solaris.
Solaris: -s Strips symbolic information from the output file. Any debugging information, that is, .line, .debug*, and .stab* sections, and their associated relocation entries are removed. Except for relocatable files, a symbol table SHT_SYMTAB and its associated string table section are not created in the output object file. See also -z redlocsym. FreeBSD, NetBSD: uses GNU ld OSX 10.5: -s Completely strip the output, including removing the symbol table. This file format variant is no longer supported. This option is obsolete. So we do have a portability issue, thanks to Apple changing a bunch of stuff relating to linking and object files in Leopard. But: strip no longer removes relocation entries under any condition. Instead, it updates the external relocation entries (and indirect sym- bol table entries) to reflect the resulting symbol table. strip prints an error message for those symbols not in the resulting symbol table that are needed by an external relocation entry or an indirect symbol table. The link editor ld(1) is the only program that can strip relo- cation entries and know if it is safe to do so. which to me says that strip can break working programs and is not recommended --- so strip isn't safe either on OSX. And, for the record: from the 7th Research Edition manpages –s ‘Strip’ the output, that is, remove the symbol table and relocation bits to save space (but impair the usefulness of the debugger). This information can also be removed by strip(1). ld -s goes back a long ways. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Wed, Feb 04, 2009 at 07:45:47PM -0500, Adam Vogt wrote:
This noticeably cuts down the size of the generated binary; on x86_64:
6.1M before 3.7M after
Or if the symbols are in some way useful, it wouldn't be difficult to add a command line option to not strip.
Adam
Wed Feb 4 19:30:00 EST 2009 Adam Vogt
* Strip symbols from generated xmonad binary
The consensus seems to be that this may not be portable. It would be nice to shave a few megabytes, but it is not worth risking portability in my opinion. Cheers, Spencer Janssen
participants (5)
-
Adam Vogt
-
Brandon S. Allbery KF8NH
-
Don Stewart
-
Gwern Branwen
-
Spencer Janssen