From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Date: Thu, 22 Feb 2018 03:22:02 +0000 Subject: Re: [PATCH 00/23] kconfig: move compiler capability tests to Kconfig Message-Id: <87efldr9np.fsf@concordia.ellerman.id.au> List-Id: References: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> <20180218221352.GA6651@ravnborg.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Masahiro Yamada , Arnd Bergmann Cc: Rich Felker , Kernel Hardening , X86 ML , Paul Mackerras , "H. Peter Anvin" , sparclinux , Sam Ravnborg , Yoshinori Sato , Jonathan Corbet , Richard Weinberger , Linux-sh list , Linus Torvalds , Ingo Molnar , Emese Revfy , Kees Cook , uml-devel , Linux Kbuild mailing list , Peter Oberparleiter , Jeff Dike , user-mode-linux-user@lists.sourceforge.net, Thomas Gleixner , Michal Marek , Ulf Magnusson , Greg Kroah-Hartman , Randy Dunlap , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linuxppc-dev , "David S. Miller" Masahiro Yamada writes: > > > (Case 3) > Compiler flag -foo is sensitive to endian-ness. > > > config CC_NEEDS_BIG_ENDIAN > def_bool $(cc-option -mbig-endian) && CPU_BIG_ENDIAN > > config CC_NEEDS_LITTLE_ENDIAN > def_bool $(cc-option -mlittle-endian) && CPU_LITTLE_ENDIAN > > config CC_HAS_FOO > bool > default $(cc-option -mbig-endian -foo) if CC_NEEDS_BIG_ENDIAN > default $(cc-option -mlittle-endian -foo) if CC_NEEDS_LITTLE_ENDIAN > default $(cc-option -foo) We may do something like this on powerpc, where we have 32/64-bit and big/little endian (on 64-bit) and then some ABI options that we set/unset depending on endian. The above looks like it could work though. cheers