Properly extract the emulation path from the linker script template.

This commit is contained in:
joerg 2019-02-25 19:55:35 +00:00
parent 7e38c880e6
commit be7b2c4eb4
2 changed files with 4 additions and 44 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2018/04/14 17:53:18 christos Exp $
# $NetBSD: Makefile,v 1.7 2019/02/25 19:55:35 joerg Exp $
CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} \
-I${DIST}/ld \
@ -63,30 +63,10 @@ ${PROG}.info: configdoc.texi bfdver.texi
DPSRCS+= .depend.${f} e${f}.c
CLEANFILES+= .depend.${f} e${f}.c
# XXX super hack
. if (${BINUTILS_MACHINE_ARCH} == "x86_64" && \
("${f}" == "elf_i386" || "${f}" == "i386nbsd"))
EMUL_LIB_PATH.${f}=/usr/lib/i386
. elif (${BINUTILS_MACHINE_ARCH} == "sparc64" && \
("${f}" == "elf32_sparc" || "${f}" == "sparcnbsd"))
EMUL_LIB_PATH.${f}=/usr/lib/sparc
. elif !empty(BINUTILS_MACHINE_ARCH:Mmips64*)
. if "${f}" == "elf32ltsmip" || "${f}" == "elf32btsmip"
EMUL_LIB_PATH.${f}:=/usr/lib/o32
. elif "${f}" == "elf64ltsmip" || "${f}" == "elf64btsmip"
EMUL_LIB_PATH.${f}:=/usr/lib/64
. else
EMUL_LIB_PATH.${f}=/usr/lib
. endif
. else
EMUL_LIB_PATH.${f}=/usr/lib
. endif
e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed
${_MKTARGET_CREATE}
unset MACHINE || true; \
LIB_PATH=${EMUL_LIB_PATH.${f}} NATIVE=yes \
${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld \
NATIVE=yes ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld \
${LIBDIR} "/usr" "/usr/bin" \
${G_target_alias} ${G_target_alias} ${G_target_alias} \
${G_EMUL} ${LIBDIR} yes ${G_enable_initfini_array} \

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.29 2016/10/19 20:55:44 mrg Exp $
# $NetBSD: Makefile,v 1.30 2019/02/25 19:55:35 joerg Exp $
CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} \
-I${DIST}/ld \
@ -63,30 +63,10 @@ ${PROG}.info: configdoc.texi bfdver.texi
DPSRCS+= .depend.${f} e${f}.c
CLEANFILES+= .depend.${f} e${f}.c
# XXX super hack
. if (${BINUTILS_MACHINE_ARCH} == "x86_64" && \
("${f}" == "elf_i386" || "${f}" == "i386nbsd"))
EMUL_LIB_PATH.${f}=/usr/lib/i386
. elif (${BINUTILS_MACHINE_ARCH} == "sparc64" && \
("${f}" == "elf32_sparc" || "${f}" == "sparcnbsd"))
EMUL_LIB_PATH.${f}=/usr/lib/sparc
. elif !empty(BINUTILS_MACHINE_ARCH:Mmips64*)
. if "${f}" == "elf32ltsmip" || "${f}" == "elf32btsmip"
EMUL_LIB_PATH.${f}:=/usr/lib/o32
. elif "${f}" == "elf64ltsmip" || "${f}" == "elf64btsmip"
EMUL_LIB_PATH.${f}:=/usr/lib/64
. else
EMUL_LIB_PATH.${f}=/usr/lib
. endif
. else
EMUL_LIB_PATH.${f}=/usr/lib
. endif
e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed
${_MKTARGET_CREATE}
unset MACHINE || true; \
LIB_PATH=${EMUL_LIB_PATH.${f}} NATIVE=yes \
${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld \
NATIVE=yes ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld \
${LIBDIR} "/usr" "/usr/bin" \
${G_target_alias} ${G_target_alias} ${G_target_alias} \
${G_EMUL} ${LIBDIR} yes ${G_enable_initfini_array} \