From owner-freebsd-toolchain@freebsd.org Wed Jan 1 05:58:43 2020 Return-Path: Delivered-To: freebsd-toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D9891E2C9D for ; Wed, 1 Jan 2020 05:58:43 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-48.consmr.mail.gq1.yahoo.com (sonic313-48.consmr.mail.gq1.yahoo.com [98.137.65.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47ngTG21d0z4Xfd for ; Wed, 1 Jan 2020 05:58:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: N_6BpMEVRDvd.miR6A7lED5GPdAEx7ojsA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Wed, 1 Jan 2020 05:58:40 +0000 Received: by smtp401.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 375855fd364ab727ae9c0e4d38c0023c; Wed, 01 Jan 2020 05:56:39 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) 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> Date: Tue, 31 Dec 2019 21:56:37 -0800 To: FreeBSD PowerPC ML , FreeBSD Toolchain X-Mailer: Apple Mail (2.3608.40.2.2.4) References: <6C451320-79D8-41C7-ACF8-FD4C7E9751A2.ref@yahoo.com> X-Rspamd-Queue-Id: 47ngTG21d0z4Xfd X-Spamd-Bar: - X-Spamd-Result: default: False [-1.31 / 15.00]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; SUBJECT_HAS_CURRENCY(1.00)[]; MV_CASE(0.50)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.86)[-0.861,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.953,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ipnet: 98.137.64.0/21(0.88), asn: 36647(0.71), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[111.65.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[111.65.137.98.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jan 2020 05:58:43 -0000 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)