From e710e0f48854c5f993c536bed76a79313fc6f83d Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Fri, 14 Nov 2014 17:09:55 +0100 Subject: icedtea6-native: fix native-vsyscall failing On a Fedora 20 build machine icedtea6-native fails with: x86_64-linux/icedtea6-native/1.8.11-r5.3/icedtea6-1.8.11/openjdk-ecj/hotspot/src/os/linux/vm/os_linux.cpp:2431:60: error: expression cannot be used as a function vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); ^ make[7]: *** [os_linux.o] Error 1 The patch makes the build succeed. (On an openSUSE 13.1 machine the build succeeds with and without the patch) --- .../icedtea-native-vsyscall.patch | 43 ++++++++++++++++++++++ recipes-core/icedtea/icedtea6-native_1.8.11.bb | 2 + 2 files changed, 45 insertions(+) create mode 100644 recipes-core/icedtea/icedtea6-native-1.8.11/icedtea-native-vsyscall.patch (limited to 'recipes-core/icedtea') diff --git a/recipes-core/icedtea/icedtea6-native-1.8.11/icedtea-native-vsyscall.patch b/recipes-core/icedtea/icedtea6-native-1.8.11/icedtea-native-vsyscall.patch new file mode 100644 index 0000000..936b211 --- /dev/null +++ b/recipes-core/icedtea/icedtea6-native-1.8.11/icedtea-native-vsyscall.patch @@ -0,0 +1,43 @@ +Fixes the following compile time error when compiling icedtea6-native-1.8.11-r5.3 on a Fedora 20, x86_64: +os_linux.cpp: In function 'int sched_getcpu_syscall()': +os_linux.cpp:2431:60: error: expression cannot be used as a function + vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); + +Fix taken from: +http://hg.openjdk.java.net/jdk6/jdk6/hotspot/rev/9447b2fb6fcf + +Signed-off-by: Max Krummenacher + +--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp.orig 2014-10-15 14:57:39.681794315 +0200 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2014-10-15 15:41:32.398109645 +0200 +@@ -54,10 +54,6 @@ + # include + # include + +-#if __x86_64__ +-#include +-#endif +- + #define MAX_PATH (2 * K) + + // for timer info max values which include all bits +@@ -2427,10 +2423,19 @@ + int retval = -1; + + #if __x86_64__ ++// Unfortunately we have to bring all these macros here from vsyscall.h ++// to be able to compile on old linuxes. ++# define __NR_vgetcpu 2 ++# define VSYSCALL_START (-10UL << 20) ++# define VSYSCALL_SIZE 1024 ++# define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr)) + typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache); + vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); + retval = vgetcpu(&cpu, NULL, NULL); + #elif __i386__ ++# ifndef SYS_getcpu ++# define SYS_getcpu 318 ++# endif + retval = syscall(SYS_getcpu, &cpu, NULL, NULL); + #endif + diff --git a/recipes-core/icedtea/icedtea6-native_1.8.11.bb b/recipes-core/icedtea/icedtea6-native_1.8.11.bb index 8ed3559..f0709f4 100644 --- a/recipes-core/icedtea/icedtea6-native_1.8.11.bb +++ b/recipes-core/icedtea/icedtea6-native_1.8.11.bb @@ -47,6 +47,7 @@ ICEDTEA_PATCHES = "\ file://icedtea-unbreak-float.patch;apply=no \ file://icedtea-jdk-avoid-cdef-collision.patch;apply=no \ file://icedtea-hotspot-dont-return-booleans.patch;apply=no \ + file://icedtea-native-vsyscall.patch;apply=no \ " export DISTRIBUTION_PATCHES = "\ @@ -58,6 +59,7 @@ export DISTRIBUTION_PATCHES = "\ patches/icedtea-unbreak-float.patch \ patches/icedtea-jdk-avoid-cdef-collision.patch \ patches/icedtea-hotspot-dont-return-booleans.patch \ + patches/icedtea-native-vsyscall.patch \ " EXTRA_OECONF += " --with-jaxws-drop-zip=${DL_DIR}/jdk6-jaxws-2009_10_27.zip \ -- cgit v1.2.3-54-g00ecf