openjdk-8: remove debuglink
PATCH v2 1/2 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).
--- recipes-core/openjdk/openjdk-8-cross.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
recipes-core/openjdk/openjdk-8-cross.inc +16 -0
@@ -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"
Signature · 1 line
2.11.0
PATCH v2 2/2 openjdk-8: remove redunant FILES_${PN}-dbg
One recipe should only have one -dbg package, because OE only picks up all .debug file into the last one -dbg package listed in variable PACKAGES.
Comments(oe-core's commit a3b000643898d7402b9e57c02e8d10e677cc9722) from Ross Burton as below:
"meta: more removals of redunant FILES_${PN}-dbg
In some recipes overly-split -dbg packages were merged into PN-dbg. Unless there's a very good reason, recipes should have a single -dev and -dbg package. "
--- recipes-core/openjdk/openjdk-8_16xbyy.bb | 29 ----------------------------- 1 file changed, 29 deletions(-)
recipes-core/openjdk/openjdk-8_16xbyy.bb +0 -29
@@ -14,7 +14,6 @@ do_install() { } PACKAGES_append = " \ - ${PN}-demo-dbg \ ${PN}-demo \ ${PN}-source \ "
@@ -33,37 +32,9 @@ FILES_${PN}-dev_append = "\ ${JDK_HOME}/include \ " -FILES_${PN}-dbg_append = "\ - ${JDK_HOME}/bin/.debug/ \ - ${JDK_HOME}/lib/.debug/ \ - ${JDK_HOME}/lib/${JDK_ARCH}/.debug/ \ - ${JDK_HOME}/lib/${JDK_ARCH}/jli/.debug/ \ - ${JDK_HOME}/jre/bin/.debug/ \ - ${JDK_HOME}/jre/lib/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/jli/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/native_threads/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/server/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/headless/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/xawt/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/client/.debug/ \ -" - FILES_${PN}-demo = " ${JDK_HOME}/demo ${JDK_HOME}/sample " RDEPENDS_${PN}-demo = " ${PN} " -FILES_${PN}-demo-dbg = "\ - ${JDK_HOME}/demo/jvmti/gctest/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/heapTracker/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/heapViewer/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/hprof/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/minst/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/mtrace/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/versionCheck/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/waiters/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/compiledMethodLoad/lib/.debug/ \ -" - FILES_${PN}-doc_append = "\ ${JDK_HOME}/man \ ${JDK_HOME}/ASSEMBLY_EXCEPTION \
Signature · 1 line
2.11.0
Re: [meta-java][PATCH V2 2/2] openjdk-8: remove redunant FILES_${PN}-dbg
Tested for qemuarm. Therefore feel free to add:
Quoted 68 lines · Wenlin Kang
One recipe should only have one -dbg package, because OE only picks up all .debug file into the last one -dbg package listed in variable PACKAGES.
Comments(oe-core's commit
a3b000643898d7402b9e57c02e8d10e677cc9722) from Ross Burton as below:
"meta: more removals of redunant FILES_${PN}-dbgIn some recipes overly-split -dbg packages were merged into PN-dbg. Unless there's a very good reason, recipes should have a single -dev and -dbg package. "
Signed-off-by Wenlin Kang <[email protected]>--- recipes-core/openjdk/openjdk-8_16xbyy.bb | 29 ----------------------------- 1 file changed, 29 deletions(-)recipes-core/openjdk/openjdk-8_16xbyy.bb +0
-29@@ -14,7 +14,6 @@ do_install() { } PACKAGES_append = " \ - ${PN}-demo-dbg \ ${PN}-demo \ ${PN}-source \ "@@ -33,37 +32,9 @@ FILES_${PN}-dev_append = "\ ${JDK_HOME}/include \ " -FILES_${PN}-dbg_append = "\ - ${JDK_HOME}/bin/.debug/ \ - ${JDK_HOME}/lib/.debug/ \ - ${JDK_HOME}/lib/${JDK_ARCH}/.debug/ \ - ${JDK_HOME}/lib/${JDK_ARCH}/jli/.debug/ \ - ${JDK_HOME}/jre/bin/.debug/ \ - ${JDK_HOME}/jre/lib/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/jli/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/native_threads/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/server/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/headless/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/xawt/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/client/.debug/ \ -" - FILES_${PN}-demo = " ${JDK_HOME}/demo ${JDK_HOME}/sample " RDEPENDS_${PN}-demo = " ${PN} " -FILES_${PN}-demo-dbg = "\ - ${JDK_HOME}/demo/jvmti/gctest/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/heapTracker/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/heapViewer/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/hprof/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/minst/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/mtrace/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/versionCheck/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/waiters/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/compiledMethodLoad/lib/.debug/ \ -" - FILES_${PN}-doc_append = "\ ${JDK_HOME}/man \ ${JDK_HOME}/ASSEMBLY_EXCEPTION \
Re: [meta-java][PATCH V2 2/2] openjdk-8: remove redunant FILES_${PN}-dbg
In reply to Wenlin KangHi,
this is a note to let you know that I've just added this patch to the master-next branch of the meta-java repository at
git://git.yoctoproject.org/meta-java
As soon as it has gone through some more testing it will likely be merged to the master branch.
If you have any questions, please let me know.
regards;Richard.L
Quoted 68 lines · Wenlin Kang
One recipe should only have one -dbg package, because OE only picks up all .debug file into the last one -dbg package listed in variable PACKAGES.
Comments(oe-core's commit
a3b000643898d7402b9e57c02e8d10e677cc9722) from Ross Burton as below:
"meta: more removals of redunant FILES_${PN}-dbgIn some recipes overly-split -dbg packages were merged into PN-dbg. Unless there's a very good reason, recipes should have a single -dev and -dbg package. "
Signed-off-by Wenlin Kang <[email protected]>--- recipes-core/openjdk/openjdk-8_16xbyy.bb | 29 ----------------------------- 1 file changed, 29 deletions(-)recipes-core/openjdk/openjdk-8_16xbyy.bb +0
-29@@ -14,7 +14,6 @@ do_install() { } PACKAGES_append = " \ - ${PN}-demo-dbg \ ${PN}-demo \ ${PN}-source \ "@@ -33,37 +32,9 @@ FILES_${PN}-dev_append = "\ ${JDK_HOME}/include \ " -FILES_${PN}-dbg_append = "\ - ${JDK_HOME}/bin/.debug/ \ - ${JDK_HOME}/lib/.debug/ \ - ${JDK_HOME}/lib/${JDK_ARCH}/.debug/ \ - ${JDK_HOME}/lib/${JDK_ARCH}/jli/.debug/ \ - ${JDK_HOME}/jre/bin/.debug/ \ - ${JDK_HOME}/jre/lib/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/jli/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/native_threads/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/server/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/headless/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/xawt/.debug/ \ - ${JDK_HOME}/jre/lib/${JDK_ARCH}/client/.debug/ \ -" - FILES_${PN}-demo = " ${JDK_HOME}/demo ${JDK_HOME}/sample " RDEPENDS_${PN}-demo = " ${PN} " -FILES_${PN}-demo-dbg = "\ - ${JDK_HOME}/demo/jvmti/gctest/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/heapTracker/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/heapViewer/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/hprof/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/minst/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/mtrace/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/versionCheck/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/waiters/lib/.debug/ \ - ${JDK_HOME}/demo/jvmti/compiledMethodLoad/lib/.debug/ \ -" - FILES_${PN}-doc_append = "\ ${JDK_HOME}/man \ ${JDK_HOME}/ASSEMBLY_EXCEPTION \
Tested for qemuarm. Therefore feel free to add:
Quoted 41 lines · Wenlin Kang
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 hasexisted(if a file has contained the debuglink section, it will not be changed when add again).Signed-off-by Wenlin Kang <[email protected]>--- recipes-core/openjdk/openjdk-8-cross.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)recipes-core/openjdk/openjdk-8-cross.inc +16
-0@@ -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"
Hi,
this is a note to let you know that I've just added this patch to the master-next branch of the meta-java repository at
git://git.yoctoproject.org/meta-java
As soon as it has gone through some more testing it will likely be merged to the master branch.
If you have any questions, please let me know.
regards;Richard.L
Quoted 41 lines · Wenlin Kang
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 hasexisted(if a file has contained the debuglink section, it will not be changed when add again).Signed-off-by Wenlin Kang <[email protected]>--- recipes-core/openjdk/openjdk-8-cross.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)recipes-core/openjdk/openjdk-8-cross.inc +16
-0@@ -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"