Re: [BUG?] macOS (Intel) build warnings: "ranlib: file … has no symbols" for aarch64 objects

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Zhang Mingli <zmlpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, johncnaylorls(at)gmail(dot)com
Subject: Re: [BUG?] macOS (Intel) build warnings: "ranlib: file … has no symbols" for aarch64 objects
Date: 2026-04-27 19:43:20
Message-ID: ae-8WBrqoTWYCTCG@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Here's what I have so far. Two notes:

* Since pg_popcount_aarch64.c only builds symbols when USE_NEON is defined,
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 this
up is because back-patching it seems a little scary, although I don't see
any concrete reasons it would be unsafe.

* pg_cpu_x86.c has a similar problem, which I haven't fixed yet.
Presumably a similar approach will work there. I've added John Naylor to
this thread for his thoughts.

--
nathan

Attachment Content-Type Size
v1-0001-avoid-ranlib-warnings-on-macOS.patch text/plain 10.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-04-27 19:49:57 Re: Randomize B-Tree page split location to avoid oscillating patterns
Previous Message Peter Geoghegan 2026-04-27 18:07:14 Re: Randomize B-Tree page split location to avoid oscillating patterns