Message ID | 1585568499-21585-1-git-send-email-amit.kachhap@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2,1/2] init/kconfig: Add LD_VERSION Kconfig | expand |
Hi Amit, On Mon, Mar 30, 2020 at 1:42 PM Amit Daniel Kachhap <amit.kachhap@arm.com> wrote: > This option can be used in Kconfig files to compare the ld version > and enable/disable incompatible config options if required. > > This option is used in the subsequent patch along with GCC_VERSION to > filter out an incompatible feature. > > Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com> > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -17,6 +17,10 @@ config GCC_VERSION > default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC > default 0 > > +config LD_VERSION > + int > + default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh) > + > config CC_IS_CLANG > def_bool $(success,$(CC) --version | head -n 1 | grep -q clang) .config: warning: symbol value '2.01827e+11' invalid for LD_VERSION Seen with the or32 compiler on kisskb, e.g. http://kisskb.ellerman.id.au/kisskb/buildresult/14226173/ Gr{oetje,eeting}s, Geert
On Mon, May 04, 2020 at 09:11:12AM +0200, Geert Uytterhoeven wrote: > On Mon, Mar 30, 2020 at 1:42 PM Amit Daniel Kachhap > <amit.kachhap@arm.com> wrote: > > This option can be used in Kconfig files to compare the ld version > > and enable/disable incompatible config options if required. > > > > This option is used in the subsequent patch along with GCC_VERSION to > > filter out an incompatible feature. > > > > Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com> > > > --- a/init/Kconfig > > +++ b/init/Kconfig > > @@ -17,6 +17,10 @@ config GCC_VERSION > > default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC > > default 0 > > > > +config LD_VERSION > > + int > > + default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh) > > + > > config CC_IS_CLANG > > def_bool $(success,$(CC) --version | head -n 1 | grep -q clang) > > .config: warning: symbol value '2.01827e+11' invalid for LD_VERSION > > Seen with the or32 compiler on kisskb, e.g. > http://kisskb.ellerman.id.au/kisskb/buildresult/14226173/ Hmm. The binutils version there is '2.26.20160125', but I think scripts/ld-version.sh is expecting that to be '2.26.0.20160125' as it would then ignore the date suffix as of commit 0d61ed17dd30 ("ld-version: Drop the 4th and 5th version components"). On a 32-bit host architecture, the awk expression ends up printing the version using exponential notation, but even on a 64-bit arch the number would still be bogus. Will
Will Deacon <will@kernel.org> writes: > On Mon, May 04, 2020 at 09:11:12AM +0200, Geert Uytterhoeven wrote: >> On Mon, Mar 30, 2020 at 1:42 PM Amit Daniel Kachhap >> <amit.kachhap@arm.com> wrote: >> > This option can be used in Kconfig files to compare the ld version >> > and enable/disable incompatible config options if required. >> > >> > This option is used in the subsequent patch along with GCC_VERSION to >> > filter out an incompatible feature. >> > >> > Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com> >> >> > --- a/init/Kconfig >> > +++ b/init/Kconfig >> > @@ -17,6 +17,10 @@ config GCC_VERSION >> > default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC >> > default 0 >> > >> > +config LD_VERSION >> > + int >> > + default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh) >> > + >> > config CC_IS_CLANG >> > def_bool $(success,$(CC) --version | head -n 1 | grep -q clang) >> >> .config: warning: symbol value '2.01827e+11' invalid for LD_VERSION >> >> Seen with the or32 compiler on kisskb, e.g. >> http://kisskb.ellerman.id.au/kisskb/buildresult/14226173/ > > Hmm. The binutils version there is '2.26.20160125', but I think > scripts/ld-version.sh is expecting that to be '2.26.0.20160125' as it would > then ignore the date suffix as of commit 0d61ed17dd30 ("ld-version: Drop > the 4th and 5th version components"). I updated the or32 compiler on kisskb to gcc 9.3.0, thanks to Arnd for building it. It has binutils 2.34. cheers
diff --git a/init/Kconfig b/init/Kconfig index 452bc18..68ddbcd 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -17,6 +17,10 @@ config GCC_VERSION default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC default 0 +config LD_VERSION + int + default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh) + config CC_IS_CLANG def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)
This option can be used in Kconfig files to compare the ld version and enable/disable incompatible config options if required. This option is used in the subsequent patch along with GCC_VERSION to filter out an incompatible feature. Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com> --- Changes since v1: * None. This patch series is based on Linux arm64 for-next tree [1]. More details of this work can be found in the thread [2]. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core [2]: http://lists.infradead.org/pipermail/linux-arm-kernel/2020-March/720257.html init/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)