Skip to contentSkip to conversation

package/xxhash: fix rebuild without MOREFLAGS on install

PATCH New Yegor Yefremov 1 participant 1 message Oct 26

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/xxhash: fix rebuild without MOREFLAGS on install

Since version 0.8.4, xxhash builds its objects through build/make/multiconf.make, which stores them in a cachedObjs/<hash>/ directory whose name is a hash of the build flags. The install targets (install_xxhsum, install_libxxhash, ...) depend on the build targets, but our install commands do not pass MOREFLAGS=-DXXH_NO_INLINE_HINTS. The flags hash therefore differs, and everything is rebuilt during the install step, this time without XXH_NO_INLINE_HINTS. With BR2_OPTIMIZE_G, this brings back the build failure that XXH_NO_INLINE_HINTS was added for:

CC cachedObjs/e3e28741522760388e82966410d67005/xxhash.o
In file included from xxhash.c:42:
xxhash.h:4970:1: error: inlining failed in call to 'always_inline' 'XXH3_accumulate_scalar': function not considered for inlining

Fix this by passing the same make options (PREFIX and MOREFLAGS) to the build and install steps, so the install step reuses the objects built earlier instead of rebuilding them.

This issue has been present since commit 4b9c0915bf29 ("package/xxhash:
bump version to 0.8.4"), as 0.8.4 is the first version to use multiconf.make. With 0.8.3, xxhash.o was a plain target that was already up to date at install time. No release is affected yet, and the maintenance branches still have 0.8.3.

Fixes:
https://autobuild.buildroot.org/results/2174b7fa4ea6587666acdfd940ef4a9cd1cb311d

Fixes 4b9c0915bf293d96bc469986e83d911b9b8c9087 ("package/xxhash: bump version to 0.8.4")
Assisted-by Claude:claude-opus-5-5
---
 package/xxhash/xxhash.mk | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
package/xxhash/xxhash.mk +8 -3
index 80bb81dbf7..2d991d48b9 100644
@@ -29,19 +29,24 @@ XXHASH_TARGETS += libxxhash
 XXHASH_INSTALL_TARGETS += install_libxxhash
 endif
 
+# The install targets depend on the build targets, and objects are
+# cached in a directory named after the build flags, so the same flags
+# must be passed at install time to avoid a rebuild.
+XXHASH_MAKE_OPTS = PREFIX=/usr MOREFLAGS=-DXXH_NO_INLINE_HINTS
+
 define XXHASH_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		PREFIX=/usr MOREFLAGS=-DXXH_NO_INLINE_HINTS $(XXHASH_TARGETS)
+		$(XXHASH_MAKE_OPTS) $(XXHASH_TARGETS)
 endef
 
 define XXHASH_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		PREFIX=/usr DESTDIR=$(STAGING_DIR) $(XXHASH_INSTALL_TARGETS)
+		$(XXHASH_MAKE_OPTS) DESTDIR=$(STAGING_DIR) $(XXHASH_INSTALL_TARGETS)
 endef
 
 define XXHASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		PREFIX=/usr DESTDIR=$(TARGET_DIR) $(XXHASH_INSTALL_TARGETS)
+		$(XXHASH_MAKE_OPTS) DESTDIR=$(TARGET_DIR) $(XXHASH_INSTALL_TARGETS)
 endef
 
 # we are a ccache dependency, so we can't use ccache
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot