From owner-freebsd-arm@freebsd.org Sat Sep 21 08:17:13 2019 Return-Path: Delivered-To: freebsd-arm@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 4F03AFB55E for ; Sat, 21 Sep 2019 08:17:13 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46b3N76zfMz4G53 for ; Sat, 21 Sep 2019 08:17:11 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x8L8GtP4060121 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 21 Sep 2019 18:17:01 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x8L8GnT0029891 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 21 Sep 2019 18:16:49 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x8L8GnY7029890 for freebsd-arm@freebsd.org; Sat, 21 Sep 2019 18:16:49 +1000 (AEST) (envelope-from peter) Date: Sat, 21 Sep 2019 18:16:49 +1000 From: Peter Jeremy To: freebsd-arm@freebsd.org Subject: ARM programs expecting misspelt __ARM_ARCH_6ZK__ Message-ID: <20190921081649.GM97181@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xQR6quUbZ63TTuTU" Content-Disposition: inline X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46b3N76zfMz4G53 X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-7.58 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[rulingia.com]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-3.18)[ip: (-9.91), ipnet: 2001:19f0:5800::/38(-4.94), asn: 20473(-1.01), country: US(-0.05)] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 08:17:13 -0000 --xQR6quUbZ63TTuTU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable When GCC introduced support for the ARMv6KZ architecture, it misspelt it as ARMv6ZK. This only affects arm1176jz-s and arm1176jzf-s but, unfortunately, this includes the BCM2835 as used in the RaspberryPi Model 1. This has been corrected in FreeBSD (see r312292 and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D216104) and GCC (see https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01679.html) and appears to have never been present in Clang. Unfortunately, it seems that various freeware still expects to find __ARM_ARCH_6ZK__, rather than the correct __ARM_ARCH_6KZ__. Within FreeBSD-13, there are references to __ARM_ARCH_6ZK__ (only) in: contrib/openmp/runtime/src/kmp_platform.h contrib/subversion/subversion/libsvn_subr/lz4/lz4.c crypto/openssl/crypto/arm_arch.h sys/arm/include/acle-compat.h sys/contrib/zstd/lib/legacy/zstd_v0?.c sys/contrib/zstd/lib/common/xxhash.c sys/contrib/zstd/lib/common/mem.h In most cases, the incorrect definition just leads to poor code (because the relevant model-specific optimisations aren't enabled) but some ports are fussier: I discovered the problem because ports/security/libressl won't build on my RPi since libressl refuses to build if it doesn't find an __ARM_ARCH_.* definition that it likes. Fixing FreeBSD base code is technically fairly easy. Fixing every port that potentially checks for __ARM_ARCH_6ZK__ is much harder (somewhat on a par with fixing the assumption that FreeBSD-1* is a.out, not ELF). I had a quick check through my ports distfiles and __ARM_ARCH_6ZK__ is referenced more often than I'd expect. The options for ports would seem to be: 1) Hack clang to export __ARM_ARCH_6ZK__ as well as __ARM_ARCH_6KZ__ 2) Expect every port maintainer to fix subtle misbehavour on the RPi1 by adding appropriate patches. 3) When building on ARM, run a sed script that fixes any occurrences of __ARM_ARCH_6ZK__. --=20 Peter Jeremy --xQR6quUbZ63TTuTU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl2F3GtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRciQ//UyI1ByXjdSABY+EiT4wJvXAn1V4gXnkX1kmdfEbPMlolGOJfKnL66Uf9 pMo6gECRUkvQxiooF5pJIIqv/vGJHUtQjL1J1ZQp5vWrBCuBr54XhXoCcn4fJtoy lRrZaMSOv58UQpNy48wa8PtOp05AtqgOZ964TLk+8L1jW8oQ944E/m4yD5tf8w0U r1ACg3kut6cja4chg+ejDjyARjDC+NBTZfyF+QYLlVms6L299rLPhz6j+H2ZmKC+ 5P/QECftOt6U7XYwrueK9h4uBDFvfHVWoLSBCMqgcVREQX0j93qCdu2QRigAV82/ P9pWHgTli2DW1jyFXnJXJph6P3am/endCUnxJUJ7C4Moge6Ykc2GPhKrtGAMYT36 ZndCMxGzNRkzVxeunf2heZu8g3UbKrHtSTc3Eplt2zSiwQcBSKVwDmr6u8bmzuYd FLwOSvYac4KoSfNGpnBwxCUvnYQLv/+UbGBEs8YtI9h7sbKk+ukNvpr40f21MOxc pYO/bz1FSxAmzbsp25j2OM6/XXAbYRdmdrzvk53iQclUATqvAPZvpPPPrAWydv1A VzP6MOoVvdKFM2Li5VG3pXTfSQWvjCTjs/5sC3wAzjX9xag80NdjXkYBBaVAktwY 2fWibufZD8CQiV98MDTe0+jQHazyqN4MD8ME9KXB6uaQOopEbK8= =LkkM -----END PGP SIGNATURE----- --xQR6quUbZ63TTuTU--