lantiq: keep build paths out of the TAPI and VMMC modules

configure.in of drv_tapi and drv_vmmc compiles the whole configure command
line into the module. drv_tapi_linux.c prints it through a proc file. The
command line holds the absolute paths of the build machine, among them
--enable-kernelbuild, --with-ifxos-incl, --enable-tapiincl, CPPFLAGS and
LDFLAGS, so the module depends on the directory it was built in.

Measured in the published snapshot modules of lantiq/xway: drv_tapi.ko and
drv_vmmc.ko both hold
--enable-kernelbuild=/builder/shared-workdir/build/build_dir/...
The existing 020-not-leak-cflags.patch covers the Kbuild CFLAGS, not this
string.

Drop every argument that holds a path and keep the feature flags. The loop
repeats the idiom the file already uses for CONFIGURE_OPTIONS.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin committed 2026-09-22 18:46:30 +02:00
1 parent fc166c4869
commit 661d6963df
4 files changed
+94 -2

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=drv_tapi
PKG_VERSION:=3.13.0
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_SOURCE:=drv_tapi-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@OPENWRT
@@ -0,0 +1,46 @@
From: John Crispin <john@phrozen.org>
Subject: [PATCH] keep build paths out of the configure string
configure.in compiles the whole configure command line into the module as
DRV_TAPI_CONFIGURE_STR, and drv_tapi_linux.c prints it through a proc
file. The command line holds the absolute paths of the build machine,
among them --enable-kernelbuild, --with-ifxos-incl, CPPFLAGS and LDFLAGS.
The module therefore depends on the directory it was built in, and two
builds in different directories produce different modules.
The published snapshot module of lantiq/xway holds, for example,
--enable-kernelbuild=/builder/shared-workdir/build/build_dir/...
Drop every argument that holds a path. The feature flags, which are the
part a reader of the proc file wants, stay. The loop repeats the idiom
that the file already uses for CONFIGURE_OPTIONS.
Signed-off-by: John Crispin <john@phrozen.org>
---
configure.in | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/configure.in
+++ b/configure.in
@@ -86,7 +86,20 @@ AH_BOTTOM([
#endif /* _DRV_CONFIG_H_ */
])
-AC_DEFINE_UNQUOTED([DRV_TAPI_CONFIGURE_STR], ["$ac_configure_args"], [configure options string])
+# The string below is printed through a proc file. An absolute path of the
+# build machine has no meaning on the target, and it makes the module depend
+# on the directory it was built in. Keep the arguments that hold no path.
+CONFIGURE_STR=''
+for c_arg in $ac_configure_args; do
+ case $c_arg in
+ *"/"*)
+ ;;
+ *)
+ CONFIGURE_STR="$CONFIGURE_STR $c_arg"
+ ;;
+ esac
+done
+AC_DEFINE_UNQUOTED([DRV_TAPI_CONFIGURE_STR], ["$CONFIGURE_STR"], [configure options string])
dnl enable linux kernel 2.6.x support (Make sure AC_PROG_CC is defined before to set $CC!)
AM_CONDITIONAL(KERNEL_2_6, false)
+1 -1
View File
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=drv_vmmc
PKG_VERSION:=1.9.0
PKG_RELEASE:=5
PKG_RELEASE:=6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_HASH:=707f515eb727c032418c4da67d7e86884bb56cdc2a606e8f6ded6057d8767e57
@@ -0,0 +1,46 @@
From: John Crispin <john@phrozen.org>
Subject: [PATCH] keep build paths out of the configure string
configure.in compiles the whole configure command line into the module as
VMMC_CONFIGURE_STR, and drv_vmmc_init.c keeps it in DRV_VMMC_WHICHCONFIG.
The command line holds the absolute paths of the build machine, among them
--enable-kernelbuild, --enable-tapiincl, CPPFLAGS and LDFLAGS. The module
therefore depends on the directory it was built in, and two builds in
different directories produce different modules.
The published snapshot module of lantiq/xway holds, for example,
--enable-kernelbuild=/builder/shared-workdir/build/build_dir/...
Drop every argument that holds a path. The feature flags, which are the
part a reader wants, stay. The loop repeats the idiom that the file
already uses for CONFIGURE_OPTIONS.
Signed-off-by: John Crispin <john@phrozen.org>
---
configure.in | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/configure.in
+++ b/configure.in
@@ -66,7 +66,20 @@ AH_BOTTOM([
#endif /* _DRV_CONFIG_H_ */
])
-AC_DEFINE_UNQUOTED([VMMC_CONFIGURE_STR], ["$ac_configure_args"], [configure options string])
+# The string below ends up in the module. An absolute path of the build
+# machine has no meaning on the target, and it makes the module depend on
+# the directory it was built in. Keep the arguments that hold no path.
+CONFIGURE_STR=''
+for c_arg in $ac_configure_args; do
+ case $c_arg in
+ *"/"*)
+ ;;
+ *)
+ CONFIGURE_STR="$CONFIGURE_STR $c_arg"
+ ;;
+ esac
+done
+AC_DEFINE_UNQUOTED([VMMC_CONFIGURE_STR], ["$CONFIGURE_STR"], [configure options string])
dnl enable linux kernel 2.6.x support (Make sure AC_PROG_CC is defined before to set $CC!)
AM_CONDITIONAL(KERNEL_2_6, false)