diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-07-26 13:20:54 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-07-26 13:20:54 +0000 |
commit | a4e97e10814a72f3d111ea3d20c27f4907e0599f (patch) | |
tree | f49a6a3af9491b1941fe76a48b61574db181b93a /gnu | |
parent | 3431e121488e88202ed833c24251b03463ea18a3 (diff) |
Add infrastructure to install lld as the default linker. The old GNU linker
will be installed as /usr/bin/ld.bfd on supported systems. This allows
users to fall back on the old linker by using the -fuse-ld=bfd option on
systems where lld is the default linker.
Switch armv7 to use lld as the default linker. On arm64 we already use lld
as the default linker. Other platforms will keep using the GNU linker for
now.
ok patrick@, deraadt@, phessler@
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper | 14 | ||||
-rw-r--r-- | gnu/usr.bin/binutils-2.17/ld/Makefile.in | 2 | ||||
-rw-r--r-- | gnu/usr.bin/clang/lld/Makefile | 4 |
3 files changed, 14 insertions, 6 deletions
diff --git a/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper b/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper index e7c44d0d8bf..81634c49866 100644 --- a/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper +++ b/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.14 2017/06/12 18:49:34 espie Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.15 2018/07/26 13:20:53 kettenis Exp $ .include <bsd.own.mk> @@ -35,7 +35,10 @@ MAN+= binutils/doc/ar.1 binutils/doc/ranlib.1 \ SUBDIRS+= ld gas CONF_SUBDIRS+= ld gas INST_SUBDIRS+= ld gas -MAN+= gas/doc/as.1 ld/ld.1 +MAN+= gas/doc/as.1 ld/ld.bfd.1 +.if ${LINKER_VERSION:L} == "bfd" +MLINKS+= ld.bfd.1 ld.1 +.endif .endif # Used by the GNU Makefile @@ -96,8 +99,9 @@ do-config: .USE gas/doc/as.1: config.status cd ${.OBJDIR}/gas/doc && ${MAKE} as.1 -ld/ld.1: config.status +ld/ld.bfd.1: config.status cd ${.OBJDIR}/ld && ${MAKE} ld.1 + mv ld/ld.1 ld/ld.bfd.1 config: do-config .ifndef GLOBAL_AUTOCONF_CACHE @@ -120,6 +124,10 @@ install: maninstall INSTALL_DATA='${INSTALL} -c -o ${DOCOWN} -g ${DOCGRP} -m ${NONBINMODE}' \ INSTALL_INFO_HOST_MODULES='${INSTALL_INFO_HOST_MODULES}' \ install install-info +.if ${LINKER_VERSION:L} == "bfd" + rm -f ${DESTDIR}${PREFIX}/bin/ld + ln ${DESTDIR}${PREFIX}/bin/ld.bfd ${DESTDIR}${PREFIX}/bin/ld +.endif clean cleandir: -@if [ -e Makefile ]; then ${MAKE} distclean; fi diff --git a/gnu/usr.bin/binutils-2.17/ld/Makefile.in b/gnu/usr.bin/binutils-2.17/ld/Makefile.in index 5436b9f2832..fbf0fd7da18 100644 --- a/gnu/usr.bin/binutils-2.17/ld/Makefile.in +++ b/gnu/usr.bin/binutils-2.17/ld/Makefile.in @@ -142,7 +142,7 @@ EMUL = @EMUL@ EMULATION_LIBPATH = @EMULATION_LIBPATH@ EMULATION_OFILES = @EMULATION_OFILES@ EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@ -EXEEXT = @EXEEXT@ +EXEEXT = .bfd GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ diff --git a/gnu/usr.bin/clang/lld/Makefile b/gnu/usr.bin/clang/lld/Makefile index d133133ae5e..130ef1c1558 100644 --- a/gnu/usr.bin/clang/lld/Makefile +++ b/gnu/usr.bin/clang/lld/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2018/04/06 14:44:04 patrick Exp $ +# $OpenBSD: Makefile,v 1.14 2018/07/26 13:20:53 kettenis Exp $ .include <bsd.own.mk> @@ -7,7 +7,7 @@ BINDIR= /usr/bin SRCS= lld.cpp TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == "aarch64" +.if ${LINKER_VERSION:L} == "lld" LINKS= ${BINDIR}/ld.lld ${BINDIR}/ld MLINKS= ld.lld.1 ld.1 .endif |