[macruby-changes] [4227] MacRuby/trunk/bin/rubyc

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 16 14:25:32 PDT 2010


Revision: 4227
          http://trac.macosforge.org/projects/ruby/changeset/4227
Author:   lsansonetti at apple.com
Date:     2010-06-16 14:25:31 -0700 (Wed, 16 Jun 2010)
Log Message:
-----------
rubyc: now strip symbols from binaries

Modified Paths:
--------------
    MacRuby/trunk/bin/rubyc

Modified: MacRuby/trunk/bin/rubyc
===================================================================
--- MacRuby/trunk/bin/rubyc	2010-06-16 18:13:15 UTC (rev 4226)
+++ MacRuby/trunk/bin/rubyc	2010-06-16 21:25:31 UTC (rev 4227)
@@ -61,6 +61,7 @@
     @gcxx = locate('g++')
     @nm = locate('nm')
     @lipo = locate('lipo')
+    @strip = locate('strip')
 
     # Misc.
     @tmpdir = (ENV['TMPDIR'] or '/tmp')
@@ -181,6 +182,7 @@
     File.open(main, 'w') { |io| io.write(main_txt) }
     linkf = @internal ? "-L. -lmacruby" : "-L#{RbConfig::CONFIG['libdir']} -lmacruby"
     execute("#{@gcxx} \"#{main}\" -dynamic -bundle -undefined suppress -flat_namespace #{arch_flags} #{linkf} \"#{obj}\" -o \"#{output}\"")
+    strip(output)
   end
 
   def compile_dylib(objs_data, output)
@@ -207,6 +209,7 @@
     linkf = @internal ? "-L. -lmacruby" : "-L#{RbConfig::CONFIG['libdir']} -lmacruby"
     objs = objs_data.map { |obj, f| "\"#{obj}\"" }.join(' ') 
     execute("#{@gcxx} \"#{main}\" -dynamiclib -dynamic -undefined suppress -flat_namespace #{arch_flags} #{linkf} #{objs} -o \"#{output}\"")
+    strip(output)
   end
 
   def compile_executable(objs_data, output)
@@ -284,6 +287,7 @@
     line = "#{@gcxx} -o \"#{output}\" #{arch_flags} #{linkf} "
     objs.each { |o| line << " \"#{o}\"" }
     execute(line)
+    strip(output)
   end
 
   def execute(line)
@@ -297,6 +301,10 @@
     ret
   end
 
+  def strip(bin)
+    execute("#{@strip} -x \"#{bin}\"")
+  end
+
   def locate(progname, must_be_in_bindir=false)
     path = File.join(Config::CONFIG['bindir'], progname)
     unless File.exist?(path)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100616/e2d42b13/attachment.html>


More information about the macruby-changes mailing list