Fix jni library name for PowerPC Architecture

Summary:
Right now, building rocksdbjava in PowerPC is broken due to JNI library name. I figured it out that "uname -m" and java's os.arch matches in PowerPC architecture. I made use of this advantage to fix the issue. More info can found from this issue  --> https://github.com/facebook/rocksdb/issues/1317
Closes https://github.com/facebook/rocksdb/pull/2040

Differential Revision: D4779967

Pulled By: siying

fbshipit-source-id: 259f939
main
Ayappan 8 years ago committed by Facebook Github Bot
parent 34a70859bc
commit 69c8d524a3
  1. 7
      Makefile
  2. 2
      java/src/main/java/org/rocksdb/util/Environment.java

@ -1380,7 +1380,12 @@ ifeq ($(PLATFORM), OS_SOLARIS)
else
ARCH := $(shell getconf LONG_BIT)
endif
ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so
ifeq (,$(findstring ppc,$(MACHINE)))
ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so
else
ROCKSDBJNILIB = librocksdbjni-linux-$(MACHINE).so
endif
ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar
ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar
ROCKSDB_JAVADOCS_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar

@ -42,7 +42,7 @@ public class Environment {
if (isUnix()) {
final String arch = is64Bit() ? "64" : "32";
if(isPowerPC()) {
return String.format("%sjni-linux-ppc%s", name, arch);
return String.format("%sjni-linux-%s", name, ARCH);
} else {
return String.format("%sjni-linux%s", name, arch);
}

Loading…
Cancel
Save