Re: Tomcat Native on M1 Macs

2022-04-05 Thread Christopher Schultz

Robert, Brian,

On 4/5/22 13:59, Robert Turner wrote:

I think you need to use an ARM-based JVM -- IIRC, you will need Corretto
JDK 18 I think, otherwise it will be running in emulation.


+1

M1 macs can run either x86_84 code OR arm64, but not both in the same 
process.


If you want to run tcnative in your JVM, the architectures of the 
binaries (JVM, tcnative, libapr, libssl, etc.) all have to match each other.


On 4/5/22 13:59, Robert Turner wrote:

Does anyone have instructions for compiling Native on an ARM-based
Mac? Or suggestions around this issue?
For the tcnative build, you should be able to build an x86_86 binary 
like this:


$ arch
arm64
$ intel
$ arch
i386
$ make distclean
$ ./configure ...
$ make

I think you'll end up with an x86-64 tcnative binary.

Thanks,
-chris


On Tue, Apr 5, 2022 at 1:56 PM Paquin, Brian  wrote:


After compiling Tomcat Native (that comes with Tomcat 9.0.62, version
1.2.32) on a (ARM) M1 Mac (with Amazon Coretto 11 JDK, APR, and OpenSSL
1.1.1n), I get the following error in Catalina.out:

05-Apr-2022 11:10:32.307 WARNING [main]
org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native
library failed to load. The error reported was
[/Library/Java/Extensions/libtcnative-1.0.dylib:
dlopen(/Library/Java/Extensions/libtcnative-1.0.dylib, 0x0001): tried:
'/Library/Java/Extensions/libtcnative-1.0.dylib' (mach-o file, but is an
incompatible architecture (have 'arm64', need 'x86_64')),
'/usr/lib/libtcnative-1.0.dylib' (no such file)]
 java.lang.UnsatisfiedLinkError:
/Library/Java/Extensions/libtcnative-1.0.dylib:
dlopen(/Library/Java/Extensions/libtcnative-1.0.dylib, 0x0001): tried:
'/Library/Java/Extensions/libtcnative-1.0.dylib' (mach-o file, but is an
incompatible architecture (have 'arm64', need 'x86_64')),
'/usr/lib/libtcnative-1.0.dylib' (no such file)

Note: After I compiled Native, I did the following (we did this in the
past but I don’t know if it is still required):

   1.  cp
/usr/local/tomcat/bin/tomcat-native-1.2.32-src/native/.libs/libtcnative-1.0.dylib
/Library/Java/Extensions
   2.  cd /Library/Java/Extensions
   3.  ln -sfhv libtcnative-1.0.dylib libtcnative-1.dylib
   4.  ln -sfhv libtcnative-1.dylib libtcnative-1.jnilib
(Not sure if this is needed anymore…)

Does anyone have instructions for compiling Native on an ARM-based Mac? Or
suggestions around this issue?

Thank you,

Brian





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Native on M1 Macs

2022-04-05 Thread Robert Turner
I think you need to use an ARM-based JVM -- IIRC, you will need Corretto
JDK 18 I think, otherwise it will be running in emulation.

On Tue, Apr 5, 2022 at 1:56 PM Paquin, Brian  wrote:

> After compiling Tomcat Native (that comes with Tomcat 9.0.62, version
> 1.2.32) on a (ARM) M1 Mac (with Amazon Coretto 11 JDK, APR, and OpenSSL
> 1.1.1n), I get the following error in Catalina.out:
>
> 05-Apr-2022 11:10:32.307 WARNING [main]
> org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native
> library failed to load. The error reported was
> [/Library/Java/Extensions/libtcnative-1.0.dylib:
> dlopen(/Library/Java/Extensions/libtcnative-1.0.dylib, 0x0001): tried:
> '/Library/Java/Extensions/libtcnative-1.0.dylib' (mach-o file, but is an
> incompatible architecture (have 'arm64', need 'x86_64')),
> '/usr/lib/libtcnative-1.0.dylib' (no such file)]
> java.lang.UnsatisfiedLinkError:
> /Library/Java/Extensions/libtcnative-1.0.dylib:
> dlopen(/Library/Java/Extensions/libtcnative-1.0.dylib, 0x0001): tried:
> '/Library/Java/Extensions/libtcnative-1.0.dylib' (mach-o file, but is an
> incompatible architecture (have 'arm64', need 'x86_64')),
> '/usr/lib/libtcnative-1.0.dylib' (no such file)
>
> Note: After I compiled Native, I did the following (we did this in the
> past but I don’t know if it is still required):
>
>   1.  cp
> /usr/local/tomcat/bin/tomcat-native-1.2.32-src/native/.libs/libtcnative-1.0.dylib
> /Library/Java/Extensions
>   2.  cd /Library/Java/Extensions
>   3.  ln -sfhv libtcnative-1.0.dylib libtcnative-1.dylib
>   4.  ln -sfhv libtcnative-1.dylib libtcnative-1.jnilib
> (Not sure if this is needed anymore…)
>
> Does anyone have instructions for compiling Native on an ARM-based Mac? Or
> suggestions around this issue?
>
> Thank you,
>
> Brian
>


Tomcat Native on M1 Macs

2022-04-05 Thread Paquin, Brian
After compiling Tomcat Native (that comes with Tomcat 9.0.62, version 1.2.32) 
on a (ARM) M1 Mac (with Amazon Coretto 11 JDK, APR, and OpenSSL 1.1.1n), I get 
the following error in Catalina.out:

05-Apr-2022 11:10:32.307 WARNING [main] 
org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native 
library failed to load. The error reported was 
[/Library/Java/Extensions/libtcnative-1.0.dylib: 
dlopen(/Library/Java/Extensions/libtcnative-1.0.dylib, 0x0001): tried: 
'/Library/Java/Extensions/libtcnative-1.0.dylib' (mach-o file, but is an 
incompatible architecture (have 'arm64', need 'x86_64')), 
'/usr/lib/libtcnative-1.0.dylib' (no such file)]
java.lang.UnsatisfiedLinkError: 
/Library/Java/Extensions/libtcnative-1.0.dylib: 
dlopen(/Library/Java/Extensions/libtcnative-1.0.dylib, 0x0001): tried: 
'/Library/Java/Extensions/libtcnative-1.0.dylib' (mach-o file, but is an 
incompatible architecture (have 'arm64', need 'x86_64')), 
'/usr/lib/libtcnative-1.0.dylib' (no such file)

Note: After I compiled Native, I did the following (we did this in the past but 
I don’t know if it is still required):

  1.  cp 
/usr/local/tomcat/bin/tomcat-native-1.2.32-src/native/.libs/libtcnative-1.0.dylib
 /Library/Java/Extensions
  2.  cd /Library/Java/Extensions
  3.  ln -sfhv libtcnative-1.0.dylib libtcnative-1.dylib
  4.  ln -sfhv libtcnative-1.dylib libtcnative-1.jnilib
(Not sure if this is needed anymore…)

Does anyone have instructions for compiling Native on an ARM-based Mac? Or 
suggestions around this issue?

Thank you,

Brian