openslide-bin icon indicating copy to clipboard operation
openslide-bin copied to clipboard

Linux build failing during compiling

Open NorbertIonita opened this issue 8 months ago • 1 comments

I need to build locally OpenSlide 4.0.0.6 and all of its dependencies and I am using the following commands:

  1. docker run -ti --rm -v ${PWD}:/work -w /work ghcr.io/openslide/linux-builder bash
  2. ./bintool bdist
  3. meson setup build -Ddefault_library=shared --cross-file machines/native-linux-x86_64.ini
  4. meson compile -C build

During the last command I am getting the following build error: Image

And this is the end of the build logs: Image

Is there anything I am missing or have not done properly?

NorbertIonita avatar Apr 22 '25 12:04 NorbertIonita

It turns out that -Wl,--exclude-libs,ALL in native-linux-x86_64.ini, which is necessary to prevent re-exporting of dependencies' symbols from the unified libopenslide.so, also prevents the jpeg12_* and jpeg16_* symbols from being re-exported from their static libraries when linked into libjpeg.so. OpenSlide currently doesn't use 12- and 16-bit JPEG functionality, but the libtiff wrap doesn't have a user-facing option to avoid it.

The cleanest workaround is to remove -Wl,--exclude-libs,ALL from native-linux-x86_64.ini. This will also prevent similar issues with any other dependencies that build their shared libraries from separate static libraries.

(Unrelated: you don't need to run bintool bdist. The manual meson invocations replace the bintool run.)

bgilbert avatar Apr 23 '25 04:04 bgilbert