Re: Compiling with old gcc breaks when CONFIG_RETPOLINE is off
From: Zhenzhong Duan
Date: Tue Dec 04 2018 - 20:30:31 EST
Hi Meelis,
Could you try below change? It force syncconfig for any 'make *config"
so that autoconf.h and auto.conf are always updated.
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 98e0c7a..802875b 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -38,7 +38,7 @@ enum input_mode {
Âstatic int indent = 1;
Âstatic int tty_stdio;
-static int sync_kconfig;
+static int sync_kconfig = 1;
Âstatic int conf_cnt;
Âstatic char line[PATH_MAX];
Âstatic struct menu *rootEntry;
@@ -506,11 +506,11 @@ int main(int ac, char **av)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ * Suppress distracting "configuration written
to ..."
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ */
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ conf_set_message_callback(NULL);
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ sync_kconfig = 1;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ break;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case defconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case savedefconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ defconfig_file = optarg;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ sync_kconfig = 0;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ break;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case randconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ {
@@ -537,13 +537,15 @@ int main(int ac, char **av)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ srand(seed);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ break;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case listnewconfig:
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ sync_kconfig = 0;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ /* fall through */
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case oldaskconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case oldconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case allnoconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case allyesconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case allmodconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case alldefconfig:
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case listnewconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case olddefconfig:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ break;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ case '?':
Thanks
Zhenzhong
On 2018/12/4 17:58, Meelis Roos wrote:
Just tried 4.20-rc5 on an old K6-2 PC with gcc 5.3.1, got an error
about non-retpoline compiler,
turned CONFIG_RETPOLINE off and retried.
To my surprise, compilation still breaks with
arch/x86/Makefile:224: *** You are building kernel with non-retpoline
compiler, please update your compiler.. Stop.
As I read the Makefile, it should error only when CONFIG_RETPOLINE is
enabled, but it still breaks.
$ grep -r CONFIG_RETPOLINE .config
# CONFIG_RETPOLINE is not set
$ grep -r CONFIG_RETPOLINE include/
include/generated/autoconf.h:#define CONFIG_RETPOLINE 1
include/config/auto.conf:CONFIG_RETPOLINE=y
So the headers have not been updated yet, maybe?