* [Buildroot] [PATCH] package/swupdate: do not store local build details in swupdate config file
@ 2020-03-06 10:38 Thomas Petazzoni
2020-03-08 8:30 ` Peter Korsgaard
2020-03-15 10:36 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2020-03-06 10:38 UTC (permalink / raw)
To: buildroot
The SWUPDATE_SET_BUILD_OPTIONS macro sets a number of swupdate
configuration options with local build details, especially the
cross-compiler path and sysroot path.
This means that if one stores an swupdate defconfig file as part of
Buildroot, generated with "make swupdate-update-defconfig", it will
contain things like:
CONFIG_CROSS_COMPILE="/home/thomas/projets/buildroot/output/host/bin/arm-linux-"
CONFIG_SYSROOT="/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot"
which obviously are not good, as they are specific to where the build
was done.
So instead this commit:
- Uses the CROSS_COMPILE environment variable to pass the
cross-compiler path.
- Drops entirely the use of CONFIG_SYSROOT, since all it does is pass
a --sysroot option to the compiler, which is not needed in the
context of Buildroot.
- Pass EXTRA_CFLAGS/EXTRA_LDFLAGS also through the environment.
Thanks to that the swupdate defconfig file no longer contains any
local build details, and can be re-used by different users of a given
Buildroot configuration.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
package/swupdate/swupdate.mk | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk
index 60dc0e968a..237a44e233 100644
--- a/package/swupdate/swupdate.mk
+++ b/package/swupdate/swupdate.mk
@@ -156,25 +156,18 @@ define SWUPDATE_PREFER_STATIC
endef
endif
-define SWUPDATE_SET_BUILD_OPTIONS
- $(call KCONFIG_SET_OPT,CONFIG_CROSS_COMPILE,"$(TARGET_CROSS)", \
- $(SWUPDATE_BUILD_CONFIG))
- $(call KCONFIG_SET_OPT,CONFIG_SYSROOT,"$(STAGING_DIR)", \
- $(SWUPDATE_BUILD_CONFIG))
- $(call KCONFIG_SET_OPT,CONFIG_EXTRA_CFLAGS,"$(TARGET_CFLAGS)", \
- $(SWUPDATE_BUILD_CONFIG))
- $(call KCONFIG_SET_OPT,CONFIG_EXTRA_LDFLAGS,"$(TARGET_LDFLAGS)", \
- $(SWUPDATE_BUILD_CONFIG))
-endef
+SWUPDATE_MAKE_OPTS = \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ CONFIG_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ CONFIG_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)"
define SWUPDATE_KCONFIG_FIXUP_CMDS
$(SWUPDATE_PREFER_STATIC)
- $(SWUPDATE_SET_BUILD_OPTIONS)
$(SWUPDATE_SET_LUA_VERSION)
endef
define SWUPDATE_BUILD_CMDS
- $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D)
+ $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) $(SWUPDATE_MAKE_OPTS) -C $(@D)
endef
define SWUPDATE_INSTALL_TARGET_CMDS
--
2.24.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/swupdate: do not store local build details in swupdate config file
2020-03-06 10:38 [Buildroot] [PATCH] package/swupdate: do not store local build details in swupdate config file Thomas Petazzoni
@ 2020-03-08 8:30 ` Peter Korsgaard
2020-03-15 10:36 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-03-08 8:30 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> The SWUPDATE_SET_BUILD_OPTIONS macro sets a number of swupdate
> configuration options with local build details, especially the
> cross-compiler path and sysroot path.
> This means that if one stores an swupdate defconfig file as part of
> Buildroot, generated with "make swupdate-update-defconfig", it will
> contain things like:
> CONFIG_CROSS_COMPILE="/home/thomas/projets/buildroot/output/host/bin/arm-linux-"
> CONFIG_SYSROOT="/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot"
> which obviously are not good, as they are specific to where the build
> was done.
> So instead this commit:
> - Uses the CROSS_COMPILE environment variable to pass the
> cross-compiler path.
> - Drops entirely the use of CONFIG_SYSROOT, since all it does is pass
> a --sysroot option to the compiler, which is not needed in the
> context of Buildroot.
> - Pass EXTRA_CFLAGS/EXTRA_LDFLAGS also through the environment.
> Thanks to that the swupdate defconfig file no longer contains any
> local build details, and can be re-used by different users of a given
> Buildroot configuration.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/swupdate: do not store local build details in swupdate config file
2020-03-06 10:38 [Buildroot] [PATCH] package/swupdate: do not store local build details in swupdate config file Thomas Petazzoni
2020-03-08 8:30 ` Peter Korsgaard
@ 2020-03-15 10:36 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-03-15 10:36 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> The SWUPDATE_SET_BUILD_OPTIONS macro sets a number of swupdate
> configuration options with local build details, especially the
> cross-compiler path and sysroot path.
> This means that if one stores an swupdate defconfig file as part of
> Buildroot, generated with "make swupdate-update-defconfig", it will
> contain things like:
> CONFIG_CROSS_COMPILE="/home/thomas/projets/buildroot/output/host/bin/arm-linux-"
> CONFIG_SYSROOT="/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot"
> which obviously are not good, as they are specific to where the build
> was done.
> So instead this commit:
> - Uses the CROSS_COMPILE environment variable to pass the
> cross-compiler path.
> - Drops entirely the use of CONFIG_SYSROOT, since all it does is pass
> a --sysroot option to the compiler, which is not needed in the
> context of Buildroot.
> - Pass EXTRA_CFLAGS/EXTRA_LDFLAGS also through the environment.
> Thanks to that the swupdate defconfig file no longer contains any
> local build details, and can be re-used by different users of a given
> Buildroot configuration.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed to 2019.02.x and 2019.11.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-15 10:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 10:38 [Buildroot] [PATCH] package/swupdate: do not store local build details in swupdate config file Thomas Petazzoni
2020-03-08 8:30 ` Peter Korsgaard
2020-03-15 10:36 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.