Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

[PATCH] Hide non-JNI symbols from native_ref-linux libs #55

Closed
@kkofler

Description

@kkofler

Add an ld version script to the GNU/Linux native_ref JNI libraries,
hiding all the symbols except for the Java_* JNI symbols. This matches
the other platforms, which only export explicitly exported symbols.

GNU/Linux defaults to exporting all symbols. For C and C++ code, this
can be overridden by compiling it with the -fvisibility=hidden flag, but
gfortran does not support that flag, so it has to be done at link time
through the --version-script linker flag. Without the symbol.map version
script, all the symbols of the bundled reference BLAS, LAPACK and ARPACK
(and also some internal functions of the JNI wrapper itself) were being
exported, causing symbol conflicts.

One example of such a symbol conflict is MATLAB: Loading JAVA code using
netlib-java into MATLAB and using the native_ref implementation would
crash MATLAB, due to symbol conflicts between MATLAB's versions of BLAS
and LAPACK and the native_ref ones. (This was found during testing at
the University of Vienna.)

I uploaded the patch exported from git to:
http://repo.calcforge.org/temp/0001-Hide-non-JNI-symbols-from-native_ref-linux-libs.patch
(because I cannot attach non-image files directly).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions