qt5base: fix double conversion for microblazeel/microblazebe
PATCH 1/1 qt5base: fix double conversion for microblazeel/microblazebe
Fixes [1]:
../3rdparty/double-conversion/include/double-conversion/utils.h:81:2: error: #error Target architecture was not detected as supported by Double-Conversion. #error Target architecture was not detected as supported by Double-Conversion.
[1] http://autobuild.buildroot.net/results/489/4891d96f45c64c2e66fe819bd4175cc1d6243a93
---
Notes:
Double-converson tested with:
$ cat div.c
double Div_double(double x, double y) { return x / y; }$ cat main.c
double Div_double(double x, double y);
int main(int argc, char** argv) {
double result = Div_double(89255.0, 1e22);
if (result == 89255e-22) {
printf("correct result %e\n", result);
return 1;
} else {
printf("wrong result %e\n", result);
return 0; }
}
For microblazeel (using qemu_microblazeel_mmu_defconfig changed to musl because the original uclibc resulted in 'mmap of a spare page failed!' error message):
$ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -c main.c $ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -c div.c $ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -o main main.o div.o
Fix wrong staging absolute soft link to relative:
$ ls -l build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1 ../staging/lib/ld-musl-microblazeel.so.1 -> /lib/libc.so $ rm build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1 $ ln -s libc.so build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1
$ qemu-3.0.0-microblazeel-install/bin/qemu-microblazeel -L build_qemu_microblazeel_001/staging main correct result 8.925500e-18
For microblazebe (using qemu_microblazebe_mmu_defconfig changed to glibc because the original uclibc resulted in 'mmap of a spare page failed!' error message):
$ ./build_qemu_microblazebe_001/host/bin/microblaze-buildroot-linux-gnu-gcc -c main.c $ ./build_qemu_microblazebe_001/host/bin/microblaze-buildroot-linux-gnu-gcc -c div.c $ .//build_qemu_microblazebe_001/host/bin/microblaze-buildroot-linux-gnu-gcc -o main main.o div.o
$ qemu-3.0.0-microblazebe-install/bin/qemu-microblaze -L build_qemu_microblazebe_001/staging main correct result 8.925500e-18 --- ...ble-conversion-enable-for-microblaze.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 package/qt5/qt5base/5.11.1/0004-double-conversion-enable-for-microblaze.patch
package/qt5/qt5base/5.11.1/0004-double-conversion-enable-for-microblaze.patch new file +27 -0
@@ -0,0 +1,27 @@ +From 372d33fbe549ea73318c187505716ac99fbf3054 Mon Sep 17 00:00:00 2001 +From: Peter Seiderer <[email protected]> +Date: Tue, 21 Aug 2018 21:11:40 +0200 +Subject: [PATCH] double-conversion: enable for microblaze + +Signed-off-by: Peter Seiderer <[email protected]> +--- + .../double-conversion/include/double-conversion/utils.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/3rdparty/double-conversion/include/double-conversion/utils.h b/src/3rdparty/double-conversion/include/double-conversion/utils.h +index b0a7d5d4f4..485f680180 100644 +--- a/src/3rdparty/double-conversion/include/double-conversion/utils.h ++++ b/src/3rdparty/double-conversion/include/double-conversion/utils.h +@@ -66,7 +66,8 @@ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || \ + defined(__AARCH64EL__) || defined(__AARCH64EB__) || \ +- defined(__or1k__) ++ defined(__or1k__) || \ ++ defined(__microblaze__) + #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 + #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) + #if defined(_WIN32) +-- +2.18.0 +
Signature · 1 line
2.18.0
Thomas Petazzoni
AppliedPATCH 1/1 qt5base: fix double conversion for microblazeel/microblazebe
Hello,
Quoted 8 lines · Peter Seiderer
Fixes [1]:
../3rdparty/double-conversion/include/double-conversion/utils.h:81:2: error: #error Target architecture was not detected as supported by Double-Conversion. #error Target architecture was not detected as supported by Double-Conversion.[1] http://autobuild.buildroot.net/results/489/4891d96f45c64c2e66fe819bd4175cc1d6243a93
Signed-off-by Peter Seiderer <[email protected]>
Thanks for working on this again. Can you submit your or1k and microblaze changes back to the upstream double-conversion project (and perhaps also Qt5) ?
Quoted 3 lines
For microblazeel (using
qemu_microblazeel_mmu_defconfigchanged to musl because the original uclibc resulted in 'mmap of a spare page failed!' error message):
This uClibc issue is something for Waldemar. I'm personally still a bit impressed by the magic of qemu user mode emulation.
Quoted 9 lines
$ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -c main.c $ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -c div.c $ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -o main main.o div.oFix wrong staging absolute soft link to relative:
$ ls -l build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1 ../staging/lib/ld-musl-microblazeel.so.1 -> /lib/libc.so $ rm build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1 $ ln -s libc.so build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1
That's weird, I have a musl toolchain here (installed from an external toolchain), and its symlink is relative:
$ ls -l output/staging/lib/{ld-musl*,libc.so}
lrwxrwxrwx 1 thomas thomas 14 Aug 21 22:14 output/staging/lib/ld-musl-armhf.so.1 -> ../lib/libc.so
-rwxr-xr-x 1 thomas thomas 740772 Jun 26 00:08 output/staging/lib/libc.soApplied to master. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 qt5base: fix double conversion for microblazeel/microblazebe
Hello Thomas,
Quoted 8 lines · Thomas Petazzoni
Hello,
Quoted 5 lines · Peter Seiderer
Fixes [1]:
../3rdparty/double-conversion/include/double-conversion/utils.h:81:2: error: #error Target architecture was not detected as supported by Double-Conversion. #error Target architecture was not detected as supported by Double-Conversion.
Quoted 7 lines
Quoted 3 lines
[1] http://autobuild.buildroot.net/results/489/4891d96f45c64c2e66fe819bd4175cc1d6243a93
Signed-off-by Peter Seiderer <[email protected]>Thanks for working on this again. Can you submit your or1k and microblaze changes back to the upstream double-conversion project (and perhaps also Qt5) ?
Upstream done already, see https://github.com/google/double-conversion/issues/73
For Qt5 I would hope for an double-conversion update (or porting back the future double-conversion upstream patch)...
Quoted 18 lines
Quoted 4 lines
For microblazeel (using
qemu_microblazeel_mmu_defconfigchanged to musl because the original uclibc resulted in 'mmap of a spare page failed!' error message):This uClibc issue is something for Waldemar. I'm personally still a bit impressed by the magic of qemu user mode emulation.
Quoted 9 lines
$ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -c main.c $ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -c div.c $ ./build_qemu_microblazeel_001/host/bin/microblazeel-buildroot-linux-musl-gcc -o main main.o div.oFix wrong staging absolute soft link to relative:
$ ls -l build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1 ../staging/lib/ld-musl-microblazeel.so.1 -> /lib/libc.so $ rm build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1 $ ln -s libc.so build_qemu_microblazeel_001/staging/lib/ld-musl-microblazeel.so.1
Quoted 6 lines
That's weird, I have a musl toolchain here (installed from an external toolchain), and its symlink is relative:
$ ls -l output/staging/lib/{ld-musl*,libc.so} lrwxrwxrwx 1 thomas thomas 14 Aug 21 22:14 output/staging/lib/ld-musl-armhf.so.1 -> ../lib/libc.so -rwxr-xr-x 1 thomas thomas 740772 Jun 26 00:08 output/staging/lib/libc.so
Double checked here (on buildroot git master b1db9038ddaf89c4abf69e17993eb13646da7e8d) on 'openSUSE Tumbleweed-20180808':
$ make clean $ make savedefconfig $ cat defconfig BR2_microblazeel=y BR2_TOOLCHAIN_BUILDROOT_MUSL=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y BR2_TARGET_GENERIC_GETTY_PORT="ttyUL0" BR2_SYSTEM_DHCP="eth0" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7" BR2_LINUX_KERNEL_PATCH="board/qemu/microblazeel-mmu/xilinx-xemaclite.patch" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/microblazeel-mmu/linux.config" BR2_LINUX_KERNEL_LINUX_BIN=y BR2_TARGET_ROOTFS_INITRAMFS=y # BR2_TARGET_ROOTFS_TAR is not set
$ make
$ ls -l staging/lib/{ld-musl*,libc.so}
lrwxrwxrwx 1 seiderer users 12 21. Aug 22:36 staging/lib/ld-musl-microblazeel.so.1 -> /lib/libc.so
-rwxr-xr-x 1 seiderer users 1096148 21. Aug 22:36 staging/lib/libc.soRegards,
Peter
Quoted 4 lines
Applied to master. Thanks!
Thomas