public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: John Naylor <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Zhang Mingli <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: [BUG?] macOS (Intel) build warnings: "ranlib: file … has no symbols" for aarch64 objects
Date: Tue, 28 Apr 2026 09:29:41 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANWCAZYFAP_fP0RSnor9Aa03aYAvQaM=+8oNeZSV432RNNynkQ@mail.gmail.com>
References: <b3e0930c-e86c-4a6e-8059-281424ca6d69@Spark>
	<229aaaf3-f529-44ed-8e50-00cb6909af21@Spark>
	<[email protected]>
	<[email protected]>
	<aYN5vmHb89m3sfgs@nathan>
	<[email protected]>
	<aYOTFLqyvvPUQLN8@nathan>
	<ae7BvFTamKBDF1ga@nathan>
	<[email protected]>
	<ae7KiQcfDaavu5cD@nathan>
	<ae-8WBrqoTWYCTCG@nathan>
	<CANWCAZYFAP_fP0RSnor9Aa03aYAvQaM=+8oNeZSV432RNNynkQ@mail.gmail.com>

John Naylor <[email protected]> writes:
> 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 == 'x86' or host_cpu == 'x86_64'
>   pgport_sources += files(
>   'pg_cpu_x86.c',
>   ...etc

This level of refinement is about what I was imagining for the
build systems.  Otherwise, if we add any more platform sub-categories
to those files, we'll have to complicate the build systems to match.

I'm not sure if we need to care about suppressing these warnings to
a greater degree than that.  My impression is that it won't be an
issue for macOS because of the uniformity of the underlying hardware.

If we do care, a low-tech solution could be to have a dummy symbol
declared in each file, along the lines of

#if HAVE_X86_64_POPCNTQ
// code for popcntq case
#elif HAVE_FROBNITZ
// code for frobnitz case
...
#else
/* prevent linker complaints about empty module */
extern int pg_cpu_x86_dummy_variable;
int	pg_cpu_x86_dummy_variable = 0;
#endif

Actually then we'd not need to change the build systems either...

			regards, tom lane





view thread (22+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [BUG?] macOS (Intel) build warnings: "ranlib: file … has no symbols" for aarch64 objects
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox