From: David Connolly Date: Sun, 5 Jul 2026 20:44:44 +0000 (+0100) Subject: udpspeeder: build with the toolchain CXX and flags X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5b90fb99a09d5a3309ecf888a3f333283e581f3d;p=openwrt-packages.git udpspeeder: build with the toolchain CXX and flags Patch the upstream makefile to build the cross target with $(CXX) and the toolchain $(CXXFLAGS)/$(LDFLAGS), and take the version from an overridable variable. This replaces the Build/Prepare sed rewrites, and the binary now picks up the hardening flags. Honouring CXXFLAGS turns on -mips16 for the mips_24kc targets, where the C++ atomics compile to a sync instruction MIPS16 cannot encode, so build them with no-mips16. Signed-off-by: David Connolly --- diff --git a/net/udpspeeder/Makefile b/net/udpspeeder/Makefile index 8c079ec6b..4f6428aa3 100644 --- a/net/udpspeeder/Makefile +++ b/net/udpspeeder/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=UDPspeeder PKG_VERSION:=20230206.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=$(PKG_VERSION) @@ -21,29 +21,23 @@ PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Nishant Sharma , Toni Uhlig PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 include $(INCLUDE_DIR)/package.mk define Package/UDPspeeder - SECTION:=net - CATEGORY:=Network - TITLE:=UDP Network Speed-Up Tool - URL:=https://github.com/wangyu-/UDPspeeder - DEPENDS:= +libstdcpp +librt +libatomic + SECTION:=net + CATEGORY:=Network + TITLE:=UDP Network Speed-Up Tool + URL:=https://github.com/wangyu-/UDPspeeder + DEPENDS:=+libstdcpp +librt +libatomic endef define Package/UDPspeeder/description - A Tunnel which Improves your Network Quality on a High-latency Lossy Link by using Forward Error Correction,for All Traffics(TCP/UDP/ICMP) + A Tunnel which Improves your Network Quality on a High-latency Lossy Link by using Forward Error Correction,for All Traffics(TCP/UDP/ICMP) endef -MAKE_FLAGS += cross - -define Build/Prepare - $(Build/Prepare/Default) - sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile - sed -i '/\gitversion/d' $(PKG_BUILD_DIR)/makefile - echo 'const char * const gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h -endef +MAKE_FLAGS += cross gitversion="$(PKG_VERSION)" define Package/UDPspeeder/install $(INSTALL_DIR) $(1)/usr/bin diff --git a/net/udpspeeder/patches/010-build-with-toolchain-flags.patch b/net/udpspeeder/patches/010-build-with-toolchain-flags.patch new file mode 100644 index 000000000..612b9ebea --- /dev/null +++ b/net/udpspeeder/patches/010-build-with-toolchain-flags.patch @@ -0,0 +1,35 @@ +From 7597b341540c10285a52f1917192bda580da051b Mon Sep 17 00:00:00 2001 +From: David Connolly +Date: Sun, 5 Jul 2026 21:40:39 +0100 +Subject: [PATCH] build the cross target with the toolchain CXX and flags + +Build the cross target with $(CXX) and append $(CXXFLAGS)/$(LDFLAGS), so +the package builds with the OpenWrt toolchain and picks up its hardening +flags instead of a compiler path hardcoded to the author's machine. Read +gitversion from an overridable variable so the version can be injected via +make flags instead of rewriting the makefile. + +Signed-off-by: David Connolly +--- + makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/makefile ++++ b/makefile +@@ -51,7 +51,7 @@ cygwin:git_version + #targes for general cross compile + + cross:git_version +- ${cc_cross} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} -lrt -O2 ++ ${CXX} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} ${CXXFLAGS} ${LDFLAGS} -lrt -O2 + + cross2:git_version + ${cc_cross} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} -lrt -static -lgcc_eh -O2 +@@ -115,5 +115,6 @@ clean: + rm -f ${NAME} ${NAME}_cross ${NAME}.exe ${NAME}_wepoll.exe ${NAME}_mac + rm -f git_version.h + ++gitversion ?= $(shell git rev-parse HEAD 2>/dev/null) + git_version: +- echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > git_version.h ++ echo "const char *gitversion = \"$(gitversion)\";" > git_version.h