From 23b3a1c0988220cce3d6ce2cea2e18ceeb424c8c Mon Sep 17 00:00:00 2001 From: jmcneill Date: Mon, 18 Sep 2017 23:07:49 +0000 Subject: [PATCH] u-boot: fix build on macos --- sysutils/u-boot/distinfo | 6 +++-- sysutils/u-boot/patches/patch-Kconfig | 10 +++++++ sysutils/u-boot/patches/patch-lib_bch.c | 28 ++++++++++++++++++-- sysutils/u-boot/patches/patch-tools_Makefile | 13 +++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 sysutils/u-boot/patches/patch-Kconfig create mode 100644 sysutils/u-boot/patches/patch-tools_Makefile diff --git a/sysutils/u-boot/distinfo b/sysutils/u-boot/distinfo index 2b35518d3e21..6e5d7a9311d1 100644 --- a/sysutils/u-boot/distinfo +++ b/sysutils/u-boot/distinfo @@ -1,10 +1,12 @@ -$NetBSD: distinfo,v 1.4 2017/09/09 23:21:29 jmcneill Exp $ +$NetBSD: distinfo,v 1.5 2017/09/18 23:07:49 jmcneill Exp $ SHA1 (u-boot-2017.07.tar.bz2) = 517c33f41e2969f3b5b88e9ae3c042acfe1bde05 RMD160 (u-boot-2017.07.tar.bz2) = b0d83a55b6daabdec28d85fdfb814a529c8d5eb9 SHA512 (u-boot-2017.07.tar.bz2) = 821175dd414e1fd0e5b6d9293a5766cbc8ae63a2361e82309f67e92c02b881263a7832dba0bcfc820b036a582981ddc20a8f484f2995d110f3240907a3ff7a95 Size (u-boot-2017.07.tar.bz2) = 11282262 bytes +SHA1 (patch-Kconfig) = 7e572929f220af5af6e709fc9493d0aa17bfbea1 SHA1 (patch-arch_arm_cpu_armv8_Kconfig) = 63cbbf2e3cebd46793fc03cc8e62297f6dc01aa9 SHA1 (patch-drivers_video_sunxi_sunxi__de2.c) = 0e1ff9965703ef18c5e6a54a858217ad99617ea6 SHA1 (patch-include_configs_sunxi-common.h) = b71c28480cc084860d63e95af33bc7eead8ac6ac -SHA1 (patch-lib_bch.c) = e346680a94696713f6d0e71e965283b9bdfbbdbf +SHA1 (patch-lib_bch.c) = 2e20f6d65a736b474859ef3ee840aae05452c6f4 +SHA1 (patch-tools_Makefile) = adc5082d369363113135d5c892822b57ee80ff19 diff --git a/sysutils/u-boot/patches/patch-Kconfig b/sysutils/u-boot/patches/patch-Kconfig new file mode 100644 index 000000000000..a66c36161df6 --- /dev/null +++ b/sysutils/u-boot/patches/patch-Kconfig @@ -0,0 +1,10 @@ +$NetBSD: patch-Kconfig,v 1.1 2017/09/18 23:07:49 jmcneill Exp $ + +--- Kconfig.orig 2017-07-10 17:07:38.000000000 +0000 ++++ Kconfig +@@ -367,5 +367,3 @@ source "fs/Kconfig" + source "lib/Kconfig" + + source "test/Kconfig" +- +-source "scripts/Kconfig" diff --git a/sysutils/u-boot/patches/patch-lib_bch.c b/sysutils/u-boot/patches/patch-lib_bch.c index 4b3af52bb76e..6ef08b682bfe 100644 --- a/sysutils/u-boot/patches/patch-lib_bch.c +++ b/sysutils/u-boot/patches/patch-lib_bch.c @@ -1,13 +1,37 @@ -$NetBSD: patch-lib_bch.c,v 1.1 2017/08/12 16:44:33 jmcneill Exp $ +$NetBSD: patch-lib_bch.c,v 1.2 2017/09/18 23:07:49 jmcneill Exp $ --- lib/bch.c.orig 2017-07-10 17:07:38.000000000 +0000 +++ lib/bch.c -@@ -61,7 +61,7 @@ +@@ -61,8 +61,10 @@ #include #else #include -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) #include ++#elif defined(__APPLE__) ++#include #else #include + #endif +@@ -71,7 +73,11 @@ + #include + + #undef cpu_to_be32 ++#if defined(__APPLE__) ++#define cpu_to_be32 htonl ++#else + #define cpu_to_be32 htobe32 ++#endif + #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) + #define kmalloc(size, flags) malloc(size) + #define kzalloc(size, flags) calloc(1, size) +@@ -117,7 +123,7 @@ struct gf_poly_deg1 { + }; + + #ifdef USE_HOSTCC +-#ifndef __BSD_VISIBLE ++#if !defined(__BSD_VISIBLE) && !defined(__APPLE__) + static int fls(int x) + { + int r = 32; diff --git a/sysutils/u-boot/patches/patch-tools_Makefile b/sysutils/u-boot/patches/patch-tools_Makefile new file mode 100644 index 000000000000..f25887211fc9 --- /dev/null +++ b/sysutils/u-boot/patches/patch-tools_Makefile @@ -0,0 +1,13 @@ +$NetBSD: patch-tools_Makefile,v 1.1 2017/09/18 23:07:49 jmcneill Exp $ + +--- tools/Makefile.orig 2017-07-10 17:07:38.000000000 +0000 ++++ tools/Makefile +@@ -69,7 +69,7 @@ LIBFDT_CSRCS := fdt.c fdt_ro.c fdt_wip.c + # Fatal error: can't create build/temp.linux-x86_64-2.7/../lib/libfdt/fdt.o: + # No such file or directory + # To fix this, use an absolute path. +-libfdt_tree := $(shell readlink -f $(srctree)/lib/libfdt) ++libfdt_tree := $(realpath $(srctree)/lib/libfdt) + + LIBFDT_SRCS := $(addprefix $(libfdt_tree)/, $(LIBFDT_CSRCS)) + LIBFDT_SWIG := $(addprefix $(libfdt_tree)/, pylibfdt/libfdt.i)