Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling JRuby

The jruby.jar package, on which the earlier Logstash version depends, does not support AArch64. As a result, the error message "Unsupported platform: unknown-linux" will be displayed when Logstash is started.

  1. Download the source code and decompress it.
    1
    2
    wget https://github.com/jruby/jruby/archive/1.7.27.tar.gz -O jruby-1.7.27.tar.gz
    tar -zxvf jruby-1.7.27.tar.gz
    
  2. Go to the directory decompressed.
    1
    cd jruby-1.7.27
    
  3. Modify the source code core/src/main/java/org/jruby/ext/ffi/Platform.java.
    1. Open the source code file.
      1
      vi core/src/main/java/org/jruby/ext/ffi/Platform.java
      
    2. Press i to enter the insert mode and modify the file.
      1. Add AARCH64 to line 87.

      2. Add the AARCH64 branch to lines 149 and 150.

      3. Add the AARCH64 branch to line 209.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Modify the pom.xml file.
    1. Open the file.
      1
      vi pom.xml
      
    2. Press i to enter the insert mode. In line 71, change the jffi version from 1.2.12 to 1.2.13 (jffi 1.2.13 supports AArch64).
      1
      <jffi.version>1.2.13</jffi.version>
      

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Modify the core/pom.xml file.
    1. Open the file.
      1
      vi core/pom.xml
      
    2. Press i to enter the insert mode. In line 101, change the jnr-ffi version from 2.0.9 to 2.1.0.
      1
      2
      <artifactId>jnr-ffi</artifactId>
      <version>2.1.0</version>
      

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Perform the compilation.
    1
    mvn package
    

    The operation is successful if information similar to the following is displayed:

    The compiled jruby.jar file is in the lib directory.

  7. Use the Kunpeng Porting Advisor to scan jruby.jar.
    • jruby.jar is compatible with multiple platforms. It contains both x86 and AArch64 .so files. Therefore, it can be used if x86 .so files are found.
    • For details about how to use the Kunpeng Porting Advisor, see Kunpeng Porting Advisor Case Study.