From owner-freebsd-x11@freebsd.org Thu Nov 15 01:25:07 2018 Return-Path: Delivered-To: freebsd-x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B69C1108154 for ; Thu, 15 Nov 2018 01:25:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-14.consmr.mail.bf2.yahoo.com (sonic315-14.consmr.mail.bf2.yahoo.com [74.6.134.124]) (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 516D378737 for ; Thu, 15 Nov 2018 01:25:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 1GwxnJIVM1ndNnR_WkLuFf0K9YRgMKUaKezL1zxuqvWmTDQ1D9_3r1MpdGuxY0M koYlzbYJjXQ6ldTZ9csqNaCjJ_yxRpBctsgpAPro7d4MQF7tt.MkLDJvRq9V.sMSRDQOMyxmJ9Ve pjmIwHGAJ5kpE.9gl50fZgQIuWLtS.EHGanxkcGiCyWicFtInQZ8n5M2zoWTkytw5Uf3GLHmkQU4 K5OkNW50zcL.ZgraUve.H7SVeuaqNsQs9dAZzaahpjKtoAObNv0Q0eK2P9pzEij65uXX0NjPZ6j8 TWFOlSHsjwqT0FxYbO1anlnqyknyoTIvwgwPqqIah4sWmg5sSiiH.ZlxZwWy_w.QanXv7.uUVnuf 5Vr9SZn65VGgNv.eQBBKUrAYT9hQDvmrIoJ59eAm5GgQgkd2eR24uH174BvAriRHbRIx7EX0iEDx .1HBjklCY6Q2w9R2qFJMBP.V3wwta93AHHnX4IlHchpDW6DL0WcLREliorDUkf5KLyCewGUf1Ebu 1KrgzCFCmg8zxyB5f7_RZeTIrdpFv1C1VBdjCQO31sWDA35lywpfFh7W6BWA7IYvffVXBNjmuG2Z .eHeCloHrMGrN2dp3oFFyXqL6Bpm_hTWFpBefiwS7VlTvo6GcgMfJ4Mc_57mEM8UXtV6Sfu7RWcO 8n7_iTWo9b9HlCcZSIj7nS0_3UrNldMNy_EALtqF7V8DDuI6Hpg8ZWrm7o_HiDHNDFBDzAve_L1b iRXDFwSqt0m.EXR4Cxt8jTehXPr_ggjPU133SEtgs4DJ0kaVUlNdQi0G5IylYcJ3PmWPX.3JuK9h EDznEvV1NbczUMZXOLaqLlJqR6PYEYTkW76rsd7vYbQZWCTdSZDiyWLR2anpO1o41ZUH3kbhNf2u WOOzTciD6Ak4tuO675d7SjGSkv0nRocaREbQ1Eg8ri6mUw3kL4n5mgR2ylIPEhkveyjWqlW3fRlc ZovDtmWtgdQs82KJ7e2VKMaBoMz03QkAmOlpr2Rhuj1dHWCAW.aTgCDMTXtKhQxAQrDIno221RiN OivrjEqItvHX8IcJvUWfmCJaoPZcXuSkinQBKutsz Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Thu, 15 Nov 2018 01:25:00 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp423.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 904077ce42504eff0f31748a74f727eb; Thu, 15 Nov 2018 01:24:57 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: ports head -r487783: on armv7 x11/pixman fails to build: /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against local symbol in readonly segment; recompile object files with -fPIC From: Mark Millard In-Reply-To: Date: Wed, 14 Nov 2018 17:24:55 -0800 Cc: ports-list freebsd , freebsd-x11@freebsd.org, Jan Beich Content-Transfer-Encoding: quoted-printable Message-Id: <12EFB5C5-4BC6-4083-B51D-26D1D3150C35@yahoo.com> References: <56BE95DD-61E5-43CB-923D-10E968003FE3@yahoo.com> <5FF705ED-B019-4CB1-B516-796C2E7A6FF9@yahoo.com> <51a82f62-13df-a485-4d5a-7dbfa3d1107f@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3445.101.1) X-Rspamd-Queue-Id: 516D378737 X-Spamd-Result: default: False [0.56 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com]; NEURAL_HAM_MEDIUM(-0.31)[-0.311,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_FROM(0.00)[yahoo.com]; NEURAL_HAM_LONG(-0.74)[-0.742,0]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.72)[0.718,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCVD_IN_DNSWL_NONE(0.00)[124.134.6.74.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; IP_SCORE(1.40)[ip: (3.43), ipnet: 74.6.128.0/21(2.05), asn: 26101(1.64), country: US(-0.10)]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 01:25:07 -0000 [Looks like there are 2 stages involved in that 2mmjnk.txt file that I generated. Before MACHINE_ARCH is explicitly assigned and after.] On 2018-Nov-14, at 15:40, Mark Millard wrote: > [Evidence from inside poudriere bulk -j... -i ports-mgmt/pkg . > Use of native /nxb-bin/. . . leads to MACHINE_ARCH being amd64 > instead of armv7 or the like. See later supporting material.] >=20 > On 2018-Nov-14, at 14:38, Bryan Drewery wrote: >=20 >> On 11/14/18 2:35 PM, Mark Millard wrote: >>> [Looking at package fallout logs: the official armv6 and armv7 >>> builds are using -O2 because of MACHINE_ARCH being defined >>> because of qemu-user-static use. (mips too?) The logic in >>> share/mk/sys.mk is not causing -O . An implication >>> is that -O2 for armv6 and armv7 is probably far more tested >>> than people generally expect. The share/mk/sys.mk change >>> goes back to -r319861 2017-Jun-12 . Previously the logic >>> would have caused -O use for armv6 or armv7 in MACHINE_ARCH .] >>=20 >> r319861 doesn't look related here. >=20 > # more /etc/make.conf=20 > .sinclude "/etc/make.nxb.conf" > USE_PACKAGE_DEPENDS=3Dyes > BATCH=3Dyes > WRKDIRPREFIX=3D/wrkdirs > PORTSDIR=3D/usr/ports > PACKAGES=3D/packages > DISTDIR=3D/distfiles > FORCE_PACKAGE=3Dyes > PACKAGE_BUILDING=3Dyes > PACKAGE_BUILDING_FLAVORS=3Dyes > MACHINE=3Darm > MACHINE_ARCH=3Darmv7 > ARCH=3D${MACHINE_ARCH} > #### /usr/local/etc/poudriere.d/make.conf #### > #### /usr/ports/Mk/Scripts/ports_env.sh #### > _CCVERSION_9d218390=3DFreeBSD clang version 6.0.1 = (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1) Target: = armv7-unknown-freebsd13.0-gnueabihf Thread model: posix InstalledDir: = /nxb-bin/usr/bin > _ALTCCVERSION_9d218390=3Dnone > _CXXINTERNAL_9c45a5b1=3DFreeBSD clang version 6.0.1 = (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1) Target: = armv7-unknown-freebsd13.0-gnueabihf Thread model: posix InstalledDir: = /nxb-bin/usr/bin "/nxb-bin/usr/bin/ld" "--eh-frame-hdr" = "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=3Dboth" = "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" = "/usr/lib/crtbegin.o" "-L/usr/lib" "/dev/null" "-lc++" "-lm" "-lgcc" = "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" = "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o" > CC_OUTPUT_9d218390_58173849=3Dyes > CC_OUTPUT_9d218390_9bdba57c=3Dyes > CC_OUTPUT_9d218390_6a4fe7f5=3Dyes > CC_OUTPUT_9d218390_6bcac02b=3Dyes > CC_OUTPUT_9d218390_67d20829=3Dyes > CC_OUTPUT_9d218390_bfa62e83=3Dyes > CC_OUTPUT_9d218390_f0b4d593=3Dyes > CC_OUTPUT_9d218390_308abb44=3Dyes > CC_OUTPUT_9d218390_f00456e5=3Dyes > CC_OUTPUT_9d218390_65ad290d=3Dyes > CC_OUTPUT_9d218390_f2776b26=3Dyes > CC_OUTPUT_9d218390_b2657cc3=3Dyes > CC_OUTPUT_9d218390_380987f7=3Dyes > CC_OUTPUT_9d218390_160933ec=3Dyes > CC_OUTPUT_9d218390_fb62803b=3Dyes > _OBJC_CCVERSION_9d218390=3DFreeBSD clang version 6.0.1 = (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1) Target: = armv7-unknown-freebsd13.0-gnueabihf Thread model: posix InstalledDir: = /nxb-bin/usr/bin > _OBJC_ALTCCVERSION_9d218390=3Dnone > ARCH=3Darmv7 > OPSYS=3DFreeBSD > _OSRELEASE=3D13.0-CURRENT > OSREL=3D13.0 > OSVERSION=3D1300003 > PYTHONBASE=3D/usr/local > _SMP_CPUS=3D32 > CONFIGURE_MAX_CMD_LEN=3D262144 > HAVE_PORTS_ENV=3D1 > #### Misc Poudriere #### > GID=3D0 > UID=3D0 > PACKAGES=3D/packages >=20 > # more /etc/src.conf > /etc/src.conf: No such file or directory >=20 > # more Makefile > all: > echo ${MACHINE_ARCH} > echo ${MACHINE_CPUARCH} > echo ${CFLAGS} >=20 > # make > echo armv7 > armv7 > echo arm > arm > echo -O2 -pipe > -O2 -pipe >=20 > # grep -r "\-O2" /usr/src/share/mk/ > /usr/src/share/mk/sys.mk:CFLAGS ?=3D -O2 -pipe >=20 > # grep -r "\-pipe" /usr/src/share/mk/ > /usr/src/share/mk/sys.mk:CFLAGS ?=3D -O -pipe > /usr/src/share/mk/sys.mk:CFLAGS ?=3D -O2 -pipe >=20 > Those lines come from: >=20 > .if ${MACHINE_CPUARCH} =3D=3D "arm" || ${MACHINE_CPUARCH} =3D=3D = "mips" > CFLAGS ?=3D -O -pipe > .else > CFLAGS ?=3D -O2 -pipe > .endif >=20 > So I used: >=20 > # make -dA 2>2mmjnk.txt 1>1mmjnk.txt >=20 > and looked for the first -pipe in 2mmjnk.txt. (It is also > the first -O , in this case -O2 .) >=20 > . . . > Got = 'C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?(eb)?/arm/:C/powerpc(64|spe)= /powerpc/:C/riscv64(sf)?/riscv/' from '${__TO_CPUARCH}'} > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "mips(n32|64)?(el)?(hf)?" > Modifier pattern: "mips" > Result[MACHINE_ARCH] of :C is "amd64" > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "arm(v[67])?(eb)?" > Modifier pattern: "arm" > Result[MACHINE_ARCH] of :C is "amd64" > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "powerpc(64|spe)" > Modifier pattern: "powerpc" > Result[MACHINE_ARCH] of :C is "amd64" > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "riscv64(sf)?" > Modifier pattern: "riscv" > Result[MACHINE_ARCH] of :C is "amd64" > lhs =3D "amd64", rhs =3D "arm", op =3D =3D=3D > Got = 'C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?(eb)?/arm/:C/powerpc(64|spe)= /powerpc/:C/riscv64(sf)?/riscv/' from '${__TO_CPUARCH}'} > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "mips(n32|64)?(el)?(hf)?" > Modifier pattern: "mips" > Result[MACHINE_ARCH] of :C is "amd64" > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "arm(v[67])?(eb)?" > Modifier pattern: "arm" > Result[MACHINE_ARCH] of :C is "amd64" > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "powerpc(64|spe)" > Modifier pattern: "powerpc" > Result[MACHINE_ARCH] of :C is "amd64" > Applying[MACHINE_ARCH] :C to "amd64" > Modifier pattern: "riscv64(sf)?" > Modifier pattern: "riscv" > Result[MACHINE_ARCH] of :C is "amd64" > lhs =3D "amd64", rhs =3D "mips", op =3D =3D=3D > ParseReadLine (172): 'CFLAGS ?=3D -O2 -pipe' > Global:CFLAGS =3D -O2 -pipe >=20 > It looks like the poudriere builds based on /nxb-bin/. . . > See the amd64 MACHINE_ARCH in the context that shows: >=20 > # uname -apKU > FreeBSD FBSDamd64TR 13.0-CURRENT FreeBSD 13.0-CURRENT arm armv7 = 1300003 1300003 # grep "MACHINE_.*ARCH" 2mmjnk.txt ParseReadLine (17): 'MACHINE_CPUARCH=3D${MACHINE_ARCH:${__TO_CPUARCH}}' Global:MACHINE_CPUARCH =3D ${MACHINE_ARCH:${__TO_CPUARCH}} Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Result[MACHINE_ARCH] of :C is "amd64" ParseReadLine (12): 'MACHINE_ARCH=3Darmv7' Global:MACHINE_ARCH =3D armv7 ParseReadLine (13): 'ARCH=3D${MACHINE_ARCH}' Global:ARCH =3D ${MACHINE_ARCH} ParseReadLine (2): ' echo ${MACHINE_ARCH}' ParseReadLine (3): ' echo ${MACHINE_CPUARCH}' MACHINE_CPUARCH =3D ${MACHINE_ARCH:${__TO_CPUARCH}} MACHINE_ARCH =3D armv7 Applying[MACHINE_ARCH] :C to "armv7" Result[MACHINE_ARCH] of :C is "armv7" Applying[MACHINE_ARCH] :C to "armv7" Result[MACHINE_ARCH] of :C is "arm" Applying[MACHINE_ARCH] :C to "arm" Result[MACHINE_ARCH] of :C is "arm" Applying[MACHINE_ARCH] :C to "arm" Result[MACHINE_ARCH] of :C is "arm" MACHINE_CPUARCH =3D ${MACHINE_ARCH:${__TO_CPUARCH}} MACHINE_ARCH =3D armv7 Part of the issue is the ?=3D use from before the explicit MACHINE_ARCH assignment blocks any later ?=3D attempt form changing the result. I'll note that any of the following executing before the explicitly MACHINE_ARCH assignment would apparently get the amd64 value from the /nxb-bin/. . . context, just like the .if conditional in under investigation: # grep -r "^\..*MACHINE_ARCH" /usr/src/Makefile* /usr/src/share/mk/ = /usr/ports/Mk/ | more /usr/src/Makefile.inc1:.if ${MACHINE_ARCH} !=3D ${BUILD_ARCH} /usr/src/Makefile.inc1:.warning "To cross-build, set TARGET_ARCH = ${MACHINE_ARCH} !=3D ${BUILD_ARCH} ." /usr/src/Makefile.inc1:.if ${TARGET_ARCH} !=3D ${MACHINE_ARCH} || = ${TARGET} !=3D ${MACHINE} || \ /usr/src/Makefile.inc1:.if ${TARGET_ARCH} !=3D ${MACHINE_ARCH} || = ${BUILD_WITH_STRICT_TMPPATH} !=3D 0 /usr/src/Makefile.inc1:.elif ${TARGET_ARCH} !=3D ${MACHINE_ARCH} && = ${MK_ELFTOOLCHAIN_BOOTSTRAP} !=3D "no" /usr/src/Makefile.inc1:.if ${TARGET} =3D=3D ${MACHINE} && ${TARGET_ARCH} = =3D=3D ${MACHINE_ARCH} /usr/src/share/mk/bsd.arch.inc.mk:.elif = exists(${.CURDIR}/Makefile.${MACHINE_ARCH}) /usr/src/share/mk/bsd.arch.inc.mk:.include "Makefile.${MACHINE_ARCH}" /usr/src/share/mk/local.meta.sys.mk:.if empty(MACHINE_ARCH) /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH} =3D=3D "sparc64" /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH} =3D=3D "powerpc" /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH} =3D=3D "powerpcspe" /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH} =3D=3D "powerpc64" /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH} =3D=3D "sparc64" /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH} =3D=3D "powerpc" /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH} =3D=3D "sparc64" /usr/src/share/mk/bsd.cpu.mk:. if ${MACHINE_ARCH:Mmips*el*} !=3D "" /usr/src/share/mk/bsd.cpu.mk:. if ${MACHINE_ARCH:Mmips64*} !=3D "" /usr/src/share/mk/bsd.cpu.mk:. elif ${MACHINE_ARCH:Mmipsn32*} !=3D "" /usr/src/share/mk/bsd.cpu.mk:. if ${MACHINE_ARCH:Mmips*hf} /usr/src/share/mk/bsd.cpu.mk:. if ${MACHINE_ARCH:Marmv6*} !=3D "" /usr/src/share/mk/bsd.cpu.mk:. if ${MACHINE_ARCH:Marmv7*} !=3D "" /usr/src/share/mk/bsd.cpu.mk:. if ${MACHINE_ARCH:Marmv[67]*} =3D=3D "" /usr/src/share/mk/bsd.cpu.mk:.if ${MACHINE_ARCH:Marmv[67]*} && = defined(CPUTYPE) && ${CPUTYPE:M*soft*} !=3D "" /usr/src/share/mk/bsd.cpu.mk:.if ${MACHINE_ARCH} =3D=3D "powerpcspe" /usr/src/share/mk/bsd.cpu.mk:.if ${MACHINE_ARCH:Mriscv*sf} /usr/src/share/mk/bsd.endian.mk:.if ${MACHINE_ARCH} =3D=3D "aarch64" || = \ /usr/src/share/mk/bsd.endian.mk:.elif ${MACHINE_ARCH} =3D=3D "powerpc" = || \ /usr/ports/Mk/Uses/gnustep.mk:.if ${MACHINE_ARCH} =3D=3D "i386" (I have not tried to figure out which have a chance of executing before the MACHINE_ARCH explicit assignment.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)