From 71cc38affe7b282fdea6f35c9876632056ef22ec Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Sat, 20 Jul 2013 15:38:37 +0200 Subject: qtjsbackend: refresh patches, move to subdirectory Signed-off-by: Martin Jansa --- ...-the-mkv8snapshot-tool-to-the-native-side.patch | 32 ++++ ...pro-respect-external-host-bindir-when-set.patch | 31 ++++ ...hardfp-ABI-detection.-This-work-was-trigg.patch | 190 +++++++++++++++++++++ ...-the-mkv8snapshot-tool-to-the-native-side.patch | 32 ++++ ...pro-respect-external-host-bindir-when-set.patch | 31 ++++ ...-the-mkv8snapshot-tool-to-the-native-side.patch | 32 ---- ...pro-respect-external-host-bindir-when-set.patch | 31 ---- ...hardfp-ABI-detection.-This-work-was-trigg.patch | 190 --------------------- 8 files changed, 316 insertions(+), 253 deletions(-) create mode 100644 recipes-qt/qt5/qtjsbackend-5.0.2/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch create mode 100644 recipes-qt/qt5/qtjsbackend-5.0.2/0002-v8.pro-respect-external-host-bindir-when-set.patch create mode 100644 recipes-qt/qt5/qtjsbackend-5.0.2/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch create mode 100644 recipes-qt/qt5/qtjsbackend-git/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch create mode 100644 recipes-qt/qt5/qtjsbackend-git/0002-v8.pro-respect-external-host-bindir-when-set.patch delete mode 100644 recipes-qt/qt5/qtjsbackend/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch delete mode 100644 recipes-qt/qt5/qtjsbackend/0002-v8.pro-respect-external-host-bindir-when-set.patch delete mode 100644 recipes-qt/qt5/qtjsbackend/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch diff --git a/recipes-qt/qt5/qtjsbackend-5.0.2/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch b/recipes-qt/qt5/qtjsbackend-5.0.2/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch new file mode 100644 index 00000000..ec0c22d0 --- /dev/null +++ b/recipes-qt/qt5/qtjsbackend-5.0.2/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch @@ -0,0 +1,32 @@ +From 293e982e084661e0caf686737dcdcda9e2e3e083 Mon Sep 17 00:00:00 2001 +From: Mikko Levonmaa +Date: Tue, 4 Dec 2012 11:20:13 -0800 +Subject: [PATCH 1/3] Install the mkv8snapshot tool to the native side + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Mikko Levonmaa +--- + src/tools/mkv8snapshot/mkv8snapshot.pro | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/tools/mkv8snapshot/mkv8snapshot.pro b/src/tools/mkv8snapshot/mkv8snapshot.pro +index 16beb02..5e327f7 100644 +--- a/src/tools/mkv8snapshot/mkv8snapshot.pro ++++ b/src/tools/mkv8snapshot/mkv8snapshot.pro +@@ -24,5 +24,10 @@ unix:LIBS += -lpthread + + # We don't need to install this tool, it's only used for building v8. + # However we do have to make sure that 'make install' builds it. +-dummytarget.CONFIG = dummy_install +-INSTALLS += dummytarget ++#dummytarget.CONFIG = dummy_install ++#INSTALLS += dummytarget ++ ++# Install the tool so that during target cross compilation we have access to the native side binary ++target.path = $$[QT_HOST_BINS] ++INSTALLS += target ++ +-- +1.8.3.2 + diff --git a/recipes-qt/qt5/qtjsbackend-5.0.2/0002-v8.pro-respect-external-host-bindir-when-set.patch b/recipes-qt/qt5/qtjsbackend-5.0.2/0002-v8.pro-respect-external-host-bindir-when-set.patch new file mode 100644 index 00000000..86d84139 --- /dev/null +++ b/recipes-qt/qt5/qtjsbackend-5.0.2/0002-v8.pro-respect-external-host-bindir-when-set.patch @@ -0,0 +1,31 @@ +From fa85676a52fb6e12e6db85ace4b6a2cfc1d5239a Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Sun, 28 Apr 2013 02:45:01 +0200 +Subject: [PATCH 2/3] v8.pro: respect external-host-bindir, when set + +Upstream-Status: Pending + +Signed-off-by: Martin Jansa +--- + src/v8/v8.pro | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/v8/v8.pro b/src/v8/v8.pro +index 2be6a19..d3da4e1 100644 +--- a/src/v8/v8.pro ++++ b/src/v8/v8.pro +@@ -25,7 +25,10 @@ INCLUDEPATH -= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. + include(v8.pri) + + contains(QT_CONFIG, v8snapshot) { +- mkv8snapshot.commands = ../../bin/mkv8snapshot$$qtPlatformTargetSuffix() ${QMAKE_FILE_OUT} ++ mkv8snapshot.tool=$$[QT_EXTERNAL_HOST_BINS]/mkv8snapshot$$qtPlatformTargetSuffix() ++ !exists($$mkv8snapshot.tool): \ ++ mkv8snapshot.tool=../../bin/mkv8snapshot$$qtPlatformTargetSuffix() ++ mkv8snapshot.commands = $$mkv8snapshot.tool ${QMAKE_FILE_OUT} + DUMMY_FILE = v8.pro + mkv8snapshot.input = DUMMY_FILE + mkv8snapshot.output = $$V8_GENERATED_SOURCES_DIR/snapshot.cpp +-- +1.8.3.2 + diff --git a/recipes-qt/qt5/qtjsbackend-5.0.2/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch b/recipes-qt/qt5/qtjsbackend-5.0.2/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch new file mode 100644 index 00000000..6688d8d4 --- /dev/null +++ b/recipes-qt/qt5/qtjsbackend-5.0.2/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch @@ -0,0 +1,190 @@ +From d8a3566b013ba581e638cf2b960a8488d5fc9d64 Mon Sep 17 00:00:00 2001 +From: Sergio Martins +Date: Wed, 20 Feb 2013 22:34:46 +0000 +Subject: [PATCH 3/3] [V8] Cleanup hardfp ABI detection. This work was + triggered by issue 2140. + +Upstream Patch: https://chromiumcodereview.appspot.com/10713009 + +Task-Number: QTBUG-28890 +Change-Id: Id073388fbbffa2ad9b1cea0ab42e1d6e47862a36 +Reviewed-by: Sean Harmer +Reviewed-by: Simon Hausmann +--- + src/3rdparty/v8/src/platform-linux.cc | 70 ++++++++++++++++------------------ + src/3rdparty/v8/src/platform-qnx.cc | 71 ++++++++++++++++------------------- + 2 files changed, 65 insertions(+), 76 deletions(-) + +diff --git a/src/3rdparty/v8/src/platform-linux.cc b/src/3rdparty/v8/src/platform-linux.cc +index f6db423..18f59dd 100644 +--- a/src/3rdparty/v8/src/platform-linux.cc ++++ b/src/3rdparty/v8/src/platform-linux.cc +@@ -161,47 +161,41 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) { + } + + +-// Simple helper function to detect whether the C code is compiled with +-// option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register +-// pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then +-// calling this will return 1.0 and otherwise 0.0. +-static void ArmUsingHardFloatHelper() { +- asm("mov r0, #0":::"r0"); +-#if defined(__VFP_FP__) && !defined(__SOFTFP__) +- // Load 0x3ff00000 into r1 using instructions available in both ARM +- // and Thumb mode. +- asm("mov r1, #3":::"r1"); +- asm("mov r2, #255":::"r2"); +- asm("lsl r1, r1, #8":::"r1"); +- asm("orr r1, r1, r2":::"r1"); +- asm("lsl r1, r1, #20":::"r1"); +- // For vmov d0, r0, r1 use ARM mode. +-#ifdef __thumb__ +- asm volatile( +- "@ Enter ARM Mode \n\t" +- " adr r3, 1f \n\t" +- " bx r3 \n\t" +- " .ALIGN 4 \n\t" +- " .ARM \n" +- "1: vmov d0, r0, r1 \n\t" +- "@ Enter THUMB Mode\n\t" +- " adr r3, 2f+1 \n\t" +- " bx r3 \n\t" +- " .THUMB \n" +- "2: \n\t":::"r3"); ++bool OS::ArmUsingHardFloat() { ++ // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify ++ // the Floating Point ABI used (PCS stands for Procedure Call Standard). ++ // We use these as well as a couple of other defines to statically determine ++ // what FP ABI used. ++ // GCC versions 4.4 and below don't support hard-fp. ++ // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or ++ // __ARM_PCS_VFP. ++ ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) ++#if GCC_VERSION >= 40600 ++#if defined(__ARM_PCS_VFP) ++ return true; + #else +- asm("vmov d0, r0, r1"); +-#endif // __thumb__ +-#endif // defined(__VFP_FP__) && !defined(__SOFTFP__) +- asm("mov r1, #0":::"r1"); +-} ++ return false; ++#endif + ++#elif GCC_VERSION < 40500 ++ return false; + +-bool OS::ArmUsingHardFloat() { +- // Cast helper function from returning void to returning double. +- typedef double (*F)(); +- F f = FUNCTION_CAST(FUNCTION_ADDR(ArmUsingHardFloatHelper)); +- return f() == 1.0; ++#else ++#if defined(__ARM_PCS_VFP) ++ return true; ++#elif defined(__ARM_PCS) || defined(__SOFTFP) || !defined(__VFP_FP__) ++ return false; ++#else ++#error "Your version of GCC does not report the FP ABI compiled for." \ ++ "Please report it on this issue" \ ++ "http://code.google.com/p/v8/issues/detail?id=2140" ++ ++#endif ++#endif ++#undef GCC_VERSION + } + #endif // def __arm__ + +diff --git a/src/3rdparty/v8/src/platform-qnx.cc b/src/3rdparty/v8/src/platform-qnx.cc +index bf9f5ba..46d69b8 100644 +--- a/src/3rdparty/v8/src/platform-qnx.cc ++++ b/src/3rdparty/v8/src/platform-qnx.cc +@@ -139,48 +139,43 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) { + } + + +-// Simple helper function to detect whether the C code is compiled with +-// option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register +-// pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then +-// calling this will return 1.0 and otherwise 0.0. +-static void ArmUsingHardFloatHelper() { +- asm("mov r0, #0"); +-#if defined(__VFP_FP__) && !defined(__SOFTFP__) +- // Load 0x3ff00000 into r1 using instructions available in both ARM +- // and Thumb mode. +- asm("mov r1, #3"); +- asm("mov r2, #255"); +- asm("lsl r1, r1, #8"); +- asm("orr r1, r1, r2"); +- asm("lsl r1, r1, #20"); +- // For vmov d0, r0, r1 use ARM mode. +-#ifdef __thumb__ +- asm volatile( +- "@ Enter ARM Mode \n\t" +- " adr r3, 1f \n\t" +- " bx r3 \n\t" +- " .ALIGN 4 \n\t" +- " .ARM \n" +- "1: vmov d0, r0, r1 \n\t" +- "@ Enter THUMB Mode\n\t" +- " adr r3, 2f+1 \n\t" +- " bx r3 \n\t" +- " .THUMB \n" +- "2: \n\t"); ++bool OS::ArmUsingHardFloat() { ++ // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify ++ // the Floating Point ABI used (PCS stands for Procedure Call Standard). ++ // We use these as well as a couple of other defines to statically determine ++ // what FP ABI used. ++ // GCC versions 4.4 and below don't support hard-fp. ++ // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or ++ // __ARM_PCS_VFP. ++ ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) ++#if GCC_VERSION >= 40600 ++#if defined(__ARM_PCS_VFP) ++ return true; + #else +- asm("vmov d0, r0, r1"); +-#endif // __thumb__ +-#endif // defined(__VFP_FP__) && !defined(__SOFTFP__) +- asm("mov r1, #0"); +-} ++ return false; ++#endif + ++#elif GCC_VERSION < 40500 ++ return false; + +-bool OS::ArmUsingHardFloat() { +- // Cast helper function from returning void to returning double. +- typedef double (*F)(); +- F f = FUNCTION_CAST(FUNCTION_ADDR(ArmUsingHardFloatHelper)); +- return f() == 1.0; ++#else ++#if defined(__ARM_PCS_VFP) ++ return true; ++#elif defined(__ARM_PCS) || defined(__SOFTFP) || !defined(__VFP_FP__) ++ return false; ++#else ++#error "Your version of GCC does not report the FP ABI compiled for." \ ++ "Please report it on this issue" \ ++ "http://code.google.com/p/v8/issues/detail?id=2140" ++ ++#endif ++#endif ++#undef GCC_VERSION + } ++ + #endif // def __arm__ + + +-- +1.8.3.2 + diff --git a/recipes-qt/qt5/qtjsbackend-git/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch b/recipes-qt/qt5/qtjsbackend-git/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch new file mode 100644 index 00000000..e823b761 --- /dev/null +++ b/recipes-qt/qt5/qtjsbackend-git/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch @@ -0,0 +1,32 @@ +From 8ae71a0a3b898f95485148c9b2e89aeee9cf27e9 Mon Sep 17 00:00:00 2001 +From: Mikko Levonmaa +Date: Tue, 4 Dec 2012 11:20:13 -0800 +Subject: [PATCH 1/2] Install the mkv8snapshot tool to the native side + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Mikko Levonmaa +--- + src/tools/mkv8snapshot/mkv8snapshot.pro | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/tools/mkv8snapshot/mkv8snapshot.pro b/src/tools/mkv8snapshot/mkv8snapshot.pro +index 16beb02..5e327f7 100644 +--- a/src/tools/mkv8snapshot/mkv8snapshot.pro ++++ b/src/tools/mkv8snapshot/mkv8snapshot.pro +@@ -24,5 +24,10 @@ unix:LIBS += -lpthread + + # We don't need to install this tool, it's only used for building v8. + # However we do have to make sure that 'make install' builds it. +-dummytarget.CONFIG = dummy_install +-INSTALLS += dummytarget ++#dummytarget.CONFIG = dummy_install ++#INSTALLS += dummytarget ++ ++# Install the tool so that during target cross compilation we have access to the native side binary ++target.path = $$[QT_HOST_BINS] ++INSTALLS += target ++ +-- +1.8.3.2 + diff --git a/recipes-qt/qt5/qtjsbackend-git/0002-v8.pro-respect-external-host-bindir-when-set.patch b/recipes-qt/qt5/qtjsbackend-git/0002-v8.pro-respect-external-host-bindir-when-set.patch new file mode 100644 index 00000000..b0ac27d1 --- /dev/null +++ b/recipes-qt/qt5/qtjsbackend-git/0002-v8.pro-respect-external-host-bindir-when-set.patch @@ -0,0 +1,31 @@ +From c40e89b048e225cfb961ac65a96a30ce3ec624f5 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Sun, 28 Apr 2013 02:45:01 +0200 +Subject: [PATCH 2/2] v8.pro: respect external-host-bindir, when set + +Upstream-Status: Pending + +Signed-off-by: Martin Jansa +--- + src/v8/v8.pro | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/v8/v8.pro b/src/v8/v8.pro +index 2be6a19..d3da4e1 100644 +--- a/src/v8/v8.pro ++++ b/src/v8/v8.pro +@@ -25,7 +25,10 @@ INCLUDEPATH -= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. + include(v8.pri) + + contains(QT_CONFIG, v8snapshot) { +- mkv8snapshot.commands = ../../bin/mkv8snapshot$$qtPlatformTargetSuffix() ${QMAKE_FILE_OUT} ++ mkv8snapshot.tool=$$[QT_EXTERNAL_HOST_BINS]/mkv8snapshot$$qtPlatformTargetSuffix() ++ !exists($$mkv8snapshot.tool): \ ++ mkv8snapshot.tool=../../bin/mkv8snapshot$$qtPlatformTargetSuffix() ++ mkv8snapshot.commands = $$mkv8snapshot.tool ${QMAKE_FILE_OUT} + DUMMY_FILE = v8.pro + mkv8snapshot.input = DUMMY_FILE + mkv8snapshot.output = $$V8_GENERATED_SOURCES_DIR/snapshot.cpp +-- +1.8.3.2 + diff --git a/recipes-qt/qt5/qtjsbackend/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch b/recipes-qt/qt5/qtjsbackend/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch deleted file mode 100644 index f60e2a71..00000000 --- a/recipes-qt/qt5/qtjsbackend/0001-Install-the-mkv8snapshot-tool-to-the-native-side.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1539ddfc5f9c639554db98227c4d1de3b1f67792 Mon Sep 17 00:00:00 2001 -From: Mikko Levonmaa -Date: Tue, 4 Dec 2012 11:20:13 -0800 -Subject: [PATCH 1/2] Install the mkv8snapshot tool to the native side - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Mikko Levonmaa ---- - src/tools/mkv8snapshot/mkv8snapshot.pro | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/tools/mkv8snapshot/mkv8snapshot.pro b/src/tools/mkv8snapshot/mkv8snapshot.pro -index 16beb02..5e327f7 100644 ---- a/src/tools/mkv8snapshot/mkv8snapshot.pro -+++ b/src/tools/mkv8snapshot/mkv8snapshot.pro -@@ -24,5 +24,10 @@ unix:LIBS += -lpthread - - # We don't need to install this tool, it's only used for building v8. - # However we do have to make sure that 'make install' builds it. --dummytarget.CONFIG = dummy_install --INSTALLS += dummytarget -+#dummytarget.CONFIG = dummy_install -+#INSTALLS += dummytarget -+ -+# Install the tool so that during target cross compilation we have access to the native side binary -+target.path = $$[QT_HOST_BINS] -+INSTALLS += target -+ --- -1.8.2.1 - diff --git a/recipes-qt/qt5/qtjsbackend/0002-v8.pro-respect-external-host-bindir-when-set.patch b/recipes-qt/qt5/qtjsbackend/0002-v8.pro-respect-external-host-bindir-when-set.patch deleted file mode 100644 index 5ff08d23..00000000 --- a/recipes-qt/qt5/qtjsbackend/0002-v8.pro-respect-external-host-bindir-when-set.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 79deac4cdb9d223ed22a989f1d3e86fc3504c78e Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Sun, 28 Apr 2013 02:45:01 +0200 -Subject: [PATCH 2/2] v8.pro: respect external-host-bindir, when set - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa ---- - src/v8/v8.pro | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/v8/v8.pro b/src/v8/v8.pro -index 2be6a19..d3da4e1 100644 ---- a/src/v8/v8.pro -+++ b/src/v8/v8.pro -@@ -25,7 +25,10 @@ INCLUDEPATH -= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. - include(v8.pri) - - contains(QT_CONFIG, v8snapshot) { -- mkv8snapshot.commands = ../../bin/mkv8snapshot$$qtPlatformTargetSuffix() ${QMAKE_FILE_OUT} -+ mkv8snapshot.tool=$$[QT_EXTERNAL_HOST_BINS]/mkv8snapshot$$qtPlatformTargetSuffix() -+ !exists($$mkv8snapshot.tool): \ -+ mkv8snapshot.tool=../../bin/mkv8snapshot$$qtPlatformTargetSuffix() -+ mkv8snapshot.commands = $$mkv8snapshot.tool ${QMAKE_FILE_OUT} - DUMMY_FILE = v8.pro - mkv8snapshot.input = DUMMY_FILE - mkv8snapshot.output = $$V8_GENERATED_SOURCES_DIR/snapshot.cpp --- -1.8.2.1 - diff --git a/recipes-qt/qt5/qtjsbackend/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch b/recipes-qt/qt5/qtjsbackend/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch deleted file mode 100644 index a1f14141..00000000 --- a/recipes-qt/qt5/qtjsbackend/0003-V8-Cleanup-hardfp-ABI-detection.-This-work-was-trigg.patch +++ /dev/null @@ -1,190 +0,0 @@ -From d8a3566b013ba581e638cf2b960a8488d5fc9d64 Mon Sep 17 00:00:00 2001 -From: Sergio Martins -Date: Wed, 20 Feb 2013 22:34:46 +0000 -Subject: [PATCH 3/3] [V8] Cleanup hardfp ABI detection. This work was - triggered by issue 2140. - -Upstream Patch: https://chromiumcodereview.appspot.com/10713009 - -Task-Number: QTBUG-28890 -Change-Id: Id073388fbbffa2ad9b1cea0ab42e1d6e47862a36 -Reviewed-by: Sean Harmer -Reviewed-by: Simon Hausmann ---- - src/3rdparty/v8/src/platform-linux.cc | 70 ++++++++++++++++------------------ - src/3rdparty/v8/src/platform-qnx.cc | 71 ++++++++++++++++------------------- - 2 files changed, 65 insertions(+), 76 deletions(-) - -diff --git a/src/3rdparty/v8/src/platform-linux.cc b/src/3rdparty/v8/src/platform-linux.cc -index f6db423..18f59dd 100644 ---- a/src/3rdparty/v8/src/platform-linux.cc -+++ b/src/3rdparty/v8/src/platform-linux.cc -@@ -161,47 +161,41 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) { - } - - --// Simple helper function to detect whether the C code is compiled with --// option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register --// pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then --// calling this will return 1.0 and otherwise 0.0. --static void ArmUsingHardFloatHelper() { -- asm("mov r0, #0":::"r0"); --#if defined(__VFP_FP__) && !defined(__SOFTFP__) -- // Load 0x3ff00000 into r1 using instructions available in both ARM -- // and Thumb mode. -- asm("mov r1, #3":::"r1"); -- asm("mov r2, #255":::"r2"); -- asm("lsl r1, r1, #8":::"r1"); -- asm("orr r1, r1, r2":::"r1"); -- asm("lsl r1, r1, #20":::"r1"); -- // For vmov d0, r0, r1 use ARM mode. --#ifdef __thumb__ -- asm volatile( -- "@ Enter ARM Mode \n\t" -- " adr r3, 1f \n\t" -- " bx r3 \n\t" -- " .ALIGN 4 \n\t" -- " .ARM \n" -- "1: vmov d0, r0, r1 \n\t" -- "@ Enter THUMB Mode\n\t" -- " adr r3, 2f+1 \n\t" -- " bx r3 \n\t" -- " .THUMB \n" -- "2: \n\t":::"r3"); -+bool OS::ArmUsingHardFloat() { -+ // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify -+ // the Floating Point ABI used (PCS stands for Procedure Call Standard). -+ // We use these as well as a couple of other defines to statically determine -+ // what FP ABI used. -+ // GCC versions 4.4 and below don't support hard-fp. -+ // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or -+ // __ARM_PCS_VFP. -+ -+#define GCC_VERSION (__GNUC__ * 10000 \ -+ + __GNUC_MINOR__ * 100 \ -+ + __GNUC_PATCHLEVEL__) -+#if GCC_VERSION >= 40600 -+#if defined(__ARM_PCS_VFP) -+ return true; - #else -- asm("vmov d0, r0, r1"); --#endif // __thumb__ --#endif // defined(__VFP_FP__) && !defined(__SOFTFP__) -- asm("mov r1, #0":::"r1"); --} -+ return false; -+#endif - -+#elif GCC_VERSION < 40500 -+ return false; - --bool OS::ArmUsingHardFloat() { -- // Cast helper function from returning void to returning double. -- typedef double (*F)(); -- F f = FUNCTION_CAST(FUNCTION_ADDR(ArmUsingHardFloatHelper)); -- return f() == 1.0; -+#else -+#if defined(__ARM_PCS_VFP) -+ return true; -+#elif defined(__ARM_PCS) || defined(__SOFTFP) || !defined(__VFP_FP__) -+ return false; -+#else -+#error "Your version of GCC does not report the FP ABI compiled for." \ -+ "Please report it on this issue" \ -+ "http://code.google.com/p/v8/issues/detail?id=2140" -+ -+#endif -+#endif -+#undef GCC_VERSION - } - #endif // def __arm__ - -diff --git a/src/3rdparty/v8/src/platform-qnx.cc b/src/3rdparty/v8/src/platform-qnx.cc -index bf9f5ba..46d69b8 100644 ---- a/src/3rdparty/v8/src/platform-qnx.cc -+++ b/src/3rdparty/v8/src/platform-qnx.cc -@@ -139,48 +139,43 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) { - } - - --// Simple helper function to detect whether the C code is compiled with --// option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register --// pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then --// calling this will return 1.0 and otherwise 0.0. --static void ArmUsingHardFloatHelper() { -- asm("mov r0, #0"); --#if defined(__VFP_FP__) && !defined(__SOFTFP__) -- // Load 0x3ff00000 into r1 using instructions available in both ARM -- // and Thumb mode. -- asm("mov r1, #3"); -- asm("mov r2, #255"); -- asm("lsl r1, r1, #8"); -- asm("orr r1, r1, r2"); -- asm("lsl r1, r1, #20"); -- // For vmov d0, r0, r1 use ARM mode. --#ifdef __thumb__ -- asm volatile( -- "@ Enter ARM Mode \n\t" -- " adr r3, 1f \n\t" -- " bx r3 \n\t" -- " .ALIGN 4 \n\t" -- " .ARM \n" -- "1: vmov d0, r0, r1 \n\t" -- "@ Enter THUMB Mode\n\t" -- " adr r3, 2f+1 \n\t" -- " bx r3 \n\t" -- " .THUMB \n" -- "2: \n\t"); -+bool OS::ArmUsingHardFloat() { -+ // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify -+ // the Floating Point ABI used (PCS stands for Procedure Call Standard). -+ // We use these as well as a couple of other defines to statically determine -+ // what FP ABI used. -+ // GCC versions 4.4 and below don't support hard-fp. -+ // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or -+ // __ARM_PCS_VFP. -+ -+#define GCC_VERSION (__GNUC__ * 10000 \ -+ + __GNUC_MINOR__ * 100 \ -+ + __GNUC_PATCHLEVEL__) -+#if GCC_VERSION >= 40600 -+#if defined(__ARM_PCS_VFP) -+ return true; - #else -- asm("vmov d0, r0, r1"); --#endif // __thumb__ --#endif // defined(__VFP_FP__) && !defined(__SOFTFP__) -- asm("mov r1, #0"); --} -+ return false; -+#endif - -+#elif GCC_VERSION < 40500 -+ return false; - --bool OS::ArmUsingHardFloat() { -- // Cast helper function from returning void to returning double. -- typedef double (*F)(); -- F f = FUNCTION_CAST(FUNCTION_ADDR(ArmUsingHardFloatHelper)); -- return f() == 1.0; -+#else -+#if defined(__ARM_PCS_VFP) -+ return true; -+#elif defined(__ARM_PCS) || defined(__SOFTFP) || !defined(__VFP_FP__) -+ return false; -+#else -+#error "Your version of GCC does not report the FP ABI compiled for." \ -+ "Please report it on this issue" \ -+ "http://code.google.com/p/v8/issues/detail?id=2140" -+ -+#endif -+#endif -+#undef GCC_VERSION - } -+ - #endif // def __arm__ - - --- -1.8.2.1 - -- cgit v1.2.3