chrpath in devel

This commit is contained in:
S.Çağlar Onur
2007-12-23 16:00:01 +00:00
parent 5420a3616f
commit 3803157c78
+9
View File
@@ -525,6 +525,13 @@ def strip_file(filepath, outpath):
if ret:
ctx.ui.warning(_("strip command failed for file '%s'!") % f)
def run_chrpath(f):
""" remove rpath info from binary """
p = os.popen("chrpath -d %s" % f)
ret = p.close()
if ret:
ctx.ui.warning(_("chrpath command failed for file '%s'!") % f)
def save_elf_debug(f, o):
"""copy debug info into file.debug file"""
p = os.popen("objcopy --only-keep-debug %s %s%s" % (f, o, ctx.const.debug_file_suffix))
@@ -547,6 +554,7 @@ def strip_file(filepath, outpath):
check_dir(os.path.dirname(outpath))
save_elf_debug(filepath, outpath)
run_strip(filepath)
run_chrpath(filepath)
return True
elif "SB shared object" in o:
@@ -554,6 +562,7 @@ def strip_file(filepath, outpath):
check_dir(os.path.dirname(outpath))
save_elf_debug(filepath, outpath)
run_strip(filepath, "--strip-unneeded")
run_chrpath(filepath)
# FIXME: warn for TEXTREL
return True