* [Buildroot] [PATCH] package/mmc-utils: fix build failure with _FORTIFY_SOURCE=3
@ 2023-08-09 21:03 Giulio Benetti
2023-08-22 20:20 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Giulio Benetti @ 2023-08-09 21:03 UTC (permalink / raw)
To: buildroot; +Cc: Giulio Benetti
At the moment mmc-utils doesn't support _FORTIFY_SOURCE=3 so let's set it
to 2 at maximum by undefining _FORTIFY_SOURCE and redefining it to 2.
Fixes:
http://autobuild.buildroot.net/results/32d2f9894efc1e743ca6ae7d2fe3108ccf41c188
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
package/mmc-utils/mmc-utils.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/package/mmc-utils/mmc-utils.mk b/package/mmc-utils/mmc-utils.mk
index 9da9c30293..19013bcc1c 100644
--- a/package/mmc-utils/mmc-utils.mk
+++ b/package/mmc-utils/mmc-utils.mk
@@ -16,6 +16,11 @@ ifeq ($(BR2_PACKAGE_MMC_UTILS_ENABLE_DANGEROUS_COMMANDS),y)
MMC_UTILS_CFLAGS += -DDANGEROUS_COMMANDS_ENABLED
endif
+# disable _FORTIFY_SOURCE=3 and set it to 2
+ifeq ($(BR2_FORTIFY_SOURCE_3),y)
+MMC_UTILS_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+endif
+
# override AM_CFLAGS as the project Makefile uses it to pass
# -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2, and the latter conflicts
# with the _FORTIFY_SOURCE that we pass when hardening options are
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] package/mmc-utils: fix build failure with _FORTIFY_SOURCE=3
2023-08-09 21:03 [Buildroot] [PATCH] package/mmc-utils: fix build failure with _FORTIFY_SOURCE=3 Giulio Benetti
@ 2023-08-22 20:20 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-08-22 20:20 UTC (permalink / raw)
To: Giulio Benetti; +Cc: buildroot
On Wed, 9 Aug 2023 23:03:38 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> +# disable _FORTIFY_SOURCE=3 and set it to 2
> +ifeq ($(BR2_FORTIFY_SOURCE_3),y)
> +MMC_UTILS_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
> +endif
This is a work-around, not a proper fix, and actually the following
defconfig builds just fine today:
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_FORTIFY_SOURCE_3=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_MMC_UTILS=y
# BR2_TARGET_ROOTFS_TAR is not set
So there is really no reason to globally override _FORTIFY_SOURCE=3 for
mmc-utils, it builds fine at least in some situations. So it needs to
be narrowed down a little bit further, up to the point where we can see
if it's a glibc bug, or a gcc bug, possibly architecture specific.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-22 20:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 21:03 [Buildroot] [PATCH] package/mmc-utils: fix build failure with _FORTIFY_SOURCE=3 Giulio Benetti
2023-08-22 20:20 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox