From 2bec39428d63168a43265bec8030e0bb1283ef0f Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Thu, 7 Jun 2018 22:56:34 +0200 Subject: [PATCH] busybox: Fix less and build with clang on arm Patch less in a similar manner as svlogd. --- packages/busybox/build-with-clang.patch | 22 ++++++++++++++++++++++ packages/busybox/build.sh | 3 --- packages/busybox/svlogd.c.patch | 12 ------------ 3 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 packages/busybox/build-with-clang.patch delete mode 100644 packages/busybox/svlogd.c.patch diff --git a/packages/busybox/build-with-clang.patch b/packages/busybox/build-with-clang.patch new file mode 100644 index 000000000..b875f3348 --- /dev/null +++ b/packages/busybox/build-with-clang.patch @@ -0,0 +1,22 @@ +svlogd, less (and others?) don't work with clang. +Patch inspired by http://landley.net/mantis/mantis-2344.html +--- ../svlogd.c.orig 2018-06-07 19:34:47.442867090 +0000 ++++ ./runit/svlogd.c 2018-06-07 19:35:16.438776951 +0000 +@@ -244,6 +244,7 @@ + #define INIT_G() do { \ + setup_common_bufsiz(); \ + SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ ++ asm volatile("":::"memory"); \ + linemax = 1000; \ + /*buflen = 1024;*/ \ + linecomplete = 1; \ +--- ../less.c.orig 2018-06-07 20:50:47.743373352 +0000 ++++ ./miscutils/less.c 2018-06-07 20:51:31.467242215 +0000 +@@ -253,6 +253,7 @@ + #define kbd_input (G.kbd_input ) + #define INIT_G() do { \ + SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ ++ asm volatile("":::"memory"); \ + less_gets_pos = -1; \ + empty_line_marker = "~"; \ + num_files = 1; \ diff --git a/packages/busybox/build.sh b/packages/busybox/build.sh index 9a5e1606f..9a2c446c0 100755 --- a/packages/busybox/build.sh +++ b/packages/busybox/build.sh @@ -6,9 +6,6 @@ TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=e3c14a3699dc7e82fed397392957afc78e37bdf25398ac38ead6e84621b2ae6a TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_BUILD_IN_SRC=yes -if [ $TERMUX_ARCH = arm ]; then - TERMUX_PKG_CLANG=no -fi # We replace env in the old coreutils package: TERMUX_PKG_CONFLICTS="coreutils (<< 8.25-4)" diff --git a/packages/busybox/svlogd.c.patch b/packages/busybox/svlogd.c.patch deleted file mode 100644 index dbb2caf93..000000000 --- a/packages/busybox/svlogd.c.patch +++ /dev/null @@ -1,12 +0,0 @@ -svlogd doesn't work with clang. -Patch inspired by http://landley.net/mantis/mantis-2344.html ---- ../svlogd.c.orig 2018-06-07 19:34:47.442867090 +0000 -+++ ./runit/svlogd.c 2018-06-07 19:35:16.438776951 +0000 -@@ -244,6 +244,7 @@ - #define INIT_G() do { \ - setup_common_bufsiz(); \ - SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ -+ asm volatile("":::"memory"); \ - linemax = 1000; \ - /*buflen = 1024;*/ \ - linecomplete = 1; \