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 1wHbmJ-007Lcd-37 for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Apr 2026 06:18:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wHbmI-00GQWL-2D for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Apr 2026 06:18:38 +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 1wHbmI-00GQWC-1H for pgsql-hackers@lists.postgresql.org; Tue, 28 Apr 2026 06:18:38 +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 1wHbmG-00000003Tl5-1QFx for pgsql-hackers@lists.postgresql.org; Tue, 28 Apr 2026 06:18:38 +0000 Received: by mail-qt1-x841.google.com with SMTP id d75a77b69052e-50d87610513so119072201cf.3 for ; Mon, 27 Apr 2026 23:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777357114; cv=none; d=google.com; s=arc-20240605; b=NuIckHpkKzyhNOjqeJh6CezgS7q7792d6KiWhyhCaBVXDL5ToONMI+D5V5c0+tpens RTc3Lu1HfVBfioNqKo76MTcQnjCpcruJ96mCI4//BGUkhf9hh3IbSs/s7EyUJDUV4aSY UTYMcODCoMDph61ANFI0oG7Kew1OluCVmaXubdo/7kyIMQAHahvDr92VYQy/jTZl8qnC 3iWSmuNKnoD2EF8zdEyY418/76g1qek71KOCCewMW4Dz7NZQyIM/CFpsBtebRmC5YtZH y72W7MAYLkqNGhUCgGXUhWb7pHr89kaqCSkqwccXHNp+5O3j+D57hcW7E66jUg7PHb5s XPCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QRHYYFii+VZckJajSuMGyexOYmjyD1tZbIT+DtI1bh4=; fh=3b37W0H1PXVuuaUrubFsk+zfF0guABozmovikWwI4u0=; b=Xqcs//YPcxCaijaNUgfbHW4CX2b/eJ1H3SF9iBVZF/EFv0+InTAnUW+j/fjH5JCfzL D2ReIyzqUmwHOA61RD0ZTFtf0wbjWYTCNFOW3U03Exc2j/jsyPhrfAhzkeBp1H7NBDDj ygjl6w7GBnFCG8ExcM+MPifN0jB5Lv+OnghAddRwy7DpcQXbVn/eAsVMLV+K2lOh5gK1 qfqgaYdOEUsY1pjP/EW8piSwXBR0AHyon7jk8gkIUP6lNw4ORThdQaYIGCV4/6ERm2cT pr2QvJuVAdq55p6gL5PwS2ISyUnNvfTxfIAq+0CdOOVdvkVDChUtQqj61GQSEsynroA5 MSTA==; darn=lists.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=1777357114; x=1777961914; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QRHYYFii+VZckJajSuMGyexOYmjyD1tZbIT+DtI1bh4=; b=sktEc/EMmqFfNa1seV4fTUyul9WQtFSMPYYyJgYVC+ciZ/VF30Sg3Jnk/KYEP3xXqH dcx9jJsK+UOkdrv73iTPc2vgxsFR+XiSo3H7oqZOMNaKfagdZQ7zafDFbBPwaNIN23Pf zeC6TjaRnaJP2uYEsD7zC2wDTy8RjUoosAtne7iQeLGK05yJCFklykusWO5rncYTYbM5 vZkEiChpnJIUJdgVBt8UoHmZxJ6mVHIji8yEttXafPYkSOWCjgvKZniO7lCtm+H9MFam ccKUGfAonpGfajRAGHFlFGqZv0CN1oFnJvgkSllfRuOSIhj8KchC42eOA0KuGo2f5zMY C2cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777357114; x=1777961914; h=content-transfer-encoding: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=QRHYYFii+VZckJajSuMGyexOYmjyD1tZbIT+DtI1bh4=; b=MllCvRZajwK/w4lNJj9Lbx8QWoj3oRO9BvlN+J30dtSsr3oP5yeOuRH8Y5I2N685hN /0kDE35+EL5RRGtQDqKdfiupf2+WWFpDX/n0hZnYeHs3zmBCK52g0g37pSSPsUSZ4JoZ ti77165Zj+Z8PzPIhzP+NT4Z2RjLIwh+d8IocQy/+r8Mff914X7drqCnLoRj2/L5xupg rvgKQuV0jN4ocsCj6TQquTyw8x0lKGGTE3w9CFOwD3YOZaO4YE9YaTA6OJoOLosE9KBe 7HfDrzLvvC3KkDxJ9lDv5W+1wK3SOfBr1KR+1LHcMOvIm8ZCaYWvc2DJOHx8bWPvqbue vrpw== X-Forwarded-Encrypted: i=1; AFNElJ+Rvd8IvKmIyvoBjzJgK7jvc0ize4WEdJ6+VgLD26lbaDdK2vJLYPU+VEgjucuNYcq7mDWG0XqsEj0DWu+a@lists.postgresql.org X-Gm-Message-State: AOJu0Yy0ik/c36u5Z+1zouHbBQOFI6ekEcYgeFlZWXzy/msZHgBIOotS bj4RFMbilXo9qArOpgj4dD6ZdOr3MfSaMch/CiZ84jBWUWHWSXtPpcfERsaCzvOKXgBOAWgHg0s HpXI/r15RJHk18Fk9XjA3dKATNtLmXNE= X-Gm-Gg: AeBDietH8bvft8s2PYj27b0A8p70qEv/FK38GpR+6C+E4tdMY8KLghZk+xhqLNPc5WG M57We8kQndc2G2jBmh4CCUmZPysjV5t+7rVCkDaqoshyJqL7Ahno4RAviD8fCMF/kTxAipbS1Vy sT5wzfKYtnItbP+uTBS4DcEfqTzg3/s+jA/7org7XQrZnGhbRcgZYAU33Zk+cSMKlh7zI99zBZH UDnIuk8XzdR9mJxd7nD7ZGNSaY6ug3UvttaAfeNOXWXOhS7zTFNo2JD+FWsleoh3nYKP76CGUbW kEkPkPIqlCQFEIEingC3npNhoMtTf+zzMszceApux3Ggmtg+zT3zeeCrWzcViRtXv72STZ6v4a5 YflljcSaH0Run+0WJZjXsg46FY6Z4RxkAaEiicA== X-Received: by 2002:a05:622a:2c7:b0:50f:be4f:465b with SMTP id d75a77b69052e-5100e1a3f31mr23056181cf.33.1777357113892; Mon, 27 Apr 2026 23:18:33 -0700 (PDT) MIME-Version: 1.0 References: <229aaaf3-f529-44ed-8e50-00cb6909af21@Spark> <4df5af1a-8528-4f9f-9daf-ec069bd66f69@eisentraut.org> <1453046.1770218933@sss.pgh.pa.us> <1472307.1770229663@sss.pgh.pa.us> <2446899.1777256313@sss.pgh.pa.us> In-Reply-To: From: John Naylor Date: Tue, 28 Apr 2026 13:18:22 +0700 X-Gm-Features: AVHnY4J0w46hu_JiEHCusS5c6Vea7fjD7mpZzq8N1EeZO2n6cfJfLMpZG2O-Kv4 Message-ID: Subject: =?UTF-8?Q?Re=3A_=5BBUG=3F=5D_macOS_=28Intel=29_build_warnings=3A_=22ranlib=3A_fi?= =?UTF-8?Q?le_=E2=80=A6_has_no_symbols=22_for_aarch64_objects?= To: Nathan Bossart Cc: Tom Lane , Peter Eisentraut , Zhang Mingli , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 28, 2026 at 2:43=E2=80=AFAM Nathan Bossart wrote: > > On Sun, Apr 26, 2026 at 09:31:37PM -0500, Nathan Bossart wrote: > > On Sun, Apr 26, 2026 at 10:18:33PM -0400, Tom Lane wrote: > >> I previously suggested that we should teach the build systems not > >> to build the foo_x86 and foo_aarch64 modules when not on those > >> architectures. That was shot down for reasons that made no great > >> amount of sense to me, but I think it'd be fairly easy and clean. > > > > Yeah, AFAICT that's our best bet. Will write it up in the morning. The gift that keeps on giving. ;-) > Here's what I have so far. Two notes: > > * Since pg_popcount_aarch64.c only builds symbols when USE_NEON is define= d, > I needed to teach the build code about that #define. So, this patch > effectively moves USE_NEON and USE_SSE2 from c.h to pg_config.h, which > happens to be the first #include within c.h. The reason that I bring thi= s > up is because back-patching it seems a little scary, although I don't see > any concrete reasons it would be unsafe. It'd be a bit unfortunate for those symbols to bleed out into the build system, so it seems best to minimize the need for that and do as much as possible with just architecture. src/port/meson.build could do instead if host_cpu =3D=3D 'x86' or host_cpu =3D=3D 'x86_64' pgport_sources +=3D files( 'pg_cpu_x86.c', ...etc (Ditto arm / aarch64) Likewise autoconf.ac could set e.g. PG_ARCH_OBJS since it knows the host CPU as well. Some files could still guard on USE_NEON or HAVE_X86_64_POPCNTQ, but at least they wouldn't get built on the wrong arch. Would that be enough? -- John Naylor Amazon Web Services