* PİSİ listesinde tartıştığımız debug infoları paketten ayır değişiklikleri.
Bu infolardan ayrı ayrı paket yapmak yerine (a-debug.pisi, b-debug.pisi v.s gibi)
build-farm'de ya da isteyen geliştirici kendi makinasında /etc/pisi/pisi.conf içerisinde
"debug = True " ile aktive edebilir. Paketlerin debug infoları /debug
klasörü içine konuyor (klasörü yaratmak gerektiğini söylememe gerek yok sanırım :P)
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#
|
||||
#[build]
|
||||
#host = i686-pc-linux-gnu
|
||||
#debug = False
|
||||
#jobs = "-j1"
|
||||
#CFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer
|
||||
#CXXFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer
|
||||
@@ -62,6 +63,7 @@ class BuildDefaults:
|
||||
"""Default values for [build] section"""
|
||||
host = "i686-pc-linux-gnu"
|
||||
jobs = "-j1"
|
||||
debug = False
|
||||
CFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer"
|
||||
CXXFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer"
|
||||
LDFLAGS = ""
|
||||
|
||||
@@ -466,15 +466,32 @@ def strip_file(filepath):
|
||||
if ret:
|
||||
ctx.ui.warning(_("strip command failed for file '%s'!") % f)
|
||||
|
||||
def save_elf_debug(f):
|
||||
"""copy debug info into /debug/file.debug file"""
|
||||
p = os.popen("objcopy --only-keep-debug %s /debug/%s.debug" % (f, os.path.basename(f)))
|
||||
ret = p.close()
|
||||
if ret:
|
||||
ctx.ui.warning(_("objcopy (keep-debug) command failed for file '%s'!") % f)
|
||||
|
||||
"""mark binary/shared objects to use /debug/file.debug"""
|
||||
p = os.popen("objcopy --add-gnu-debuglink=/debug/%s.debug %s" % (os.path.basename(f), f))
|
||||
ret = p.close()
|
||||
if ret:
|
||||
ctx.ui.warning(_("objcopy (add-debuglink) command failed for file '%s'!") % f)
|
||||
|
||||
if "current ar archive" in o:
|
||||
run_strip(filepath, "-g")
|
||||
return True
|
||||
|
||||
elif "SB executable" in o:
|
||||
if ctx.config.values.build.debug == "True":
|
||||
save_elf_debug(filepath)
|
||||
run_strip(filepath)
|
||||
return True
|
||||
|
||||
elif "SB shared object" in o:
|
||||
if ctx.config.values.build.debug == "True":
|
||||
save_elf_debug(filepath)
|
||||
run_strip(filepath, "--strip-unneeded")
|
||||
# FIXME: warn for TEXTREL
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user