Open robx opened 2 years ago
Setting icuEnabled
to false, the build fails with
/nix/store/q8zpwwa77zaa5h0p15iiid26g5ak6s7l-x86_64-unknown-linux-musl-binutils-2.38/bin/x86_64-unknown-linux-musl-ld:
/nix/store/bgsjggllvcb8bs47mnpyz25rq0jvb7qz-libxml2-static-x86_64-unknown-linux-musl-2.9.14/lib/libxml2.a(nanohttp.o):
in function `xmlNanoHTTPRead':
> (.text+0x10f8): undefined reference to `inflate'
For whatever it's worth pkgsStatic.xml2
builds successfully, while pkgsStatic.xmlstarlet
fails similarly. (Both of these also depend on libxml
; trying to figure out whether this is a fundamental problem with pkgsStatic
and libxml
.)
Some progress:
$PKG_CONFIG
instead of pkg-config
, though that's not enough to fix things)$PKG_CONFIG
output seems correct (i.e., with --libs libxml-2.0 --static
, it includes proper flags to link zlib)Makefile
line to not filter it: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/Makefile;h=0da848b1fd3dafeebf4c9fe0d4ff3e5e2c8c5e22;hb=278273ccbad27a8834dfdf11895da9cd91de4114#l51 (that's in postgresql 14.5, since fixed)make[3]: Entering directory '/home/rob/postgresql-14.5/src/backend/utils/mb/conversion_procs/euc_cn_and_mic'
x86_64-unknown-linux-musl-cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -fPIC -I../../../../../../src/include -D_GNU_SOURCE -I/nix/store/cks2a0805w2scxjavn8299fawadng2i6-libxml2-static-x86_64-unknown-linux-musl-2.9.14-dev/include/libxml2 -I/nix/store/yy6c26ms94fff2nckjrfjm416f7k5hvb-lz4-static-x86_64-unknown-linux-musl-1.9.4-dev/include -c -o euc_cn_and_mic.o euc_cn_and_mic.c
x86_64-unknown-linux-musl-cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -fPIC -shared -o euc_cn_and_mic.so euc_cn_and_mic.o -L../../../../../../src/port -L../../../../../../src/common -L/nix/store/bgsjggllvcb8bs47mnpyz25rq0jvb7qz-libxml2-static-x86_64-unknown-linux-musl-2.9.14/lib -L/nix/store/6hj73llfmli3d3c67lmhwc7490hx24wj-zlib-static-x86_64-unknown-linux-musl-1.2.12/lib -L/nix/store/qqq58sk2qgicygjk7z91m99kns87xm3g-lz4-static-x86_64-unknown-linux-musl-1.9.4/lib
/nix/store/q8zpwwa77zaa5h0p15iiid26g5ak6s7l-x86_64-unknown-linux-musl-binutils-2.38/bin/x86_64-unknown-linux-musl-ld: /nix/store/ravnd17fg4maxzc5ns8vbijn7ah3p4b1-x86_64-unknown-linux-musl-stage-final-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-musl/11.3.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/q8zpwwa77zaa5h0p15iiid26g5ak6s7l-x86_64-unknown-linux-musl-binutils-2.38/bin/x86_64-unknown-linux-musl-ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
Steps To Reproduce
Steps to reproduce the behavior:
E.g.,
nix build github:robx/nixpkgs/lz4-static#pkgsStatic.pg_top
does the job.Build log
Additional context
For the purpose of statically building tools that use
libpq
, we wouldn't actually need a static build of the postgresql backend. Compare https://github.com/NixOS/nixpkgs/issues/61580, which suggests a separatelibpq
package.Notify maintainers
@thoughtpolice @marsam
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.