@@ -243,7 +243,6 @@ menu "Global build settings"
config PKG_CC_STACKPROTECTOR_STRONG
bool "Strong"
select GCC_LIBSSP if !USE_MUSL
- depends on !GCC_VERSION_4_8
depends on KERNEL_CC_STACKPROTECTOR_STRONG
endchoice
@@ -258,7 +257,6 @@ menu "Global build settings"
config KERNEL_CC_STACKPROTECTOR_REGULAR
bool "Regular"
config KERNEL_CC_STACKPROTECTOR_STRONG
- depends on !GCC_VERSION_4_8
bool "Strong"
endchoice
@@ -104,6 +104,7 @@ endif
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
KERNEL_MAKE_FLAGS = \
+ KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR)))" \
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
CROSS_COMPILE="$(KERNEL_CROSS)" \
ARCH="$(LINUX_KARCH)" \
@@ -17,7 +17,7 @@ index 2c619c62e8..893128345a 100644
DEPEND[cversion.o]=buildinf.h
-GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"
-+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(filter-out -I% -iremap% -fmacro-prefix-map%,$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q))" "$(PLATFORM)"
++GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(filter-out -I% -iremap% -fmacro-prefix-map% -ffile-prefix-map%,$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q))" "$(PLATFORM)"
DEPEND[buildinf.h]=../configdata.pm
GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME)
@@ -139,11 +139,11 @@ else
TOOLCHAIN_DIR_NAME:=toolchain-$(GNU_TARGET_NAME)
endif
-ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_GCC_VERSION_4_8),$(CONFIG_TARGET_uml)),)
- ifeq ($(CONFIG_GCC_USE_EMBEDDED_PATH_REMAP),y)
- iremap = -fmacro-prefix-map=$(1)=$(2)
- else
+ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_TARGET_uml)),)
+ ifeq ($(CONFIG_GCC_USE_IREMAP),y)
iremap = -iremap$(1):$(2)
+ else
+ iremap = -ffile-prefix-map=$(1)=$(2)
endif
endif
@@ -2,8 +2,7 @@
choice
prompt "GCC compiler Version" if TOOLCHAINOPTS
- default GCC_USE_VERSION_8 if arc
- default GCC_USE_VERSION_7
+ default GCC_USE_VERSION_8
help
Select the version of gcc you wish to use.
@@ -22,6 +21,11 @@ choice
bool "gcc 9.x"
endchoice
+config GCC_USE_IREMAP
+ default y if ( GCC_USE_VERSION_5 || GCC_USE_VERSION_7 )
+ default n
+ bool
+
config GCC_USE_GRAPHITE
bool
prompt "Compile in support for the new Graphite framework in GCC 4.4+" if TOOLCHAINOPTS
@@ -2,23 +2,17 @@ config GCC_VERSION_5
default y if GCC_USE_VERSION_5
bool
-config GCC_VERSION_8
- default y if GCC_USE_VERSION_8
- default y if arc && !GCC_USE_VERSION_9
+config GCC_VERSION_7
+ default y if GCC_USE_VERSION_7
bool
config GCC_VERSION_9
default y if GCC_USE_VERSION_9
bool
-config GCC_USE_EMBEDDED_PATH_REMAP
- default y if ( GCC_VERSION_8 || GCC_VERSION_9 )
- default n
- bool
-
config GCC_VERSION
string
default "5.5.0" if GCC_VERSION_5
- default "8.3.0" if GCC_VERSION_8
+ default "7.4.0" if GCC_VERSION_7
default "9.2.0" if GCC_VERSION_9
- default "7.4.0"
+ default "8.3.0"
Main motivation for this commit is the introduction of `-ffile-prefix-map=` which alows reproducible build path. The usage of `-ffile-prefix-map=` in include/kernel.mk adds reproducibility to kmods like gpio-hotplug and wireguard which before stored the build path as debug information in .rodata. Compiling tested without errors on the following targets: * ath79 * brcm2708 * brcm63xx * ixp4xx * ramips * sunxi * x86 CC: Andre Heider <a.heider@gmail.com> CC: Petr Štetiar <ynezz@true.cz> Thanks to Andre for the iremap fixup Thanks to Petr for his patience on helping which screws to tweak Signed-off-by: Paul Spooren <mail@aparcar.org> --- v3: add KCFLAGS to make kmods reproducible config/Config-build.in | 2 -- include/kernel.mk | 1 + .../patches/120-strip-cflags-from-binary.patch | 2 +- rules.mk | 8 ++++---- toolchain/gcc/Config.in | 8 ++++++-- toolchain/gcc/Config.version | 14 ++++---------- 6 files changed, 16 insertions(+), 19 deletions(-)