* 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]
|
#[build]
|
||||||
#host = i686-pc-linux-gnu
|
#host = i686-pc-linux-gnu
|
||||||
|
#debug = False
|
||||||
#jobs = "-j1"
|
#jobs = "-j1"
|
||||||
#CFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer
|
#CFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer
|
||||||
#CXXFLAGS= -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"""
|
"""Default values for [build] section"""
|
||||||
host = "i686-pc-linux-gnu"
|
host = "i686-pc-linux-gnu"
|
||||||
jobs = "-j1"
|
jobs = "-j1"
|
||||||
|
debug = False
|
||||||
CFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer"
|
CFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer"
|
||||||
CXXFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer"
|
CXXFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer"
|
||||||
LDFLAGS = ""
|
LDFLAGS = ""
|
||||||
|
|||||||
@@ -466,15 +466,32 @@ def strip_file(filepath):
|
|||||||
if ret:
|
if ret:
|
||||||
ctx.ui.warning(_("strip command failed for file '%s'!") % f)
|
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:
|
if "current ar archive" in o:
|
||||||
run_strip(filepath, "-g")
|
run_strip(filepath, "-g")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
elif "SB executable" in o:
|
elif "SB executable" in o:
|
||||||
|
if ctx.config.values.build.debug == "True":
|
||||||
|
save_elf_debug(filepath)
|
||||||
run_strip(filepath)
|
run_strip(filepath)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
elif "SB shared object" in o:
|
elif "SB shared object" in o:
|
||||||
|
if ctx.config.values.build.debug == "True":
|
||||||
|
save_elf_debug(filepath)
|
||||||
run_strip(filepath, "--strip-unneeded")
|
run_strip(filepath, "--strip-unneeded")
|
||||||
# FIXME: warn for TEXTREL
|
# FIXME: warn for TEXTREL
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user