toolchain: mold: add PKG_NAME to Makefile
authorWeijie Gao <hackpascal@gmail.com>
Tue, 22 Apr 2025 18:15:09 +0000 (02:15 +0800)
committerRobert Marko <robimarko@gmail.com>
Wed, 23 Apr 2025 10:19:26 +0000 (12:19 +0200)
In include/host-build.mk, HOST_BUILD_DIR is set by default value:
HOST_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)

However the mold package has no PKG_NAME set at all. This means the
HOST_BUILD_DIR is identical to $(BUILD_DIR_HOST).

In the Host/Prepare stage, by default, the $(HOST_BUILD_DIR) will be
deleted at first unconditionally. Since HOST_BUILD_DIR is identical
to $(BUILD_DIR_HOST), the entire build_dir/toolchain-* directory will
be removed and this will cause build failure.

Adding PKG_NAME:=ld.mold can solve this issue.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18567
Signed-off-by: Robert Marko <robimarko@gmail.com>
toolchain/mold/Makefile

index a2acba89d3c808db3d2cd03c801dbc1ad253af03..60361841aaaf64950a66d18398345724fc1b8852 100644 (file)
@@ -3,6 +3,9 @@
 # See /LICENSE for more information.
 #
 include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ld.mold
+
 include $(INCLUDE_DIR)/toolchain-build.mk
 
 define Host/Configure