From the exp-run in PR258872 https://pkg-status.freebsd.org/gohan05/data/mainamd64PR258872-default/2023-04-05_14h36m44s/logs/errors/postgresql13-client-13.10.log ========== STRIPPROG='strip -x' /bin/sh ../../../config/install-sh -c -m 644 -s libpq.a '/wrkdirs/usr/ports/databases/postgresql13-client/work/stage/usr/local/lib/libpq.a' strip: error: '/wrkdirs/usr/ports/databases/postgresql13-client/work/stage/usr/local/lib/_inst.20299_': not stripping symbol '.L.str' because it is named in a relocation ========== pgsql's build has requested to strip all non-global symbols (strip -x), but there is at least one non-global symbol that in fact cannot be stripped because it is referenced by a relocation. Both GNU strip and ELF Tool Chain strip silently handle this case (and just retain the local symbol), but LLVM strip is stricter and emits an error upon request to strip a non-removable local symbol. There is an LLVM ticket open for this at https://github.com/llvm/llvm-project/issues/47468. It probably makes sense for LLVM strip to behave the same as GNU and ELF Tool Chain strip, but I believe pgsql should just not use strip -x when there are symbols that cannot be stripped. My suggestion would be to consider just not stripping .a archives.
Submitted pgsql bug: BUG #17898: Build failure when strip is LLVM's version
https://reviews.freebsd.org/D39590
I think this should propagate upstreams, to the postgresql community. Right?
Tom Lane replied and the change to use --strip-unneeded has been applied upstream: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a14afd3bdc21c0c56401fb8cb2fce74f4b7dc446 I'm not sure what the timeline is for pgsql updates though, we might want to apply it as a local patch until the next update comes along?
Yeah, I started the conversation upstreams, and it is now it is patched. We should make a local patch until the upstream change hits us. I'll handle that. :)
I see that pgsql was updated in 3fd6f200dc8c12022515f7c3f662df148941e261, did it bring in the strip change?
(In reply to Ed Maste from comment #6) I hae to check, but yes, the idea was that this was fixed upstreams.
This was fixed upstreams with the latest patch release: commit 6dce37203410b011c0ccae40acf2649f79c38242 Author: Tom Lane <tgl@sss.pgh.pa.us> Date: Thu Apr 20 18:12:32 2023 -0400 Use --strip-unneeded when stripping static libraries with GNU strip. We've long used "--strip-unneeded" for shared libraries but plain "-x" for static libraries when stripping symbols with GNU strip. There doesn't seem to be any really good reason for that though, since --strip-unneeded produces smaller output (as "-x" alone does not remove debug symbols). Moreover it seems that llvm-strip, although it identifies as GNU strip, misbehaves when given "-x" for this purpose. It's unclear whether that's intentional or a bug in llvm-strip, but in any case it seems like changing to use --strip-unneeded in all cases should be a win. Note that this doesn't change our behavior when dealing with non-GNU strip. Per gripes from Ed Maste and Palle Girgensohn. Back-patch, in case anyone wants to use llvm-strip with stable branches. Discussion: https://postgr.es/m/17898-5308d09543463266@postgresql.org Discussion: https://postgr.es/m/20230420153338.bbj2g5jiyy3afhjz@awork3.anarazel.de