From nobody Sun Feb 19 03:16:40 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gs2WcGz3sb4T; Sun, 19 Feb 2023 03:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gs0kWwz4Kdp; Sun, 19 Feb 2023 03:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Npurq8e2zkw653xmo4X5i1WdourewXCrZGLNWTX7Teg=; b=vL3Gk1j19Ik27k5p2WUr5388g3Pj5oCe0bE46FKWQiRVhkaADhQUMuENp3mUN8kRDnq7dX Squo+i3MBoiRsrcggT+d3CRat8xI2qWDraPA22Dilpl/EvPIQtG7ny/0LaEdAWHkAo6Z7E s6Jr7MrxWtcOKvW8R0SvxsCv96aDxSDzyKwWgVHqj48Va6UqKraMHvSazV6SWgLmKYOLot H6zuNiGATCWDeoIL2JpSdkV3QP0ydGMLGvJ2pHD6+mA1ieDvnI/b2YU4W3ZjFRVbuwrHnO Sd9rWKBo/T7umh5IkbhfdWAWTi3JOSs1/ySny2mkibKuLyQyt1ed59iIiKznhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Npurq8e2zkw653xmo4X5i1WdourewXCrZGLNWTX7Teg=; b=AETPVp1OVlJgt0VFXI0K1Yow3jDK57pszjrGGXtTyqTGv0k0J9z4KrLCQa3Xxx2PrjPgQv Oi0zFrFMPfUacYh/VP4HvFRHF/iK8EMO927lp/6uC8oKwV51jKYxYDE9LkJn0jBbf2QCAG uWZhBSlAfMzytvlDDtqMSGVnD19gOH7flhqUBhREq0cr7XuLX+mkL+l/pFQIFGclbITaWm K81rH8x0EjOFptUf+wqTIK9f9z9c7zqT32c9Wxbncbk6nm5pJbFzOILUb/tkbG7viY7Ay2 vsw/Z4fV8wAFwqGi9bJc81UOY+3tze7bKFaS2mX9OKOTdUDEzT7CKe3tRvPnrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776601; a=rsa-sha256; cv=none; b=PvyVC8KwV2yI9OuGpTjXYpE/MFtQe02MEiLokiiE8qhrEUL45cggBzjwWwifm/EKvOqfG4 YDmubNcKnN+zP5j7p2tAa6ZW5wxb+nUrdBx3Mj7FC/zweynuBlw4jwrrv9h1fIyTB8m+xv 4qTM+RG6bq77MP01lZweaGVskIgra0jgaBJx3N5KI8g9wkZiQu0uMQ2L0nyKkKGzh2rIgG Ik37tuYNReE+ud0ieBDImnX164yHjkCsHJbBtoSDKnLqU1z40N4eX3L/M00dVYJ0GAn6HA p3d7SN62/tlhijPabwdPUAdxr3N5awflCA7tK2TAm11KRIh+AvAiD11eyIDCFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gr63f3zn2x; Sun, 19 Feb 2023 03:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31J3GeRk084021; Sun, 19 Feb 2023 03:16:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3Ge2V084020; Sun, 19 Feb 2023 03:16:40 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:40 GMT Message-Id: <202302190316.31J3Ge2V084020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: bae5c73a5ffa - releng/13.2 - sys/_endian.h: Move powerpc workaround into _endian.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: bae5c73a5ffa237e437605bbf2216a574d1dbda2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bae5c73a5ffa237e437605bbf2216a574d1dbda2 commit bae5c73a5ffa237e437605bbf2216a574d1dbda2 Author: Warner Losh AuthorDate: 2023-02-16 16:58:33 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:14:36 +0000 sys/_endian.h: Move powerpc workaround into _endian.h Powerpc compilers often define _BIG_ENDIAN or _LITTLE_ENDIAN depending on the byte order of the target. This interfers with the endian.h and sys/endian.h APIs which expect those two to be 4321 or 1234. Unconditionally undefine these two before we define them to work around this issue. By including endian.h, the programmer is saying they want this API not the native one. This matches historic practice as well. Fixes: e35448a901aa Sponsored by: Netflix Noticed by: powerpc, powerpc64 CI jobs Approved by: re (cperciva) (cherry picked from commit 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b) (cherry picked from commit 07e39710b170859ef6a57185f9a775973f3eeffe) --- sys/sys/_endian.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h index ff909f532663..7ac39386e2e1 100644 --- a/sys/sys/_endian.h +++ b/sys/sys/_endian.h @@ -41,9 +41,13 @@ /* * Definitions for byte order, according to byte significance from low - * address to high. + * address to high. We undefine any prior definition of them because + * powerpc compilers define _LITTLE_ENDIAN and _BIG_ENDIAN to mean + * something else. */ +#undef _LITTLE_ENDIAN #define _LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ /* LSB first: 1234 */ +#undef _BIG_ENDIAN #define _BIG_ENDIAN __ORDER_BIG_ENDIAN__ /* MSB first: 4321 */ #define _PDP_ENDIAN __ORDER_PDP_ENDIAN__ /* LSB first in word, * MSW first in long: 3412 */