From 29f391531fae7d544cb391239676eebd7a72d39f Mon Sep 17 00:00:00 2001 From: Wenlin Kang Date: Wed, 13 Jun 2018 01:37:31 -0700 Subject: openjdk-8: remove debuglink During openjdk-8 compiling, its debug file is xxx.debuginfo, and it will add libjvm.debuginfo as libjvm.so's debuglink section's file name, this name is different with that we will create and add in splitdebuginfo() of package.bbclass, in oe-core, the debug file name is the same with the corresponding executable file or library file, this will make we can't get symbol information when debug libjvm.so in gdb, so we must remove the previous debuglink before add it if it has existed(if a file has contained the debuglink section, it will not be changed when add again). Signed-off-by: Wenlin Kang Tested-by: Richard Leitner Signed-off-by: Richard Leitner --- recipes-core/openjdk/openjdk-8-cross.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/recipes-core/openjdk/openjdk-8-cross.inc b/recipes-core/openjdk/openjdk-8-cross.inc index 46f13fd..03cab11 100644 --- a/recipes-core/openjdk/openjdk-8-cross.inc +++ b/recipes-core/openjdk/openjdk-8-cross.inc @@ -105,5 +105,21 @@ EXTRA_OEMAKE_append = '\ images \ ' +python remove_debuglink() { + dvar = d.getVar('PKGD', True) + objcopy = d.getVar("OBJCOPY", True) + + # Remove the previous debuglink if it has existed, because it has a different file name with that we will add. + if d.getVar('PN', True).find("jre") != -1: + file = dvar + d.getVar("JRE_HOME", True) + "/lib/" + d.getVar("JDK_ARCH", True) + "/server/libjvm.so" + else: + file = dvar + d.getVar("JDK_HOME", True) + "/jre/lib/" + d.getVar("JDK_ARCH", True) + "/server/libjvm.so" + + cmd = "'%s' --remove-section .gnu_debuglink '%s'" % (objcopy, file) + oe.utils.getstatusoutput(cmd) +} + +PACKAGE_PREPROCESS_FUNCS += "remove_debuglink" + # There is a symlink to a .so but this one is valid. INSANE_SKIP_${PN} = "dev-so" -- cgit v1.2.3-54-g00ecf