Welcome! Log In Create A New Profile

Advanced

Nginx won't build with xslt into static linked binary

Kevin Weis via nginx
February 12, 2023 11:32AM
Hi,
I aim to build nginx from source, statically linked, and run into issues
when `http_xslt_module` is enabled or I'm building with NJS 0.7.10
(which also needs xslt).

I've created a simplified docker build to debug this issue at
https://git.compilenix.org/CompileNix/docker-nginx-static

The error occures while running `./auto/configure` if
`--with-ld-opt="-static"` is added. The build succeeds without it
(remove line 176 from Dockerfile).

The configure ends with:
```
checking for libxslt ... not found
checking for libxslt in /usr/local/ ... not found
checking for libxslt in /usr/pkg/ ... not found
checking for libxslt in /opt/local/ ... not found

./auto/configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.
```

The issue is not that libxml2 and libxslt aren't installed, they are.

I've looked into why libxslt is reported to be "not found" by inspecting
the configure log file `objs/autoconf.err`, which shows the following error:
``
checking for libxslt

/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../lib/libxml2.a(libxml2_la-xmlIO.o):
in function `xmlFreeZMemBuff':
/home/buildozer/aports/main/libxml2/src/libxml2-2.10.3/xmlIO.c:1482:
undefined reference to `deflateEnd'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld:
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../lib/libxml2.a(libxml2_la-xmlIO.o):
in function `xmlGzfileOpenW':
/home/buildozer/aports/main/libxml2/src/libxml2-2.10.3/xmlIO.c:1172:
undefined reference to `gzdopen'

<for more see full build log linked below>
```

Here is the full build log:
https://compilenix.org/static/95Yeyaxv/build-static.log

If you are wondering why I also build libxslt from source instead of
using the alpine `libxslt-dev` package.. `libxslt-dev` does not contain
"libxslt.a", which is required for static linking.

Additionally: I've also looked into other distros like ubuntu, fedora or
gentoo. None of them install "libxslt.a" and show the same configure
error messages.

Steps to reproduce:
```
git clone https://git.compilenix.org/CompileNix/docker-nginx-static.git
cd docker-nginx-static
./build.sh -t docker-nginx-static --no-cache | tee build.log
```

Any help, suggestions or hints are very welcome :)

--
Best regards
Kevin Weis
Pronouns: he / him

https://compilenix.org
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx won't build with xslt into static linked binary

Kevin Weis via nginx February 12, 2023 11:32AM

Re: Nginx won't build with xslt into static linked binary

Maxim Dounin February 12, 2023 05:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 219
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready