Closed imdurgadas closed 4 years ago
Have you also hit any issues described in #63?
I think the junixsocket-native compilation is for Linux/macOS x86_64 only. The supported method should be using cross compilation with clang
.
I'm working on s390x support myself as well but with the clang
cross compile method instead.
I also had no luck with the clang
cross compilation method. Linking fails due to missing elf64_s390
emulation in llvm
.
See: https://github.com/llvm/llvm-project/blob/cce47418c93bcd178379fa8c4df5c3327bc19802/lld/ELF/Driver.cpp#L125.
Only little-endian architectures are supported.
I have a LinuxONE Community Cloud z/VM 6.4 guest running on the mainframe of Marist College (see: https://developer.ibm.com/linuxone/). I chose SLES12-SP3 but llvm
with clang
is not supported/available.
So I branched llvm 3.8.0 intended for SLES12-SP3 in OBS:
https://build.opensuse.org/project/show/home:spars_instana:sle12sp3-llvm3.8
and installed it from there.
I've prepared two patches to compile junixsocket
with clang
on that s390x machine:
https://github.com/sriemer/junixsocket/commits/s390x
It compiles fine with IBM Java 8, clang, llvm, and
mvn clean install -Dmaven.javadoc.skip=true -Dpmd.skip=true
now. The only disadvantage is that I cannot run the tests as those also require at least Java 9.
But I get:
./junixsocket-native/target/nar/junixsocket-native-2.2.1-SNAPSHOT-s390x-Linux-clang-jni/lib/s390x-Linux-clang/jni/libjunixsocket-native-2.2.1-SNAPSHOT.so
and build success. I guess this is the best we can get for now.
@imdurgadas Can you please test if this works for you as well? TIA
@kohlschuetter Do you maybe have other ideas how to include s390x in the official build? Can we maybe just let it pick up the libraries which were natively built with clang on IBM LinuxONE Community Cloud? Can you please look at my patches? TIA
The demo app is running with my s390x build and this has been confirmed working in customer environment by the way.
@sriemer yup, steps you mentioned worked for me as well.
junixsocket/junixsocket-native/target/nar/junixsocket-native-2.2.1-SNAPSHOT-s390x-Linux-clang-jni/lib/s390x-Linux-clang/jni# ls
history.xml libjunixsocket-native-2.2.1-SNAPSHOT.so
Would you like to add a s390x Jenkins slave so you can build this regularly? I have a server where you can build things natively so I assume that means you could use gcc as well as clang. This is also on the LinuxONE system but it's not subject to their 180 day limit. I use it to build a number of FOSS projects.
The builder uses the AdoptJDK rather than the rpm. The former has a JIT whereas the latter is still running in interpreter mode.
I'm trying to get it to build as part of Zimbra FOSS but I can't seem to get the jni portion built - no errors it just doesn't even try so I will try and build it standalone to see what I'm missing in Zimbra (which knows nothing about s390x).
@nealef That would be perfect.
My branch https://github.com/sriemer/junixsocket/commits/s390x
also builds with java-1_8_0-openjdk-devel
, maven 3.6.1, and llvm 3.8.0 from https://build.opensuse.org/project/show/home:spars_instana:sle12sp3-llvm3.8
on SLES12-SP3 s390x.
Build command: mvn clean install -Dmaven.javadoc.skip=true -Dpmd.skip=true
clang
has its advantages over gcc
for portable builds. So the mainline build should always use clang
. The junixsocket-native
compile is not prepared for using a different linker than clang
. Even the Windows build uses clang
together with mingw-gcc
. In junixsocket-native/crossclang/bin/
, thegcc
file is a symlink to clang
.
I have two Jenkins slaves you can plug into: one running SLES15 and the other running a CentOS 7.6.1810 clone. I think the latter may be problematic as maven is lower than the level you specify - even the software collection is only at 3.5. LLVM is at the right level on both systems. Let me know how you want to proceed and I'll set things up.
SLES15 sounds nice to me but actually only because I worked at SUSE before. :wink: Thanks!
To apply my 2..4 patches for s390x on top, a git fetch upstream && git rebase upstream/master
would be required, once a new master commit is available.
Still waiting how @kohlschuetter wants to integrate the s390x build. I'm a C developer and no Java/Maven expert. I think @kohlschuetter is the only person with all cross clang target-sdks installed. At Instana, we just extract (jar -xf ...
) the lib/junixsocket-native-common-XXX.jar
in the junixsocket-dist
archive, add the s390x-Linux-clang/
directory to lib/
and compress (jar -cf ...
) this again.
Got no clue how to automate that in the release build @kohlschuetter is using.
Actually, rh-maven35 will be fine. It only seems to need maven >= 3.1.1 and llvm 3.4.2 so building on my CentOS clone works.
Fixed, please verify on junixsocket 2.3.0. Thanks!
I tried building
junixsocket-native:2.0.4
from source by adding s390x specific details in theaol.properties
. With this the build succeeded but i could not findlibjunixsocket-native-2.0.4.so
in the /target/nar/junixsocket-native- /lib/ /jni path. Note: .so file is created in x86(amd64) arch.@kohlschuetter Any idea on what is preventing the .so files from getting generated ?
aol.properties
Traces:
CMD: root@d704538f7c93:/home/durgadas/installer-build/junixsocket/junixsocket-native# ls target/nar/ Result : javah-include/ nar-generated/