changeset 1186:2fafcd07edb0

core/busybox: fix crash under LLVM 9
author David Demelier <markand@malikania.fr>
date Mon, 28 Oct 2019 20:35:00 +0100
parents 6ac8b545df56
children db0bc153b099
files core/busybox/busybox.sh
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core/busybox/busybox.sh	Mon Oct 28 20:05:00 2019 +0100
+++ b/core/busybox/busybox.sh	Mon Oct 28 20:35:00 2019 +0100
@@ -86,26 +86,36 @@
 		fi
 	fi
 
+	#
 	# Our start script is located in /etc/rc.init.
 	# Upstream: rejected a tunable option.
+	#
 	sed -i -e 's|/etc/init.d/rcS|/etc/rc.init|' init/init.c
 
+	#
 	# Change the redirection limit which is too small for vpk download.
 	# Upstream: yes in Git.
+	#
 	sed -i -e "/redir_limit = 5/ s/5/16/" networking/wget.c
 
 	#
+	# TODO: this is temporary, to build under clang.
+	#
 	# CFLAGS="": fix build under clang by removing all non-standard
 	# options.
 	#
+	# -O0: disable optimizations for the same reasons.
+	#
+	# See http://lists.busybox.net/pipermail/busybox/2019-October/087558.html
+	#
 	make \
 		AR="$AR" \
 		AS="$AS" \
 		CC="$CC" \
-		CFLAGS="" \
+		CFLAGS="-DBB_GLOBAL_CONST=''" \
 		HOSTCC="$CC" \
 		HOSTCFLAGS="" \
-		EXTRA_CFLAGS="$CFLAGS" \
+		EXTRA_CFLAGS="$CFLAGS -O0" \
 		EXTRA_LDFLAGS="$LDFLAGS" \
 		NM="$NM" \
 		OBJCOPY="$OBJCOPY" \