Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Dec 2019 21:56:37 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   For reliable builds, gnu/usr.bin/binutils/Makefile needs similar to gnu/usr.bin/binutils/Makefile.inc0 TARGET_CPUARCH use, not ${TARGET} use
Message-ID:  <6C451320-79D8-41C7-ACF8-FD4C7E9751A2@yahoo.com>
References:  <6C451320-79D8-41C7-ACF8-FD4C7E9751A2.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
My cross-build attempts were failing to build
ld.bfd for use for building LIB32 for powerpc64
until I made the following change:


# svnlite diff gnu/usr.bin/binutils/Makefile
Index: gnu/usr.bin/binutils/Makefile
===================================================================
--- gnu/usr.bin/binutils/Makefile	(revision 356187)
+++ gnu/usr.bin/binutils/Makefile	(working copy)
@@ -15,7 +15,16 @@
 # GNU binutils 2.17.50 ld.
 # Except if we are on powerpc, that needs the ld from binutils to link
 # 32-bit binaries.
-.if ${MK_LLD_IS_LD} == "no" || ${TARGET} == "powerpc"
+#
+# Localized variation of some gnu/usr.bin/binutils/Makefile.inc0
+# content:
+.if defined(TARGET_ARCH)
+HACK_TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}}
+.else
+HACK_TARGET_CPUARCH=${MACHINE_CPUARCH}
+.endif
+#
+.if ${MK_LLD_IS_LD} == "no" || ${HACK_TARGET_CPUARCH} == "powerpc"
 SUBDIR.${MK_BINUTILS}+=ld
 .endif
 

Otherwise, gnu/usr.bin/binutils/ld/Makefile was not used
to build ld.bfd and the build ending up stopping, reporting
the lack of anything at the path it specified to clang for
executing the 32-bit linker.

(No place else under gnu/ was using ${TARGET} . Many
places were using ${MACHINE_CPUARCH} . But straight use
of ${MACHINE_CPUARCH} here did not work for the context.
Thus, I went for the more general code from Makefile.inc0
instead, reusing what others had already figured out.)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6C451320-79D8-41C7-ACF8-FD4C7E9751A2>