Skip to content

libsnappyjava.so unusable on FreeBSD 12/13 #556

@michael-o

Description

@michael-o

I have at hand: 12.4-RELEASE-p7 and 13.3-PRERELEASE
Snappy from https://repo1.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.9.1/snappy-java-1.1.9.1.jar

When trying to load the native library it does not work and here is the reason:

/tmp/snappy/org/xerial/snappy/native/FreeBSD/x86_64
$ ldd ./libsnappyjava.so
./libsnappyjava.so:
        libstdc++.so.6 => not found (0)
        libm.so.5 => /lib/libm.so.5 (0x82ed4a000)
        libc.so.7 => /lib/libc.so.7 (0x8214b6000)

libstdc++.so.6 is available in https://www.freshports.org/misc/compat9x/, quite old.

Compiling myself works if you patch the Makefile to use LLVM and not GCC:

$ git diff -U0
diff --git a/Makefile.common b/Makefile.common
index 9eba009..3ac5676 100755
--- a/Makefile.common
+++ b/Makefile.common
@@ -272 +272 @@ Mac-aarch64_LIBNAME   := libsnappyjava.dylib
-FreeBSD-x86_64_CXX          := $(CROSS_PREFIX)g++
+FreeBSD-x86_64_CXX          := $(CROSS_PREFIX)c++

Output:

$ ldd target/classes/org/xerial/snappy/native/FreeBSD/x86_64/libsnappyjava.so   target/classes/org/xerial/snappy/native/FreeBSD/x86_64/libsnappyjava.so:
        libc++.so.1 => /usr/lib/libc++.so.1 (0x333c081da000)
        libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x333c086cc000)
        libm.so.5 => /lib/libm.so.5 (0x333c09ca0000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x333c0a98a000)
        libc.so.7 => /lib/libc.so.7 (0x333c051d5000)

Note: I don't use Snappy, but noticed this when analyzing test failures for Apache Flink: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225203

Installed misc/compat9x:

$ ldd org/xerial/snappy/native/FreeBSD/x86_64/libsnappyjava.so
org/xerial/snappy/native/FreeBSD/x86_64/libsnappyjava.so:
        libstdc++.so.6 => /usr/local/lib/compat/libstdc++.so.6 (0x1b4017dd4000)
        libm.so.5 => /lib/libm.so.5 (0x1b401a158000)
        libc.so.7 => /lib/libc.so.7 (0x1b401446a000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x1b4018fbe000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions