amazon-linux-2023
amazon-linux-2023 copied to clipboard
[Bug] - pg_config has wrong LDFLAGS set
Describe the bug
Package libpq-devel-15.0-2.amzn2023.0.1.x86_64 has some strange LDFLAGS set, which in consequence leads to
/usr/bin/ld: cannot open linker script file /builddir/build/BUILD/postgresql-15.0/.package_note-libpq-15.0-2.amzn2023.0.1.x86_64.ld: No such file or directory
To Reproduce
❯ docker run public.ecr.aws/amazonlinux/amazonlinux:2023 bash -c 'dnf install postgresql-devel -y -q >/dev/null; pg_config --ldflags; rpm -qf $(command -v pg_config)'
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/postgresql-15.0/.package_note-libpq-15.0-2.amzn2023.0.1.x86_64.ld -Wl,--as-needed
libpq-devel-15.0-2.amzn2023.0.1.x86_64
On AL2
it is
❯ docker run public.ecr.aws/amazonlinux/amazonlinux:2 bash -c 'yum install postgresql-devel -y -q >/dev/null; pg_config --ldflags; rpm -qf $(command -v pg_config)'
-Wl,-z,relro -Wl,--as-needed
postgresql-9.2.24-8.amzn2.0.1.x86_64
And with postgresql15-server-devel
on AL2023
❯ docker run public.ecr.aws/amazonlinux/amazonlinux:2023 bash -c 'dnf install postgresql15-server-devel -y -q >/dev/null; pg_config --ldflags; rpm -qf $(command -v pg_config)'
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -L/usr/lib64 -Wl,--as-needed
postgresql15-private-devel-15.4-1.amzn2023.0.1.x86_64
Having kind of a deja vu - https://github.com/amazonlinux/amazon-linux-2023/issues/239 ;)
Different package, same problem, same solution(s): Short term patching libpq.spec with %undefine _package_note_flags
and rebuild. Mid term - waiting for you to rebuild the package....