From cb351db824b0eb4a71514156bba543f6dde19740 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Tue, 20 Jan 2015 16:14:23 +0100 Subject: binaries run by qemu: link with -static, force ld.bfd For machines using DEFAULTTUNE = "armv7ahf" or DEFAULTTUNE = "armv7athf" a build of openjdk-7 fails with segmentation faults during the qemu-arm runs. e.g. Segmentation fault (core dumped) | qemu-arm -cpu cortex-a8 -s 2097152 -L .../sysroots/colibri-t20 \ -E LD_LIBRARY_PATH=.../sysroots/colibri-t20/lib ./mkbc - bytecodes_arm.s I found that qemu-arm can not execute any binary which is compiled with the resulting compiler and is linked with the gold linker and the -static flag. Even a simple hello world program does not work. When executing that hello world on the real hardware it also generates a segmentation fault. Removing the -static flag or forcing the bfd linker fixed this. Note that other machines, colibri-t30 or i.mx6 based ones with neon but otherwise identical setup do not suffer from the issue. DEFAULTTUNE = "armv7athf-neon" works. While at it convert the sizer call for openjdk-7 used when building xawt also to use -static even though the code is currently disabled. Further details: http://lists.openembedded.org/pipermail/openembedded-devel/2015-January/099795.html Signed-off-by: Max Krummenacher Signed-off-by: Otavio Salvador --- recipes-core/openjdk/openjdk-6/fix_hotspot_crosscompile.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'recipes-core/openjdk/openjdk-6') diff --git a/recipes-core/openjdk/openjdk-6/fix_hotspot_crosscompile.patch b/recipes-core/openjdk/openjdk-6/fix_hotspot_crosscompile.patch index 38fb191..3d4a68c 100644 --- a/recipes-core/openjdk/openjdk-6/fix_hotspot_crosscompile.patch +++ b/recipes-core/openjdk/openjdk-6/fix_hotspot_crosscompile.patch @@ -88,7 +88,7 @@ Index: icedtea6-1.8/ports/hotspot/make/linux/makefiles/zeroshark.make @echo Compiling offset generator $(QUIETLY) $(REMOVE_TARGET) - $(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) -+ $(CC_COMPILE) -static -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) ++ $(CC_COMPILE) -static -fuse-ld=bfd -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) endif -- cgit v1.2.3-54-g00ecf