]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ARM: 8405/1: VDSO: fix regression with toolchains lacking ld.bfd executable
authorNathan Lynch <nathan_lynch@mentor.com>
Fri, 17 Jul 2015 20:40:28 +0000 (21:40 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 31 Jul 2015 17:54:45 +0000 (18:54 +0100)
commit3473f26592c1c365d376aee29433d7db75f14d1e
tree6cf26f9a77d895e80f5482084aafb2f13f9d1d90
parent0871b7248113ebfccbfabcd3fd1f867a2bc681f4
ARM: 8405/1: VDSO: fix regression with toolchains lacking ld.bfd executable

The Sourcery CodeBench Lite 2014.05 toolchain (gcc 4.8.3, binutils
2.24.51) has a GCC which implements -fuse-ld, and it doesn't include
the gold linker, but it lacks an ld.bfd executable in its
installation.  This means that passing -fuse-ld=bfd fails with:

      VDSO    arch/arm/vdso/vdso.so.raw
    collect2: fatal error: cannot find 'ld'

Arguably this is a deficiency in the toolchain, but I suspect it's
commonly used enough that it's worth accommodating: just use

cc-ldoption (to cause a link attempt) instead of cc-option to test
whether we can use -fuse-ld.  So -fuse-ld=bfd won't be used with this
toolchain, but the build will rightly succeed, just as it does for
toolchains which don't implement -fuse-ld (and don't use gold as the
default linker).

Note: this will change the failure mode for a corner case I was trying
to handle in d2b30cd4b722, where the toolchain defaults to the gold
linker and the BFD linker is not found in PATH, from:

      VDSO    arch/arm/vdso/vdso.so.raw
    collect2: fatal error: cannot find 'ld'

i.e. the BFD linker is not found, to:

      OBJCOPY arch/arm/vdso/vdso.so
    BFD: arch/arm/vdso/vdso.so: Not enough room for program headers, try
    linking with -N

that is, we fail to prevent gold from being used as the linker, and it
produces an object that objcopy can't digest.

Reported-by: Baruch Siach <baruch@tkos.co.il>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Tested-by: Raphaƫl Poggi <poggi.raph@gmail.com>
Fixes: d2b30cd4b722 ("ARM: 8384/1: VDSO: force use of BFD linker")
Cc: stable@vger.kernel.org
Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/vdso/Makefile