From c489780d477d606795df12bdbfc8ed88ba939ea5 Mon Sep 17 00:00:00 2001 From: cronyx Date: Mon, 9 Jan 2023 18:47:26 +0300 Subject: [PATCH] fix zerotier-one build if eabihf is selected --- .../configs/v83x_ultimate_defconfig | 2 +- ...01-makefile.patch => 00000-makefile.patch} | 34 +++++++++++-------- general/package/zerotier-one/zerotier-one.mk | 3 +- 3 files changed, 23 insertions(+), 16 deletions(-) rename general/package/zerotier-one/{0001-makefile.patch => 00000-makefile.patch} (76%) diff --git a/br-ext-chip-allwinner/configs/v83x_ultimate_defconfig b/br-ext-chip-allwinner/configs/v83x_ultimate_defconfig index a4bca3a3..734f4067 100644 --- a/br-ext-chip-allwinner/configs/v83x_ultimate_defconfig +++ b/br-ext-chip-allwinner/configs/v83x_ultimate_defconfig @@ -109,7 +109,7 @@ BR2_PACKAGE_HOST_GDB=y BR2_PACKAGE_GDB=y # ZEROTIER -BR2_PACKAGE_ZEROTIER_ONE is not set +BR2_PACKAGE_ZEROTIER_ONE=y BR2_PACKAGE_ZLIB=y diff --git a/general/package/zerotier-one/0001-makefile.patch b/general/package/zerotier-one/00000-makefile.patch similarity index 76% rename from general/package/zerotier-one/0001-makefile.patch rename to general/package/zerotier-one/00000-makefile.patch index 2a064112..fe47141f 100644 --- a/general/package/zerotier-one/0001-makefile.patch +++ b/general/package/zerotier-one/00000-makefile.patch @@ -1,8 +1,6 @@ -diff --git a/make-linux.mk b/make-linux.mk -index 3941573c..d7905cb1 100644 ---- a/make-linux.mk -+++ b/make-linux.mk -@@ -25,7 +25,7 @@ TIMESTAMP=$(shell date +"%Y%m%d%H%M") +--- a/make-linux.mk 2022-11-01 23:08:52.000000000 +0300 ++++ b/make-linux.mk 2023-01-09 17:05:18.481511855 +0300 +@@ -25,7 +25,7 @@ # otherwise build into binary as done on Mac and Windows. ONE_OBJS+=osdep/PortMapper.o override DEFS+=-DZT_USE_MINIUPNPC @@ -11,7 +9,7 @@ index 3941573c..d7905cb1 100644 #MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1) ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1) override DEFS+=-DZT_USE_SYSTEM_MINIUPNPC -@@ -34,7 +34,7 @@ else +@@ -34,7 +34,7 @@ override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING="\"Linux\"" -DMINIUPNPC_VERSION_STRING="\"2.0\"" -DUPNP_VERSION_STRING="\"UPnP/1.1\"" -DENABLE_STRNATPMPERR ONE_OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o endif @@ -20,7 +18,7 @@ index 3941573c..d7905cb1 100644 ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o else LDLIBS+=-lnatpmp -@@ -66,11 +66,11 @@ ifeq ($(ZT_DEBUG),1) +@@ -66,11 +66,11 @@ # C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box! node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g -pthread $(INCLUDES) $(DEFS) else @@ -35,7 +33,7 @@ index 3941573c..d7905cb1 100644 RUSTFLAGS=--release endif -@@ -291,7 +291,7 @@ override DEFS+=-D_MT_ALLOCATOR_H -D_POOL_ALLOCATOR_H -D_EXTPTR_ALLOCATOR_H -D_DE +@@ -291,7 +291,7 @@ # Static builds, which are currently done for a number of Linux targets ifeq ($(ZT_STATIC),1) @@ -44,18 +42,26 @@ index 3941573c..d7905cb1 100644 endif # For building an official semi-static binary on CentOS 7 -@@ -314,8 +314,8 @@ ifeq ($(ZT_ARCHITECTURE),3) - override CXXFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm +@@ -309,13 +309,13 @@ + + # ARM32 hell -- use conservative CFLAGS + ifeq ($(ZT_ARCHITECTURE),3) +- ifeq ($(shell if [ -e /usr/bin/dpkg ]; then dpkg --print-architecture; fi),armel) +- override CFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm +- override CXXFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm ++ ifeq ($(FLOATABI),hard) ++ override CFLAGS+=-mfloat-abi=hard -mfpu=vfp -marm -mno-unaligned-access ++ override CXXFLAGS+=-mfloat-abi=hard -mfpu=vfp -marm -fexceptions -mno-unaligned-access ZT_USE_ARM32_NEON_ASM_CRYPTO=0 else - override CFLAGS+=-mfloat-abi=hard -march=armv6zk -marm -mfpu=vfp -mno-unaligned-access -mtp=cp15 -mcpu=arm1176jzf-s - override CXXFLAGS+=-mfloat-abi=hard -march=armv6zk -marm -mfpu=vfp -fexceptions -mno-unaligned-access -mtp=cp15 -mcpu=arm1176jzf-s -+ override CFLAGS+=-mfloat-abi=soft -marm -mno-unaligned-access -+ override CXXFLAGS+=-mfloat-abi=soft -marm -fexceptions -mno-unaligned-access ++ override CFLAGS+=-mfloat-abi=soft -marm -mno-unaligned-access ++ override CXXFLAGS+=-mfloat-abi=soft -marm -fexceptions -mno-unaligned-access ZT_USE_ARM32_NEON_ASM_CRYPTO=0 endif endif -@@ -335,8 +335,8 @@ ifeq ($(ZT_USE_ARM32_NEON_ASM_CRYPTO),1) +@@ -335,8 +335,8 @@ endif # Position Independence @@ -66,7 +72,7 @@ index 3941573c..d7905cb1 100644 .PHONY: all all: one -@@ -360,7 +360,7 @@ zerotier-cli: zerotier-one +@@ -360,7 +360,7 @@ $(ONE_OBJS): zeroidc libzerotiercore.a: FORCE diff --git a/general/package/zerotier-one/zerotier-one.mk b/general/package/zerotier-one/zerotier-one.mk index 8ee6c2eb..c81dd5ae 100644 --- a/general/package/zerotier-one/zerotier-one.mk +++ b/general/package/zerotier-one/zerotier-one.mk @@ -11,7 +11,8 @@ ZEROTIER_ONE_LICENSE_FILES = LICENSE.txt ZEROTIER_ONE_MAKE_OPTS = ZT_STATIC=1 ZT_SSO_SUPPORTED=0 \ CC="$(TARGET_CC)" \ - CXX="$(TARGET_CXX)" + CXX="$(TARGET_CXX)" \ + FLOATABI="$(BR2_GCC_TARGET_FLOAT_ABI)" ZEROTIER_ONE_DEPENDENCIES = \ libminiupnpc \