]> git.99rst.org Git - openwrt-packages.git/commitdiff
udpspeeder: build with the toolchain CXX and flags
authorDavid Connolly <redacted>
Sun, 5 Jul 2026 20:44:44 +0000 (21:44 +0100)
committerJosef Schlehofer <redacted>
Sat, 18 Jul 2026 06:11:19 +0000 (08:11 +0200)
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 <redacted>
net/udpspeeder/Makefile
net/udpspeeder/patches/010-build-with-toolchain-flags.patch [new file with mode: 0644]

index 8c079ec6b179537334a6d22a73da9cbeca6af290..4f6428aa3241f07d2c55db0b239856355ef635ee 100644 (file)
@@ -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 <nishant@hopbox.in>, Toni Uhlig <matzeton@googlemail.com>
 
 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 (file)
index 0000000..612b9eb
--- /dev/null
@@ -0,0 +1,35 @@
+From 7597b341540c10285a52f1917192bda580da051b Mon Sep 17 00:00:00 2001
+From: David Connolly <david@connol.ly>
+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 <david@connol.ly>
+---
+ 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
git clone https://git.99rst.org/PROJECT