Skip to content

Commit

Permalink
Pass LINKER_VERSION to binutils and clang cross-build so that they
Browse files Browse the repository at this point in the history
know who the system linker is.
  • Loading branch information
bluerise committed Oct 14, 2019
1 parent 4995d90 commit dd8b647
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile.cross,v 1.101 2019/05/22 02:31:44 patrick Exp $
# $OpenBSD: Makefile.cross,v 1.102 2019/10/14 14:32:26 patrick Exp $

cross-tools: cross-includes cross-binutils cross-gcc cross-lib
cross-distrib: cross-tools cross-bin cross-share cross-sys cross-etc-root-var
Expand Down Expand Up @@ -95,6 +95,12 @@ CC=gcc
CXX=g++
.endif

.if !empty(LLD_ARCH:M${_arch})
LINKER_VERSION=lld
.else
LINKER_VERSION=bfd
.endif

.if !empty(PIE_ARCH:M${_arch})
NOPIE_FLAGS=-fno-pie
NOPIE_LDFLAGS=-nopie
Expand Down Expand Up @@ -203,6 +209,7 @@ ${CROSSBINUTILS}: ${CROSSINCLUDES}
${MAKE} -f Makefile.bsd-wrapper all && \
env CROSSDIR=${CROSSDIR} DESTDIR=${CROSSDIR} \
COMPILER_VERSION=${COMPILER_VERSION} \
LINKER_VERSION=${LINKER_VERSION} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
PIE_DEFAULT=${PIE_DEFAULT} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
Expand Down Expand Up @@ -239,6 +246,7 @@ ${CROSSGCC}: ${CROSSBINUTILS}
(cd ${.CURDIR}/gnu/usr.bin/clang; \
DESTDIR=${CROSSDIR} \
BSDOBJDIR=${CROSSDIR}/usr/obj \
LINKER_VERSION=${LINKER_VERSION} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} \
${MAKE} install)
Expand Down

0 comments on commit dd8b647

Please sign in to comment.