diff options
author | Max Krummenacher <max.oss.09@gmail.com> | 2015-01-20 16:14:23 +0100 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2015-01-25 16:55:03 -0200 |
commit | cb351db824b0eb4a71514156bba543f6dde19740 (patch) | |
tree | e16d77230be3788b270bc4747ff7fc0c655e3123 | |
parent | c600dd3ab5a6308c513f5fbf7243de1799d9ce62 (diff) | |
download | meta-java-cb351db824b0eb4a71514156bba543f6dde19740.tar.gz |
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 <max.oss.09@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
7 files changed, 13 insertions, 8 deletions
diff --git a/recipes-core/openjdk/openjdk-6-6b24/icedtea-zero-hotspotfix.patch b/recipes-core/openjdk/openjdk-6-6b24/icedtea-zero-hotspotfix.patch index ec10e69..ba738d6 100644 --- a/recipes-core/openjdk/openjdk-6-6b24/icedtea-zero-hotspotfix.patch +++ b/recipes-core/openjdk/openjdk-6-6b24/icedtea-zero-hotspotfix.patch | |||
@@ -35,7 +35,7 @@ Index: openjdk/hotspot/make/linux/makefiles/zeroshark.make | |||
35 | @echo Compiling offset generator | 35 | @echo Compiling offset generator |
36 | $(QUIETLY) $(REMOVE_TARGET) | 36 | $(QUIETLY) $(REMOVE_TARGET) |
37 | - $(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) | 37 | - $(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
38 | + $(CC_COMPILE) -static -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) | 38 | + $(CC_COMPILE) -static -fuse-ld=bfd -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
39 | 39 | ||
40 | endif | 40 | endif |
41 | 41 | ||
diff --git a/recipes-core/openjdk/openjdk-6-6b27/icedtea-crosscompile-fix.patch b/recipes-core/openjdk/openjdk-6-6b27/icedtea-crosscompile-fix.patch index 9a60bd6..0723954 100644 --- a/recipes-core/openjdk/openjdk-6-6b27/icedtea-crosscompile-fix.patch +++ b/recipes-core/openjdk/openjdk-6-6b27/icedtea-crosscompile-fix.patch | |||
@@ -463,7 +463,7 @@ index 1fa311d..f3d06ad 100644 | |||
463 | $(SIZERS): $(SIZERS_C) | 463 | $(SIZERS): $(SIZERS_C) |
464 | $(prep-target) | 464 | $(prep-target) |
465 | - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c | 465 | - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c |
466 | + $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -static -o $@ $(SIZER)$(suffix $@).c | 466 | + $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -static -fuse-ld=bfd -o $@ $(SIZER)$(suffix $@).c |
467 | 467 | ||
468 | $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) | 468 | $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) |
469 | $(prep-target) | 469 | $(prep-target) |
diff --git a/recipes-core/openjdk/openjdk-6-6b32/icedtea-crosscompile-fix.patch b/recipes-core/openjdk/openjdk-6-6b32/icedtea-crosscompile-fix.patch index 3b34160..067b356 100644 --- a/recipes-core/openjdk/openjdk-6-6b32/icedtea-crosscompile-fix.patch +++ b/recipes-core/openjdk/openjdk-6-6b32/icedtea-crosscompile-fix.patch | |||
@@ -247,7 +247,7 @@ index 1fa311d..f3d06ad 100644 | |||
247 | $(SIZERS): $(SIZERS_C) | 247 | $(SIZERS): $(SIZERS_C) |
248 | $(prep-target) | 248 | $(prep-target) |
249 | - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c | 249 | - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c |
250 | + $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -static -o $@ $(SIZER)$(suffix $@).c | 250 | + $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -static -fuse-ld=bfd -o $@ $(SIZER)$(suffix $@).c |
251 | 251 | ||
252 | $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) | 252 | $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) |
253 | $(prep-target) | 253 | $(prep-target) |
diff --git a/recipes-core/openjdk/openjdk-6-6b32/icedtea-zero-hotspotfix.patch b/recipes-core/openjdk/openjdk-6-6b32/icedtea-zero-hotspotfix.patch index 91ace0e..f14deaf 100644 --- a/recipes-core/openjdk/openjdk-6-6b32/icedtea-zero-hotspotfix.patch +++ b/recipes-core/openjdk/openjdk-6-6b32/icedtea-zero-hotspotfix.patch | |||
@@ -35,7 +35,7 @@ index c2a1484..f460d85 100644 | |||
35 | @echo Compiling offset generator | 35 | @echo Compiling offset generator |
36 | $(QUIETLY) $(REMOVE_TARGET) | 36 | $(QUIETLY) $(REMOVE_TARGET) |
37 | - $(CC_COMPILE) $(CFLAGS) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) | 37 | - $(CC_COMPILE) $(CFLAGS) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
38 | + $(CC_COMPILE) $(CFLAGS) -static -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) | 38 | + $(CC_COMPILE) $(CFLAGS) -static -fuse-ld=bfd -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
39 | 39 | ||
40 | endif | 40 | endif |
41 | 41 | ||
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 | |||
88 | @echo Compiling offset generator | 88 | @echo Compiling offset generator |
89 | $(QUIETLY) $(REMOVE_TARGET) | 89 | $(QUIETLY) $(REMOVE_TARGET) |
90 | - $(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) | 90 | - $(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
91 | + $(CC_COMPILE) -static -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) | 91 | + $(CC_COMPILE) -static -fuse-ld=bfd -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
92 | 92 | ||
93 | endif | 93 | endif |
94 | 94 | ||
diff --git a/recipes-core/openjdk/openjdk-7-25b30/icedtea-crosscompile-fix.patch b/recipes-core/openjdk/openjdk-7-25b30/icedtea-crosscompile-fix.patch index 39436a5..0c6aac4 100644 --- a/recipes-core/openjdk/openjdk-7-25b30/icedtea-crosscompile-fix.patch +++ b/recipes-core/openjdk/openjdk-7-25b30/icedtea-crosscompile-fix.patch | |||
@@ -319,7 +319,7 @@ index 53d31f3..183c063 100644 | |||
319 | endif # 32 | 319 | endif # 32 |
320 | endif # !macosx | 320 | endif # !macosx |
321 | endif # solaris | 321 | endif # solaris |
322 | @@ -337,11 +317,7 @@ WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator | 322 | @@ -337,15 +321,11 @@ WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator |
323 | WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class | 323 | WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class |
324 | XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt | 324 | XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt |
325 | 325 | ||
@@ -331,6 +331,11 @@ index 53d31f3..183c063 100644 | |||
331 | 331 | ||
332 | $(SIZERS): $(SIZERS_C) | 332 | $(SIZERS): $(SIZERS_C) |
333 | $(prep-target) | 333 | $(prep-target) |
334 | - $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c | ||
335 | + $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -static -fuse-ld=bfd -o $@ $(SIZER)$(suffix $@).c | ||
336 | |||
337 | $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) | ||
338 | $(prep-target) | ||
334 | @@ -358,6 +334,16 @@ $(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES) | 339 | @@ -358,6 +334,16 @@ $(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES) |
335 | $(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@))) | 340 | $(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@))) |
336 | 341 | ||
diff --git a/recipes-core/openjdk/openjdk-7-25b30/icedtea-zero-hotspotfix.patch b/recipes-core/openjdk/openjdk-7-25b30/icedtea-zero-hotspotfix.patch index 83dba2b..784f2de 100644 --- a/recipes-core/openjdk/openjdk-7-25b30/icedtea-zero-hotspotfix.patch +++ b/recipes-core/openjdk/openjdk-7-25b30/icedtea-zero-hotspotfix.patch | |||
@@ -25,13 +25,13 @@ index c2a1484..156bdd0 100644 | |||
25 | mkbc: $(GAMMADIR)/tools/mkbc.c | 25 | mkbc: $(GAMMADIR)/tools/mkbc.c |
26 | @echo Compiling mkbc tool | 26 | @echo Compiling mkbc tool |
27 | - $(CC_COMPILE) -o $@ $< $(COMPILE_DONE) | 27 | - $(CC_COMPILE) -o $@ $< $(COMPILE_DONE) |
28 | + $(CC_COMPILE) -static -o $@ $< $(COMPILE_DONE) | 28 | + $(CC_COMPILE) -static -fuse-ld=bfd -o $@ $< $(COMPILE_DONE) |
29 | 29 | ||
30 | mkoffsets: asm_helper.cpp | 30 | mkoffsets: asm_helper.cpp |
31 | @echo Compiling offset generator | 31 | @echo Compiling offset generator |
32 | $(QUIETLY) $(REMOVE_TARGET) | 32 | $(QUIETLY) $(REMOVE_TARGET) |
33 | - $(CC_COMPILE) $(CFLAGS) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) | 33 | - $(CC_COMPILE) $(CFLAGS) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
34 | + $(CC_COMPILE) $(CFLAGS) -DSTATIC_OFFSETS -static -o $@ $< $(COMPILE_DONE) | 34 | + $(CC_COMPILE) $(CFLAGS) -static -fuse-ld=bfd -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE) |
35 | 35 | ||
36 | endif | 36 | endif |
37 | 37 | ||