Created
September 13, 2019 11:55
-
-
Save eblot/cdb69ef5fe74385ea0567c3b602b9151 to your computer and use it in GitHub Desktop.
Patch to enable buildroot build from Alpine Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/board/beaglebone/hotspot_buildroot.config b/board/beaglebone/hotspot_buildroot.config | |
index 0c48f190de..56a7fa82c0 100644 | |
--- a/board/beaglebone/hotspot_buildroot.config | |
+++ b/board/beaglebone/hotspot_buildroot.config | |
@@ -11,6 +11,7 @@ BR2_HOST_GCC_AT_LEAST_4_9=y | |
BR2_HOST_GCC_AT_LEAST_5=y | |
BR2_HOST_GCC_AT_LEAST_6=y | |
BR2_HOST_GCC_AT_LEAST_7=y | |
+BR2_HOST_GCC_AT_LEAST_8=y | |
# | |
# Target options | |
@@ -249,10 +250,9 @@ BR2_TOOLCHAIN_BUILDROOT_LIBC="musl" | |
# BR2_KERNEL_HEADERS_5_1 is not set | |
# BR2_KERNEL_HEADERS_5_2 is not set | |
# BR2_KERNEL_HEADERS_VERSION is not set | |
-# BR2_KERNEL_HEADERS_CUSTOM_TARBALL is not set | |
-BR2_KERNEL_HEADERS_CUSTOM_GIT=y | |
-BR2_KERNEL_HEADERS_CUSTOM_REPO_URL="https://github.com/beagleboard/linux" | |
-BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION="4.19.59-ti-r26" | |
+BR2_KERNEL_HEADERS_CUSTOM_TARBALL=y | |
+# BR2_KERNEL_HEADERS_CUSTOM_GIT is not set | |
+BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION="https://github.com/beagleboard/linux/archive/4.19.59-ti-r26.tar.gz" | |
# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_2 is not set | |
# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_1 is not set | |
# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_0 is not set | |
@@ -298,7 +298,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y | |
# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_1 is not set | |
# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_0 is not set | |
# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_REALLY_OLD is not set | |
-BR2_DEFAULT_KERNEL_HEADERS="4.19.59-ti-r26" | |
+BR2_DEFAULT_KERNEL_HEADERS="custom" | |
BR2_PACKAGE_LINUX_HEADERS=y | |
BR2_PACKAGE_MUSL=y | |
@@ -481,13 +481,12 @@ BR2_LINUX_KERNEL=y | |
# BR2_LINUX_KERNEL_LATEST_VERSION is not set | |
# BR2_LINUX_KERNEL_LATEST_CIP_VERSION is not set | |
# BR2_LINUX_KERNEL_CUSTOM_VERSION is not set | |
-# BR2_LINUX_KERNEL_CUSTOM_TARBALL is not set | |
-BR2_LINUX_KERNEL_CUSTOM_GIT=y | |
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y | |
+# BR2_LINUX_KERNEL_CUSTOM_GIT is not set | |
# BR2_LINUX_KERNEL_CUSTOM_HG is not set | |
# BR2_LINUX_KERNEL_CUSTOM_SVN is not set | |
-BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/beagleboard/linux" | |
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="4.19.59-ti-r26" | |
-BR2_LINUX_KERNEL_VERSION="4.19.59-ti-r26" | |
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/beagleboard/linux/archive/4.19.59-ti-r26.tar.gz" | |
+BR2_LINUX_KERNEL_VERSION="custom" | |
BR2_LINUX_KERNEL_PATCH="" | |
# BR2_LINUX_KERNEL_USE_DEFCONFIG is not set | |
# BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG is not set | |
@@ -3022,7 +3021,7 @@ BR2_TARGET_UBOOT_VERSION="2019.07" | |
BR2_TARGET_UBOOT_PATCH="" | |
BR2_TARGET_UBOOT_USE_DEFCONFIG=y | |
# BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG is not set | |
-BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_boneblack" | |
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_boneblack_vboot" | |
BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="" | |
# BR2_TARGET_UBOOT_NEEDS_DTC is not set | |
# BR2_TARGET_UBOOT_NEEDS_PYLIBFDT is not set | |
diff --git a/package/fakeroot/0003-no64.patch b/package/fakeroot/0003-no64.patch | |
new file mode 100644 | |
index 0000000000..ff95f96a9b | |
--- /dev/null | |
+++ b/package/fakeroot/0003-no64.patch | |
@@ -0,0 +1,17 @@ | |
+--- a/libfakeroot.c | |
++++ b/libfakeroot.c | |
+@@ -81,12 +81,14 @@ | |
+ #define SEND_STAT64(a,b,c) send_stat64(a,b,c) | |
+ #define SEND_GET_STAT(a,b) send_get_stat(a,b) | |
+ #define SEND_GET_STAT64(a,b) send_get_stat64(a,b) | |
++#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c) | |
+ #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c) | |
+ #else | |
+ #define SEND_STAT(a,b,c) send_stat(a,b) | |
+ #define SEND_STAT64(a,b,c) send_stat64(a,b) | |
+ #define SEND_GET_STAT(a,b) send_get_stat(a) | |
+ #define SEND_GET_STAT64(a,b) send_get_stat64(a) | |
++#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b) | |
+ #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) | |
+ #endif | |
+ | |
diff --git a/package/fakeroot/0004-stdint.patch b/package/fakeroot/0004-stdint.patch | |
new file mode 100644 | |
index 0000000000..bb4f67f0d0 | |
--- /dev/null | |
+++ b/package/fakeroot/0004-stdint.patch | |
@@ -0,0 +1,34 @@ | |
+--- fakeroot-1.18.2.orig/faked.c | |
++++ fakeroot-1.18.2/faked.c | |
+@@ -514,11 +514,11 @@ | |
+ | |
+ #ifdef FAKEROOT_DB_PATH | |
+ if (find_path(i->buf.dev, i->buf.ino, roots, path)) | |
+- fprintf(f,"mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu %s\n", | |
++ fprintf(f,"mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" %s\n", | |
+ (uint64_t) i->buf.mode,(uint64_t) i->buf.uid,(uint64_t) i->buf.gid, | |
+ (uint64_t) i->buf.nlink,(uint64_t) i->buf.rdev,path); | |
+ #else | |
+- fprintf(f,"dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n", | |
++ fprintf(f,"dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n", | |
+ (uint64_t) i->buf.dev,(uint64_t) i->buf.ino,(uint64_t) i->buf.mode, | |
+ (uint64_t) i->buf.uid,(uint64_t) i->buf.gid,(uint64_t) i->buf.nlink, | |
+ (uint64_t) i->buf.rdev); | |
+@@ -544,7 +544,7 @@ | |
+ | |
+ while(1){ | |
+ #ifdef FAKEROOT_DB_PATH | |
+- r=scanf("mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu "DB_PATH_SCAN"\n", | |
++ r=scanf("mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" "DB_PATH_SCAN"\n", | |
+ &stmode, &stuid, &stgid, &stnlink, &strdev, &path); | |
+ if (r != 6) | |
+ break; | |
+@@ -559,7 +559,7 @@ | |
+ stdev = path_st.st_dev; | |
+ stino = path_st.st_ino; | |
+ #else | |
+- r=scanf("dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n", | |
++ r=scanf("dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n", | |
+ &stdev, &stino, &stmode, &stuid, &stgid, &stnlink, &strdev); | |
+ if (r != 7) | |
+ break; | |
diff --git a/package/fakeroot/0005-no-ldlibrarypath.patch b/package/fakeroot/0005-no-ldlibrarypath.patch | |
new file mode 100644 | |
index 0000000000..e7b9a037d0 | |
--- /dev/null | |
+++ b/package/fakeroot/0005-no-ldlibrarypath.patch | |
@@ -0,0 +1,80 @@ | |
+diff -ru fakeroot-1.20.2.orig/scripts/fakeroot.in fakeroot-1.20.2/scripts/fakeroot.in | |
+--- fakeroot-1.20.2.orig/scripts/fakeroot.in 2015-11-12 10:51:23.241681379 +0200 | |
++++ fakeroot-1.20.2/scripts/fakeroot.in 2015-11-12 10:56:53.331985288 +0200 | |
+@@ -34,8 +34,7 @@ | |
+ FAKEROOT_BINDIR=@bindir@ | |
+ | |
+ USEABSLIBPATH=@LDPRELOADABS@ | |
+-LIB=lib@fakeroot_transformed@@DLSUFFIX@ | |
+-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot | |
++LIB=@libdir@/lib@fakeroot_transformed@@DLSUFFIX@ | |
+ FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ | |
+ | |
+ FAKED_MODE="unknown-is-root" | |
+@@ -68,7 +67,6 @@ | |
+ -l|--lib) | |
+ shift | |
+ LIB=`eval echo "$1"` | |
+- PATHS= | |
+ ;; | |
+ -f|--faked) | |
+ shift | |
+@@ -111,23 +109,11 @@ | |
+ | |
+ # make sure the preload is available | |
+ ABSLIB="" | |
+-if [ -n "$PATHS" ] | |
+-then | |
+- for dir in `echo $PATHS | sed 's/:/ /g'` | |
+- do | |
+- if test -r "$dir/$LIB" | |
+- then | |
+- libfound=yes | |
+- ABSLIB="$dir/$LIB" | |
+- fi | |
+- done | |
+-else | |
+ if test -r "$LIB" | |
+ then | |
+ libfound=yes | |
+ ABSLIB="$LIB" | |
+ fi | |
+-fi | |
+ | |
+ if test $libfound = no | |
+ then | |
+@@ -148,7 +134,7 @@ | |
+ if [ "$WAITINTRAP" -eq 0 ]; then | |
+ trap "kill -s @signal@ $PID" EXIT INT | |
+ else | |
+- @MACOSX_FALSE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT | |
++ @MACOSX_FALSE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT | |
+ @MACOSX_TRUE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT | |
+ fi | |
+ | |
+@@ -159,10 +145,6 @@ | |
+ if test $USEABSLIBPATH -ne 0 ; then | |
+ LIB=$ABSLIB | |
+ fi | |
+-# Keep other library paths | |
+-if test -n "$@LDLIBPATHVAR@"; then | |
+- PATHS="$PATHS:$@LDLIBPATHVAR@" | |
+-fi | |
+ # ...and preloaded libs | |
+ if test -n "$@LDPRELOADVAR@"; then | |
+ LIB="$LIB:$@LDPRELOADVAR@" | |
+@@ -171,11 +153,11 @@ | |
+ export FAKEROOT_FD_BASE | |
+ | |
+ if test -z "$*"; then | |
+- @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh} | |
++ @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh} | |
+ @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh} | |
+ RESULT=$? | |
+ else | |
+- @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" "$@" | |
++ @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" "$@" | |
+ @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" "$@" | |
+ RESULT=$? | |
+ fi | |
+ | |
diff --git a/package/fakeroot/0006-xstatjunk.patch b/package/fakeroot/0006-xstatjunk.patch | |
new file mode 100644 | |
index 0000000000..12f2759b48 | |
--- /dev/null | |
+++ b/package/fakeroot/0006-xstatjunk.patch | |
@@ -0,0 +1,11 @@ | |
+--- fakeroot-1.18.4.orig/configure.ac 2012-06-02 18:23:41.000000000 +0000 | |
++++ fakeroot-1.18.4configure.ac 2015-09-24 23:15:56.917470073 +0000 | |
+@@ -301,7 +301,7 @@ | |
+ FUNC=`echo $SEARCH|sed -e 's/.*%//'` | |
+ PRE=`echo $SEARCH|sed -e 's/%.*//'` | |
+ FOUND= | |
+- for WRAPPED in __${PRE}x${FUNC} _${PRE}x${FUNC} __${PRE}${FUNC}13 ${PRE}${FUNC}; do | |
++ for WRAPPED in ${PRE}${FUNC}; do | |
+ AC_CHECK_FUNCS($WRAPPED,FOUND=$WRAPPED) | |
+ dnl | |
+ dnl to unconditionally define only the _* functions, comment out the 2 lines above, | |
diff --git a/package/fakeroot/fakeroot.mk b/package/fakeroot/fakeroot.mk | |
index 4aa27a1b0c..15a07f58c2 100644 | |
--- a/package/fakeroot/fakeroot.mk | |
+++ b/package/fakeroot/fakeroot.mk | |
@@ -16,6 +16,8 @@ HOST_FAKEROOT_CONF_ENV = \ | |
ac_cv_header_sys_capability_h=no \ | |
ac_cv_func_capset=no | |
+HOST_FAKEROOT_CONF_ENV += CFLAGS="$(HOST_CFLAGS) -D_STAT_VER=0" | |
+ | |
FAKEROOT_LICENSE = GPL-3.0+ | |
FAKEROOT_LICENSE_FILES = COPYING | |
diff --git a/package/ninja/001-nanotime.patch b/package/ninja/001-nanotime.patch | |
new file mode 100644 | |
index 0000000000..56459c3218 | |
--- /dev/null | |
+++ b/package/ninja/001-nanotime.patch | |
@@ -0,0 +1,40 @@ | |
+2ff54ad7478a90bd75c91e434236a Mon Sep 17 00:00:00 2001 | |
+From: makepost <makepost@firemail.cc> | |
+Date: Mon, 24 Dec 2018 03:13:16 +0200 | |
+Subject: [PATCH] Use st_mtim if st_mtime is macro, fix #1510 | |
+ | |
+In POSIX.1-2008, sys_stat has a st_mtim member and a st_mtime backward | |
+compatibility macro. Should help avoid hardcoding platform detection. | |
+--- | |
+ src/disk_interface.cc | 14 ++++---------- | |
+ 1 file changed, 4 insertions(+), 10 deletions(-) | |
+ | |
+diff --git a/src/disk_interface.cc b/src/disk_interface.cc | |
+index d4c2fb087..dc297c449 100644 | |
+--- src/disk_interface.cc | |
++++ /src/disk_interface.cc | |
+@@ -202,19 +202,13 @@ TimeStamp RealDiskInterface::Stat(const string& path, string* err) const { | |
+ // that it doesn't exist. | |
+ if (st.st_mtime == 0) | |
+ return 1; | |
+-#if defined(__APPLE__) && !defined(_POSIX_C_SOURCE) | |
++#if defined(_AIX) | |
++ return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n; | |
++#elif defined(__APPLE__) | |
+ return ((int64_t)st.st_mtimespec.tv_sec * 1000000000LL + | |
+ st.st_mtimespec.tv_nsec); | |
+-#elif (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700 || defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \ | |
+- defined(__BIONIC__) || (defined (__SVR4) && defined (__sun)) || defined(__FreeBSD__)) | |
+- // For glibc, see "Timestamp files" in the Notes of http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html | |
+- // newlib, uClibc and musl follow the kernel (or Cygwin) headers and define the right macro values above. | |
+- // For bsd, see https://github.com/freebsd/freebsd/blob/master/sys/sys/stat.h and similar | |
+- // For bionic, C and POSIX API is always enabled. | |
+- // For solaris, see https://docs.oracle.com/cd/E88353_01/html/E37841/stat-2.html. | |
++#elif defined(st_mtime) // A macro, so we're likely on modern POSIX. | |
+ return (int64_t)st.st_mtim.tv_sec * 1000000000LL + st.st_mtim.tv_nsec; | |
+-#elif defined(_AIX) | |
+- return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n; | |
+ #else | |
+ return (int64_t)st.st_mtime * 1000000000LL + st.st_mtimensec; | |
+ #endif | |
+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment