Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wLCDA-001bc1-2B for pgsql-hackers@arkaria.postgresql.org; Fri, 08 May 2026 03:49:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wLCD9-007arm-1q for pgsql-hackers@arkaria.postgresql.org; Fri, 08 May 2026 03:49:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wLCD9-007arZ-0v for pgsql-hackers@lists.postgresql.org; Fri, 08 May 2026 03:49:11 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wLCD7-000000018vO-07Lp for pgsql-hackers@postgresql.org; Fri, 08 May 2026 03:49:11 +0000 Received: by mail-qt1-x841.google.com with SMTP id d75a77b69052e-50e5b55062fso11701231cf.2 for ; Thu, 07 May 2026 20:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778212147; cv=none; d=google.com; s=arc-20240605; b=QlvWoa8z7hTq41lrHdGGOfC4h4NT9ZyxJpWJMlV+DwX7xwaaoBEmsTFPkynXuD6YOJ B7TxJW3OADD6IaHxlmBYGnslubQvgrvKxmKpE47tR+YnCFiroA9sDMQ6yEQosoAYzLU/ fQ/+d1GDqMbWkyN7K27tUzuKmfe0wWoY0O/bu8EeoYEsFwJqlhj0lij3ujy+TvyghAY1 NSr0jGxVjECwat124TdzJFissQqNffIZ1Yv+x9HoRUSPXGMXYJtV+YJsH5No9JYs54Uf GH//2l5SSViJP3syn4H8G64J+Yjl/v8nzlz0qRNcbHhBJA56nkP7dQVpekXzhAQasV5K STeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=dZj12iSWHVqwEDsnknIs7z+b/gjagaqrUYhO5WpV3Wk=; fh=nHKs/s0QmV575JJuYrO6yU0LiSuI3WD6LkgNVHBD7FA=; b=XO6X0Ww5/MH617WxUUmQJsQFYAPN7tSYxfBiHH2AEXKuGe5eZCNLtkioBbDxizMpeL ZpW8Mz4q1rVm0G3VxkiMm7m3GRWGCrJ5WB272m3L8avhwT7UAVMIIewzLBzS1fupmZRm 76fFJQ3/qvCyiy8trYeT7ISjBTDn0irQBVydUOYJbh+Tti8d0OS+FFjNweQIskxp6oKu oNWpsKVp2Nof/+ngVHYIQN+vNwszel2/RpEm3CReLV/3E+YjAYEAJVsQi0mHdb3ABQdi uPxma/oaZ4IH42mDrCNtu8pCDnFaaXJX1BBppEYwFM7to1ZmufQj302IcwL00KzIK5Lb GORw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778212147; x=1778816947; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dZj12iSWHVqwEDsnknIs7z+b/gjagaqrUYhO5WpV3Wk=; b=QsBXJR/o5yqQS359Q5HuhdO2NKhBlddk43CLdsm2oWqrFwdPtC2C8QxMdt3EXu/QOd uzLL1HMmhWOdzrYE6ImndHTpBLIMV7BAKOXAQOcpbRCWzCqGDLMiphYCj2PhcPcYVDY8 dxbd4BkglYQEQ9y5rCjjN9jz3OjXX+3AbmsKYPk5i0WkQrUEPFySqj1r3AJk+mj6+QQb Jqbw5+U6nOo66zsLH1E2vTqE7iQhJn8Yj8L8vNrp52ZVsNzz/9/wCix/vAk1VyVWunv6 mti/otO/Zj2GYCuCS1VWtKOVHABOfBPvW8f5LSXjdjEFQBv3leRbFB/NopWvXsmVPiMX mr3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778212147; x=1778816947; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dZj12iSWHVqwEDsnknIs7z+b/gjagaqrUYhO5WpV3Wk=; b=CUxF5MpxHZyty2TyKIPWEJp4ZthEZTmIchWAHg6KTl2lEeln/BuNGCQe6FCY0Z1Ppd wK+MaIghJuf0pJEpXM/gCb+7zhJNLrl/b51uShCuHh/DOI9ZhvvnT+6shsy1SHzFUzxm uuDM0hwegG+Zfcev/sBf2Asw3z/dwlJ4gkjw+vgMdrREHSqg2HfvXEXt+GMOtmlg0ioC FO48g9v0I4dd3LohwaZJ2wd6OYc5Xd+ENwd5mcbur2sZ9oRA13l08P3TqaoNjAZWu1sD nBaXi88mGOH1gQl4Q+hswjyIwGqj7EIRuOe+OSl9rjPphhRdiwveBxwCMLFFM8T6trZW Ob8w== X-Forwarded-Encrypted: i=1; AFNElJ9pTAhtvIwXbYw0RSclWe6peVB6F5Hrx7ahhcW6xt7EEgSw6NkCzOf6sZi35hHB3foA1++v8H8TIiSczRr2@postgresql.org X-Gm-Message-State: AOJu0YzbWg2aZ17f5H75bAgLpXQIeTOKwEiEfutlADEghiNfoSIcPpAo bFr2SVaq5BGpGmuz8RXtQoDaf2P3bD8hk19zkHEKe6fTaI9zMGZVtkCS3IP4ETZ3avDmQ7tuXI0 2yweOHHGb5+xOoY3h7NlcL1etI65o6WA= X-Gm-Gg: AeBDiesbUNYv4hNwtv+k894cLPby5uNQIhcTxbAL1VZb83SZHK9itq9G37s5uu5ToRp CT4iiEesvxXa/OlGzQNW0PvAKhCdVnxDxDNjDbFf8AVvUC3nstbl0zHf8CTq0rKLFrrnkKHCv+I r0gzfR2huwXJ0DjUn/6WPieR2czOjL0y93PwdCwmCG48pCSBgWIDcTVjBcdd9TidmfwtPA8onc1 Qkoq5lgy4NsXBBewNc7Bmz/mM9mTxaE4KUFUkfF7Yt8oEDhNaSxvlZNMZgxSSsQxz2vCZTQEQV6 1wHIPsdhIoV43YCwF3sN1BhOsb6kyxOrRplDfQXSG7D1Svh6qsQU0ZBkhMcKe7Y01eX+MeTvUuW k5Jwll7J4mrwWm0HFFOTjTBVeC9c= X-Received: by 2002:a05:622a:1148:b0:50e:5c31:5d56 with SMTP id d75a77b69052e-51461be0503mr149673831cf.6.1778212146931; Thu, 07 May 2026 20:49:06 -0700 (PDT) MIME-Version: 1.0 References: <223EA201-A0E8-4A13-B220-EB903E8DF817@eggerapps.at> <871806.1778168884@sss.pgh.pa.us> <873909.1778170924@sss.pgh.pa.us> In-Reply-To: From: John Naylor Date: Fri, 8 May 2026 10:48:55 +0700 X-Gm-Features: AVHnY4LYWbmpKQ_f0M9lbsCJp9V3Cu4Z3uGD4SC8W4SgyCqz0jrY_7fReirlssI Message-ID: Subject: Re: Broken build on macOS (Universal / Intel): cpuid instruction not available To: Lukas Fittl Cc: Tom Lane , Jakob Egger , pgsql-hackers , Tobias Bussmann , Andres Freund Content-Type: multipart/mixed; boundary="0000000000005b1d9206514647af" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005b1d9206514647af Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 8, 2026 at 12:34=E2=80=AFAM Lukas Fittl wrote= : > > On Thu, May 7, 2026 at 9:22=E2=80=AFAM Tom Lane wrote= : > > > > I wrote: > > > ... The code in HEAD doesn't have > > > that guard, and is essentially assuming that every x86 platform > > > wil provide HAVE__GET_CPUID or HAVE__CPUID. > > > > Independently of whether macOS multi-arch is something we consider > > supportable, I think the aforesaid assumption is a bad idea. > > Can't we make pg_cpuid() return zeroes if it doesn't know how to > > get the info, analogously to what pg_cpuid_subleaf() does? Yeah, that seems like a good assumption to remove. Jakob and Tobias, how far do you get with the attached, at least for the target x86 case? And it might help if you sent the configure output in a file so we can see what we're dealing with. Note also that we have two build systems, since we'll likely transition away from autotools: https://wiki.postgresql.org/wiki/Meson > Having worked in that area in this cycle, I think returning zeroes (or > adding a return value that confirms we got data) Speaking of return values, the TSC feature as committed doesn't actually use the return value of pg_cpuid_subleaf(), but it seems like something we could use someday. I don't see such a use for pg_cpuid() beyond having zero values in the 4 variables. > could work for the > TSC related functionality, since we just fall back to the system clock > and disallow TSC use if we can't get CPUID data. I'll let John confirm > if there are any other optimizations that require CPUID data. Yes there are, but everything should still fallback gracefully without it. -- John Naylor Amazon Web Services --0000000000005b1d9206514647af Content-Type: text/x-patch; charset="US-ASCII"; name="dont-assume-cpuid-available.patch" Content-Disposition: attachment; filename="dont-assume-cpuid-available.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mowde7xm0 ZGlmZiAtLWdpdCBhL3NyYy9wb3J0L3BnX2NwdV94ODYuYyBiL3NyYy9wb3J0L3BnX2NwdV94ODYu YwppbmRleCBmMjIxNjdkYTlhZi4uZjYxZjA5NDA0MzEgMTAwNjQ0Ci0tLSBhL3NyYy9wb3J0L3Bn X2NwdV94ODYuYworKysgYi9zcmMvcG9ydC9wZ19jcHVfeDg2LmMKQEAgLTYzLDEyICs2MywxMSBA QCBtYXNrX2F2YWlsYWJsZSh1aW50MzIgdmFsdWUsIHVpbnQzMiBtYXNrKQogc3RhdGljIGlubGlu ZSB2b2lkCiBwZ19jcHVpZChpbnQgbGVhZiwgdW5zaWduZWQgaW50ICpyZWcpCiB7CisJbWVtc2V0 KHJlZywgMCwgNCAqIHNpemVvZih1bnNpZ25lZCBpbnQpKTsKICNpZiBkZWZpbmVkKEhBVkVfX0dF VF9DUFVJRCkKIAlfX2dldF9jcHVpZChsZWFmLCAmcmVnW0VBWF0sICZyZWdbRUJYXSwgJnJlZ1tF Q1hdLCAmcmVnW0VEWF0pOwogI2VsaWYgZGVmaW5lZChIQVZFX19DUFVJRCkKIAlfX2NwdWlkKChp bnQgKikgcmVnLCBsZWFmKTsKLSNlbHNlCi0jZXJyb3IgY3B1aWQgaW5zdHJ1Y3Rpb24gbm90IGF2 YWlsYWJsZQogI2VuZGlmCiB9CiAK --0000000000005b1d9206514647af--