nilsvanvelzen / mac_ppc_openjdk8u60

openjdk8 for Mac OSX 10.5 PowerPC
GNU General Public License v2.0
21 stars 3 forks source link

Errors with Nimbus source files: [Error] encoded value was… #2

Open barracuda156 opened 1 year ago

barracuda156 commented 1 year ago
Generating Nimbus source files
[Error] encoded value was less than 0: encode(-8.326673E-17, 5.0, 11.0, 16.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] Encountered Infinity: encode(-0.00877193, 0.0, 7.0, 7.0)

Have you seen these errors? They do not cause the build fail straightaway, but look unpleasant enough :)

barracuda156 commented 2 months ago

@nilsvanvelzen I decided to start from making your code compile with as minimal changes as possible, and once/provided that works, finalize my patches for the latest OpenJDK 8 version.

The exact script does not work for me, but after some trial-and-error I got the build running quite far (it is slow on a single core, I will try using all four next time). Interestingly, I see the same Nimbus errors (they do not stop compilation):

[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)
[Error] encoded value was greater than 3: encode(15.029411, 1.0, 14.0, 15.0)
[Error] encoded value was less than 0: encode(-0.05882353, 1.0, 24.0, 25.0)

Good thing is that despite these, the code is supposed to be functional, from what I understood.

If this works out, should I use 7 or newly-built 8 to build the latest 8?

nilsvanvelzen commented 2 months ago

Hi @barracuda156. This is a rather old project on which I have not worked recently. But it is great that you try to figure out how to get the latest code changes of OpenJDK working (I have tried it some time ago but run into issues).

I cannot recall seeing these endoding errors in the past but that is no 100% guarantee they were not present already.

In is a good practice to bootstrap the build with itself, however I was always happy with the initial result which I used to get my opensourde project OpenDA (data assimilation framework) running.

Have fun, nice to see people pick it up where I left it.

barracuda156 commented 2 months ago

@nilsvanvelzen Thank you for responding. Have you ever tried to build it headful, but with X11 backend (Cocoa is broken, and I think no point bothering to fix it)? That should be possible in principle, and such approach works elsewhere (SDL2 as one example), but the source of OpenJDK is a mess, it is hard to figure out what exactly is to be changed. When I was trying to build newer versions in MacPorts env, it kept failing on AWT stuff.

barracuda156 commented 2 months ago

Build is done.

I had to fix this bug: https://www.mail-archive.com/bug-guix@gnu.org/msg37421.html (just borrow their patch) And also temporarily swap Kerberos headers from 10.6.8 into my 10a190 (it is bad, but I do not know how to fix it otherwise; possibly, building against 10.5 sysroot could work, but I am not sure I want that).

barracuda156 commented 2 months ago

I am not sure binaries are okay though LOL

36-25% /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/build/macosx-ppc-normal-zero-release/images/j2sdk-image/bin/java -version
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (os_bsd_zero.cpp:246), pid=67301, tid=11779
#  fatal error: caught unhandled signal 10 at address 0x0000022c
#
# JRE version:  (8.0) (build )
# Java VM: OpenJDK Zero VM (25.60-b23 interpreted mode bsd-ppc )
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/hs_err_pid67301.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
zsh: abort       -version
barracuda156 commented 2 months ago

The same via GDB:

Program received signal SIGBUS, Bus error.
[Switching to process 67444 thread 0x2e03]
0x0018bf18 in Auto::Zone::register_thread ()
(gdb) where
#0  0x0018bf18 in Auto::Zone::register_thread ()
#1  0x0726c324 in java_start ()
#2  0x006ce064 in _pthread_start ()
nilsvanvelzen commented 2 months ago

About a non headless version -note, even is you build a headless version you have to explicitly start java in headless mode (otherwise it will crash, not sure whether that is in any form related to the crash you encounter) -Yes I have tried very hard in the past to get a full version working (including jdk7). But since they have moved to an interface that is available from snow-leopard onwards I got stuck there. I know there used to be a project that implements Cocoa stuff from snow leopard for leopard but that was intel only. I have spent a lot of time trying the Linux build route to get a working version on Mac. This needs a lot of work, since the build system makes all kinds of suggestions once it noticed it is compiling on Mac. In those attempts I got stuck (if I recall well, since it was years ago) on ALSA for which there is not (dummy) implementation available for Mac.

barracuda156 commented 2 months ago

I know there used to be a project that implements Cocoa stuff from snow leopard for leopard but that was intel only.

We have 10.6 on PowerPC now, however I am afraid the issues are not only about SDK, but also about the compiler, and gcc cannot build “modern” Apple ObjC, while clangs are broken for powerpc. So Cocoa may be a lost case.

Also, specifically Java framework is Intel-only (whether in 10.6.8 release or in whatever development builds we have), so linking to it won’t be possible, and as I recall, AWT libs rely on system Java being present.

My hope was BSD/Linux-style build, but yes, the build system is carefully designed in a way to have it broken beyond any trivial repair LOL It is as bad as Qt5 in this sense.

barracuda156 commented 2 months ago

BTW, this also could be bootstrap JDK differences: I have been using openjdk7u2-macppc-fcs-2012-03-14 one.

barracuda156 commented 2 months ago

note, even is you build a headless version you have to explicitly start java in headless mode (otherwise it will crash, not sure whether that is in any form related to the crash you encounter)

@nilsvanvelzen From the crash log it looks like the option was passed correctly:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (os_bsd_zero.cpp:246), pid=3325, tid=11779
#  fatal error: caught unhandled signal 10 at address 0x0000022c
#
# JRE version:  (8.0) (build )
# Java VM: OpenJDK Zero VM (25.60-b23 interpreted mode bsd-ppc )
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x05d0d4e0):  VMThread [stack: 0x00000000,0x00000000] [id=11779]

Stack: [0x00000000,0x00000000],  sp=0xf0283d0c,  free space=3934735k

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x07804a00 JavaThread "Unknown thread" [_thread_in_vm, id=6403, stack(0xf0083000,0xf0203000)]

Other Threads:
=>0x05d0d4e0 VMThread [stack: 0x00000000,0x00000000] [id=11779]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 def new generation   total 4928K, used 18K [0x20200000, 0x20750000, 0x35750000)
  eden space 4416K,   0% used [0x20200000, 0x20204960, 0x20650000)
  from space 512K,   0% used [0x20650000, 0x20650000, 0x206d0000)
  to   space 512K,   0% used [0x206d0000, 0x206d0000, 0x20750000)
 tenured generation   total 10944K, used 0K [0x35750000, 0x36200000, 0x60200000)
   the space 10944K,   0% used [0x35750000, 0x35750000, 0x35750200, 0x36200000)
 Metaspace       used 535K, capacity 2200K, committed 2200K, reserved 4400K

Card table byte_map: [0x074b5000,0x076b6000] byte_map_base: 0x073b4000

Polling page: 0x00134000

CodeCache: size=32768Kb used=34Kb max_used=34Kb free=32733Kb
 bounds [0x08000000, 0x08028000, 0x0a000000]
 total_blobs=33 nmethods=0 adapters=28
 compilation: disabled (interpreter mode)

Compilation events (0 events):
No events

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (0 events):
No events

Events (10 events):
Event: 0.664 loading class java/lang/Short done
Event: 0.664 loading class java/lang/Integer
Event: 0.669 loading class java/lang/Integer done
Event: 0.669 loading class java/lang/Long
Event: 0.680 loading class java/lang/Long done
Event: 0.682 loading class java/lang/NullPointerException
Event: 0.682 loading class java/lang/NullPointerException done
Event: 0.682 loading class java/lang/ArithmeticException
Event: 0.682 loading class java/lang/ArithmeticException done
Event: 0.683 Thread 0x07804a00 Thread added: 0x07804a00

Dynamic libraries:
0x0001f000  /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x00345000  /System/Library/Frameworks/Security.framework/Versions/A/Security
0x00023000  /usr/lib/libz.1.dylib
0x00036000  /usr/lib/libgcc_s.1.dylib
0x0068a000  /usr/lib/libSystem.B.dylib
0x008dc000  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x00b3e000  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x00ee0000  /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x01c15000  /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x00046000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x01d81000  /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x0005d000  /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x01f1c000  /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x0202d000  /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x024dd000  /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x0254c000  /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x00063000  /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x00175000  /usr/lib/libauto.dylib
0x02922000  /usr/lib/libicucore.A.dylib
0x02afb000  /usr/lib/libxml2.2.dylib
0x02c39000  /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
0x02c8c000  /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x000d0000  /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x00078000  /usr/lib/liblangid.dylib
0x001b4000  /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x02d3e000  /usr/lib/libobjc.A.dylib
0x02dd1000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x02e93000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x02fa6000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x036d4000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x03770000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x037f5000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x0020c000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x00000000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x03a0d000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x03aec000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x000e2000  /usr/lib/system/libmathCommon.A.dylib
0x03b0e000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x03ebd000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x037e5000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x0403e000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x04181000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x0423d000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x0428d000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x0436a000  /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x043a3000  /usr/lib/libbsm.0.dylib
0x043bb000  /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
0x043cf000  /usr/lib/libstdc++.6.dylib
0x00109000  /usr/lib/system/libkxld.dylib
0x04483000  /usr/lib/libsqlite3.0.dylib
0x04540000  /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x04597000  /usr/lib/libxslt.1.dylib
0x045cc000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
0x04631000  /usr/lib/libcrypto.0.9.8.dylib
0x000eb000  /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x04765000  /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
0x047e1000  /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x04910000  /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x0498c000  /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x04a10000  /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x04ac7000  /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x05172000  /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x05683000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x00123000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x056d2000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x00116000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x056f4000  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x0571d000  /usr/lib/libcups.2.dylib
0x00000000  /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x05756000  /usr/lib/libresolv.9.dylib
0x0577f000  /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x05793000  /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x057c0000  /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x057d6000  /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
0x0012c000  /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
0x05822000  /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x0588c000  /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x058c3000  /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
0x0014c000  /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
0x07000000  /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/build/macosx-ppc-normal-zero-release/images/j2sdk-image/jre/lib/server/libjvm.dylib
0x05a3a000  /opt/local/lib/libffi.8.dylib
0x05a43000  /usr/local/lib/libgcc_s.1.dylib
0x05a79000  /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/build/macosx-ppc-normal-zero-release/images/j2sdk-image/jre/lib/libverify.dylib
0x05a85000  /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/build/macosx-ppc-normal-zero-release/images/j2sdk-image/jre/lib/libjava.dylib
0x00153000  /usr/lib/info/dns.so
0x05ad0000  /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/build/macosx-ppc-normal-zero-release/images/j2sdk-image/jre/lib/libzip.dylib

VM Arguments:
jvm_args: -Djava.awt.headless=true -Xmx1024M -Djava.awt.headless=true 
java_command: <unknown>
java_class_path (initial): .
Launcher Type: SUN_STANDARD

Environment Variables:
_JAVA_OPTIONS=-Xmx1024M -Djava.awt.headless=true
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin
SHELL=/bin/zsh
DISPLAY=/tmp/launch-6QXJ9Y/org.macports:0

Signal Handlers:
SIGSEGV: [libjvm.dylib+0x2e9b60], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.dylib+0x2e9b60], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.dylib+0x26a690], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.dylib+0x26a690], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.dylib+0x26a690], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.dylib+0x26a690], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x26bd44], sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART

---------------  S Y S T E M  ---------------

OS:Bsduname:Darwin 10.0.0d2 Darwin Kernel Version 10.0.0d2: Fri Oct 10 19:37:52 PDT 2008; root:xnu-1346.7~1/RELEASE_PPC Power Macintosh
rlimit: STACK 0k, CORE 0k, NPROC 0, NOFILE 0, AS infinity
load average:8.57 8.87 8.79

CPU:total 4 

Memory: 4k page, physical 16777216k(4194304k free)

/proc/meminfo:

vm_info: OpenJDK Zero VM (25.60-b23) for bsd-ppc JRE (1.8.0-internal-svacchanda_2024_07_07_12_08-b00), built on Jul  7 2024 12:30:04 by "svacchanda" with gcc 4.2.1 (Apple Inc. build 5626)

time: Sun Jul  7 21:19:58 2024
elapsed time: 0 seconds (0d 0h 0m 0s)
nilsvanvelzen commented 2 months ago

jvm_args: -Djava.awt.headless=true -Xmx1024M -Djava.awt.headless=true -> yes it is.. from the call stack I cannot make much. I suppose it crashes immediately at initialisation/startup

barracuda156 commented 2 months ago

From the OS side crash log has this:

Process:         java [91445]
Path:            /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/build/macosx-ppc-normal-zero-release/images/j2re-image/bin/java
Identifier:      java
Version:         ??? (???)
Code Type:       PPC (Native)
Parent Process:  zsh [16029]

Date/Time:       2024-07-07 17:13:04.616 +0800
OS Version:      Mac OS X 10.6 (10A190)
Report Version:  6

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  3

Application Specific Information:
abort() called

Thread 0:
0   libSystem.B.dylib               0x0068ad98 mach_msg_trap + 8
1   libSystem.B.dylib               0x00692614 mach_msg + 56
2   libSystem.B.dylib               0x008063b8 _dispatch_mach_msg_4CF + 132
3   com.apple.CoreFoundation        0x00995f14 __CFRunLoopRun + 1904
4   com.apple.CoreFoundation        0x009220ac CFRunLoopRunSpecific + 668
5   java                            0x0000763c CreateExecutionEnvironment + 988 (java_md_macosx.c:334)
6   java                            0x00005278 JLI_Launch + 1892 (java.c:237)
7   java                            0x00009ca8 main + 132 (main.c:125)
8   java                            0x000021c0 start + 64

Thread 1:
0   libSystem.B.dylib               0x00691e10 __semwait_signal + 12
1   libSystem.B.dylib               0x006ec41c pthread_join$UNIX2003 + 908
2   java                            0x00006964 ContinueInNewThread0 + 152 (java_md_macosx.c:864)
3   java                            0x000023fc ContinueInNewThread + 196 (java.c:2007)
4   java                            0x000066d0 JVMInit + 300 (java_md_macosx.c:1061)
5   java                            0x000056e0 JLI_Launch + 3020 (java.c:304)
6   java                            0x00009ca8 main + 132 (main.c:125)
7   java                            0x00006f4c apple_main + 112 (java_md_macosx.c:320)
8   libSystem.B.dylib               0x006ce060 _pthread_start + 320

Thread 2:
0   libSystem.B.dylib               0x00691e10 __semwait_signal + 12
1   libSystem.B.dylib               0x006cf3b0 _pthread_cond_wait + 1524
2   libjvm.dylib                    0x07055750 os::PlatformEvent::park() + 212
3   libjvm.dylib                    0x0704c2e4 __ZL10ParkCommonP9ParkEventx + 152
4   libjvm.dylib                    0x0704cb24 Monitor::IWait(Thread*, long long) + 140
5   libjvm.dylib                    0x0704cd68 Monitor::wait(bool, long, bool) + 216
6   libjvm.dylib                    0x0726cb70 os::create_thread(Thread*, os::ThreadType, unsigned long) + 412
7   libjvm.dylib                    0x072c5cec Threads::create_vm(JavaVMInitArgs*, bool*) + 656
8   libjvm.dylib                    0x071b14dc JNI_CreateJavaVM + 108
9   java                            0x00002dbc JavaMain + 296 (java.c:1214)
10  libSystem.B.dylib               0x006ce060 _pthread_start + 320

Thread 3 Crashed:
0   libSystem.B.dylib               0x00798a44 __semwait_signal_nocancel + 8
1   libSystem.B.dylib               0x007984f0 nanosleep$NOCANCEL$UNIX2003 + 172
2   libSystem.B.dylib               0x007913ec usleep$NOCANCEL$UNIX2003 + 68
3   libSystem.B.dylib               0x007ae810 abort + 124
4   libjvm.dylib                    0x0705508c os::abort(bool) + 32
5   libjvm.dylib                    0x0706ecfc VMError::report_and_die() + 2016
6   libjvm.dylib                    0x07027480 report_vm_error(char const*, int, char const*, char const*) + 100
7   libjvm.dylib                    0x0726da04 JVM_handle_bsd_signal + 628
8   libjvm.dylib                    0x0726a6c4 signalHandler(int, __siginfo*, void*) + 52
9   libSystem.B.dylib               0x00709290 _sigtramp + 64

Thread 3 crashed with PPC Thread State 32:
  srr0: 0x00798a44  srr1: 0x0000d030   dar: 0x0004181c dsisr: 0x40000000
    r0: 0x00000173    r1: 0xf0283c50    r2: 0x0085b808    r3: 0x0000003c
    r4: 0x00000000    r5: 0x00000001    r6: 0x00000001    r7: 0xf0283cf8
    r8: 0x00000118    r9: 0x00989680   r10: 0x006d6bc4   r11: 0x000016dd
   r12: 0x00798444   r13: 0x00000000   r14: 0x00000000   r15: 0x00000000
   r16: 0x00000000   r17: 0x07371c78   r18: 0x00000000   r19: 0x07356cc4
   r20: 0x0085a8e0   r21: 0x0085a8e0   r22: 0xf02841a0   r23: 0x0736e524
   r24: 0x0736e524   r25: 0xf0283f3c   r26: 0x073574ec   r27: 0x0735e524
   r28: 0x0736e524   r29: 0xf0283cf8   r30: 0x00000000   r31: 0x00798450
    cr: 0x22002448   xer: 0x00000000    lr: 0x007984f4   ctr: 0x00798444
vrsave: 0x00000000
barracuda156 commented 2 months ago

May be it is due to commented out lines with objc_registerThreadWithCollector?

barracuda156 commented 2 months ago

I think I have fixed it :)

36-25% /Users/svacchanda/Github_barracuda156/mac_ppc_openjdk8u60/build/macosx-ppc-normal-zero-release/images/j2sdk-image/bin/java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-svacchanda_2024_07_07_13_52-b00)
OpenJDK Zero VM (build 25.60-b23, interpreted mode)

objc_registerThreadWithCollector does not seem to work on 10a190 either (and I understand why it was commented out – crash log points to that line), but it has to be commented out in another place as well, which is missed here.

nilsvanvelzen commented 2 months ago

Well done! If you have a fork of your code and you want me to try to test it, just let me know. I'll then fire up my G5 somewhere this week and compile/test your updated code.

barracuda156 commented 2 months ago

Well done! If you have a fork of your code and you want me to try to test it, just let me know. I'll then fire up my G5 somewhere this week and compile/test your updated code.

@nilsvanvelzen Will be nice, thank you.

Let me try building the new version, if that works, I make a finalized headless-ppc branch, if it fails and I cannot fix it easily, then I just add a few commits on top on this master. I also wanna see if new gcc with libatomic builtins works (if I run into many issues with this, I just revert to gcc-4.2 and your sync implementation; I really wanna avoid using something like gcc6 or gcc7, let it be either the current ones or the default Xcode).

Will deal with this tonight.

barracuda156 commented 2 months ago

@nilsvanvelzen A quick question: I am building via MacPorts env now, and I got an error looking like bin/sh: fork: resource temporarily unavailable. Is it that issue which you have addressed via ulimit in your build script? Looks like MacPorts sterilizes that, but we can pass it via the portfile code.

For now, I just changed to the source directory and resumed the build manually. I can do destroot via MacPorts then (provided build succeeds), and it installs normally. But I have to ensure it is reproducible.

So far looks like gcc14 works fine, no errors.

nilsvanvelzen commented 2 months ago

Yes, if I recall well that is indeed why I have added the ulimit in the build script.

barracuda156 commented 2 months ago

So yeah, we will have more issues with new versions. Resources errors seem to be resolved by setting this:

36-25% sudo sysctl -w kern.maxproc=2500
kern.maxproc: 532 -> 2500
36-25% sudo sysctl -w kern.maxprocperuid=2500
kern.maxprocperuid: 266 -> 2500

(ulimit does not help and apparently not even honored.)

Then there are some ObjC-related errors (forward-porting working code gonna likely work), and gcc14 nastiness LOL

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_java_openjdk8/openjdk8/work/jdk8u-jdk8u372-ga/jdk/src/share/bin/splashscreen_stubs.c:68:5: error: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_java_openjdk8/openjdk8/work/jdk8u-jdk8u372-ga/jdk/src/solaris/native/java/net/Inet6AddressImpl.c:287:15: error: implicit declaration of function 'lookupIfLocalhost' [-Wimplicit-function-declaration]

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_java_openjdk8/openjdk8/work/jdk8u-jdk8u372-ga/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c:76:17: error: passing argument 1 of '_setjmp' from incompatible pointer type [-Wincompatible-pointer-types]

Then there is this: https://trac.macports.org/ticket/67123 (I knew about that but forgot).

Need to restart the build afresh, since I need to ensure flags are passed.

barracuda156 commented 2 months ago

And we need this:

    #if defined(__GNUC__) && !defined(__private_extern__)
    #define __private_extern__ __attribute__((visibility("hidden")))
    #endif

On a number of instances. Anyway, I will commit all these first.

barracuda156 commented 2 months ago

Spent more than an hour digging into the code and commit history trying to figure out why linking of libnio fails – until I checked symbols’ list in libnet. Everything needed was already there. Linking kept failing, because I had unrelated libnet installed in MacPorts prefix, and who knew it is there and gonna cause a breakage.

Also, unfortunately, no-parallel build is still needed (though if doing it manually, you can go with several cores and if that fails, resume on one core).

barracuda156 commented 2 months ago

@landonf Landon, you have worked on OpenJDK 7 for macOS earlier, could you please help us a bit with some advice? Looks like we are getting the headless version to build. However it would be nice to have GUI, and for that we need to switch the build to X11 and avoid broken Cocoa. Maybe you did something like that with JDK 7 for PowerPC?

barracuda156 commented 2 months ago

[Removed, since logs quoted in this comment are irrelevant: on this attempt I missed to apply the atomics patch]

barracuda156 commented 2 months ago

Oh wait, I somehow missed to apply my patch for atomics -_-

And since I dropped a custom implementation, it just fails there:

#ifndef _LP64
extern "C" {
  long long unsigned int __sync_val_compare_and_swap_8(
    volatile void *ptr,
    long long unsigned int oldval,
    long long unsigned int newval) {
    ShouldNotCallThis();
    return 0; // silence compiler warnings
  }
};
#endif // !_LP64
barracuda156 commented 2 months ago

Rebuilt with the new builtin, looks like it does not want to work. Binary does not crash, but it just does nothing when lauched.

Sampling process 800 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling java (pid 800) every 1 millisecond
Call graph:
    2419 Thread_2903
      2419 start
        2419 main
          2419 JLI_Launch
            2419 CreateExecutionEnvironment
              2419 CFRunLoopRunSpecific
                2419 __CFRunLoopRun
                  2419 _dispatch_mach_msg_4CF
                    2419 mach_msg
                      2419 mach_msg_trap
                        2419 mach_msg_trap
    2419 Thread_2a03
      2419 _pthread_start
        2419 apple_main
          2419 main
            2419 JLI_Launch
              2419 ContinueInNewThread
                2419 ContinueInNewThread0
                  2419 pthread_join$UNIX2003
                    2419 __semwait_signal
                      2419 __semwait_signal
    2419 Thread_2b03
      2419 _pthread_start
        2419 JavaMain
          2419 JNI_CreateJavaVM
            2419 Threads::create_vm(JavaVMInitArgs*, bool*)
              2419 __ZN10JavaThreadC4Eb
                2419 __ZN6ThreadC4Ev
                  2419 ParkEvent::Allocate(Thread*)
                    2419 Thread::SpinAcquire(int volatile*, char const*)
                      2417 os::naked_short_sleep(long long)
                        2415 nanosleep$UNIX2003
                          2412 __semwait_signal
                            2412 __semwait_signal
                          3 cthread_set_errno_self
                            3 cthread_set_errno_self
                        2 cerror
                          2 cerror
                      2 os::is_MP()
                        2 os::is_MP()

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        __semwait_signal        4831
        mach_msg_trap        2419
barracuda156 commented 2 months ago

Reverted back to the custom implementation of compare and swap, but now trying to run results in this:

Error occurred during initialization of VM
java.lang.StackOverflowError
    at java.lang.Object.<clinit>(Object.java:41)

Which does not tell me much. Perhaps I need to postpone this until tomorrow.

barracuda156 commented 2 months ago

To sum what we have at the moment:

  1. With two patches this branch builds and works fine. I can use the newly built openjdk8 as a bootstrap JDK.
  2. I was able to build 8-372, but it is broken at the moment.

Modern gcc can be used to build it with no issues (gcc14 needs to downgrade a few errors back to warnings). Whether it is desirable is to be determined.

Status of atomics is unclear, because I only tried switching to standard GCC builtin on 8-372, but it is broken in both cases, though differently. Linking to libatomic works fine.

Build is quite fragile, it can fail on random resource unavailable errors, or due to opportunistic linking with unrelated libraries, or due to not finding own libraries when building in parallel. But all these are easily fixable.

barracuda156 commented 2 months ago

Looks like we are almost there:

36-25% /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_java_openjdk8/openjdk8/work/jdk8u-jdk8u372-ga/build/openjdk8/images/j2sdk-image/bin/java -version
2024-07-09 18:34:10.587 java[13785:1903] *** __NSAutoreleaseNoPool(): Object 0x5d12e50 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-09 18:34:10.590 java[13785:1903] *** __NSAutoreleaseNoPool(): Object 0x5d13310 of class NSCFData autoreleased with no pool in place - just leaking
openjdk version "1.8.0_372"
OpenJDK Runtime Environment (build 1.8.0_372-root_2024_07_09_15_56-b00)
OpenJDK Zero VM (build 25.372-b00, interpreted mode)
barracuda156 commented 2 months ago

These NSAutoreleaseNoPool are related to the chunk of code in java_md_macosx.c, as I understand, which has been broken by upstream by clang-only syntax. I had to restore an earlier version of it, which apparently does not fit perfectly with something else. Anyway, these messages are more or less harmless, given we are not talking about production-quality software.

I may not have an immediate solution for those, since upstream switched directly from a working code (same as in 8u60) to a broken clangisms, and my knowledge of ObjC is about of non-existing.

I used gcc-4.2 and your implementation of compare and swap this time. Given how long the build takes even on the Quad, I guess I will not experiment with different compilers, since that will require rebuilding from scratch.

Allow me a day to sort out patches, I need some sleep finally first.

nilsvanvelzen commented 1 month ago

Great work @barracuda156! I'll fire up my G5 tomorrow such that I can test your changes (which I already accepted ;-))

barracuda156 commented 1 month ago

For the record, with this version I was getting a failure when debug symbols were enabled, maybe due to an old zlib being picked (I built outside MacPorts). It occurred rather early in the build. I added a flag to your script to disable those, and the problem was gone.

This could be specific to my 10a190 though, so unless reproduced on 10.5, no need to change the script here.

barracuda156 commented 1 month ago

BTW do you think we can submit fixes to upstream? If those are done in a non-offending way, of course. It won’t be hard, we may just need a single macro like MAC_LEGACY or alike via configure, and then use it whenever a fallback needed (to avoid ugly availability macros on every instance).

Since the code now requires 10.7+, then for anything below uniform fallbacks can be used, and no need for a dedicated powerpc case.

nilsvanvelzen commented 1 month ago

BTW do you think we can submit fixes to upstream? If those are done in a non-offending way, of course. It won’t be hard, we may just need a single macro like MAC_LEGACY or alike via configure, and then use it whenever a fallback needed (to avoid ugly availability macros on every instance).

Since the code now requires 10.7+, then for anything below uniform fallbacks can be used, and no need for a dedicated powerpc case.

I do not know how the openjdk community works. I'd guess however that the changes are very slim that they would expexpt changes to the code for support for a platform they have declared obsolete about 10 years(?) ago. It there is a clean build with a modern Mac-ports toolchain there could be a route to make it widely available but that includes (manually) keeping the patches working.

nilsvanvelzen commented 1 month ago

For the record, with this version I was getting a failure when debug symbols were enabled, maybe due to an old zlib being picked (I built outside MacPorts). It occurred rather early in the build. I added a flag to your script to disable those, and the problem was gone.

This could be specific to my 10a190 though, so unless reproduced on 10.5, no need to change the script here.

I have started up my G5 this morning, found out that macports was no longer installed hence it is working hard now to get the necessary tools like gmake compiled. With some luck I can test it on my 10.5 installation soon.

barracuda156 commented 1 month ago

For the record, with this version I was getting a failure when debug symbols were enabled, maybe due to an old zlib being picked (I built outside MacPorts). It occurred rather early in the build. I added a flag to your script to disable those, and the problem was gone. This could be specific to my 10a190 though, so unless reproduced on 10.5, no need to change the script here.

I have started up my G5 this morning, found out that macports was no longer installed hence it is working hard now to get the necessary tools like gmake compiled. With some luck I can test it on my 10.5 installation soon.

Great!

I will prepare an update port then for 8u372, since the existing one is totally broken, it will not build (and the old one in my repo is not fixed properly as well yet; I need to commit my local changes from yesterday).

UPD. Just in case, since sorting everything out may take some time, here is the version which should build: https://github.com/barracuda156/macports-ports-powerpc/tree/openjdk8_dirty (change the boot JDK path in the portfile to whatever needed). As I mentioned above, I got a linkage failure at some point, and then I manually continued the build (cd to extracted sources, run sudo gmake with same options which MacPorts uses, it will be in the error message, assuming you also get a linking failure). Once build was complete, I ran install from MacPorts side (which rebuilt some chunk of javadocs for w/e reason, but otherwise worked fine) to actually install the port.

nilsvanvelzen commented 1 month ago

Update: current main (with my build scripts) compiles out of the box including the latest patches of @barracuda156. (Leopard 10.5) Ill look at your macports work

nilsvanvelzen commented 1 month ago

For the record, with this version I was getting a failure when debug symbols were enabled, maybe due to an old zlib being picked (I built outside MacPorts). It occurred rather early in the build. I added a flag to your script to disable those, and the problem was gone. This could be specific to my 10a190 though, so unless reproduced on 10.5, no need to change the script here.

I have started up my G5 this morning, found out that macports was no longer installed hence it is working hard now to get the necessary tools like gmake compiled. With some luck I can test it on my 10.5 installation soon.

Great!

I will prepare an update port then for 8u372, since the existing one is totally broken, it will not build (and the old one in my repo is not fixed properly as well yet; I need to commit my local changes from yesterday).

UPD. Just in case, since sorting everything out may take some time, here is the version which should build: https://github.com/barracuda156/macports-ports-powerpc/tree/openjdk8_dirty (change the boot JDK path in the portfile to whatever needed). As I mentioned above, I got a linkage failure at some point, and then I manually continued the build (cd to extracted sources, run sudo gmake with same options which MacPorts uses, it will be in the error message, assuming you also get a linking failure). Once build was complete, I ran install from MacPorts side (which rebuilt some chunk of javadocs for w/e reason, but otherwise worked fine) to actually install the port.

Did you forget to push your openjdk8_dirty changes/addition to GitHub? I cannot find it. Your most recent commit is related to gcc13

barracuda156 commented 1 month ago

@nilsvanvelzen I think you looked at my default branch, ignore it. openjdk8_dirty has the needed commit: https://github.com/barracuda156/macports-ports-powerpc/commit/71ab5ea6d796f8e3537860b48166ffb8e80d6f1c

There are some patches removed from the portfile (they are not deleted from files folder), it is intended.

barracuda156 commented 1 month ago

@nilsvanvelzen Okay, so this tree has a clean version: https://github.com/barracuda156/macports-ports-powerpc/tree/openjdk8_fix

Please notice, that while it is supposed to be effectively identical to the “dirty” one as far as ppc goes, I did not actually run the build from it, not yet at least.

barracuda156 commented 1 month ago

I can confirm that my second JDK build (i.e. v. 8u372) actually works. I have built R with +java now, and used it to build rJava package:

--->  Building R-rJava
xinstall: mkdir /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-rJava/R-rJava/work/build
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-rJava/R-rJava/work/rJava" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-rJava/R-rJava/work/build --install-tests 
* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... /opt/local/bin/gcc-mp-13
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/local/bin/gcc-mp-13 accepts -g... yes
checking for /opt/local/bin/gcc-mp-13 option to accept ISO C89... none needed
checking how to run the C preprocessor... /opt/local/bin/gcc-mp-13 -E
checking for grep that handles long lines and -e... /opt/local/bin/ggrep
checking for egrep... /opt/local/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether /opt/local/bin/gcc-mp-13 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/jre/bin/java'
archiver    : '/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/jar'
compiler    : '/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javac'
header prep.: '/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javah'
cpp flags   : '-I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin'
java libs   : '-L/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/jre/lib/server -ljvm'
checking whether Java run-time works... 2024-07-11 04:11:27.020 java[27085:1803] *** __NSAutoreleaseNoPool(): Object 0x7512a20 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:11:27.023 java[27085:1803] *** __NSAutoreleaseNoPool(): Object 0x7512ee0 of class NSCFData autoreleased with no pool in place - just leaking
yes
checking whether -Xrs is supported... 2024-07-11 04:11:27.464 java[27086:1803] *** __NSAutoreleaseNoPool(): Object 0x7512a40 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:11:27.467 java[27086:1803] *** __NSAutoreleaseNoPool(): Object 0x7512f00 of class NSCFData autoreleased with no pool in place - just leaking
yes
checking whether -Xrs will be used... yes
checking whether JVM will be loaded dynamically... yes
checking whether JNI programs can be compiled... yes
checking whether JNI programs run... yes
checking JNI data types... ok
checking whether JRI should be compiled (autodetect)... yes
checking whether debugging output should be enabled... no
checking whether memory profiling is desired... no
checking whether threads support is requested... no
checking whether callbacks support is requested... no
checking whether JNI cache support is requested... no
checking whether headless init is enabled... yes
checking whether JRI is requested... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/zzz.R
config.status: creating src/config.h
=== configuring in jri (/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-rJava/R-rJava/work/rJava/jri)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  'CC=/opt/local/bin/gcc-mp-13' 'CFLAGS=-pipe -Os -arch ppc' 'LDFLAGS=-Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -Wl,-rpath,/opt/local/lib/libgcc -arch ppc' 'CPPFLAGS=-isystem/opt/local/include/LegacySupport -I/opt/local/include' --cache-file=/dev/null --srcdir=.
checking build system type... powerpc-apple-darwin10.0.0d2
checking host system type... powerpc-apple-darwin10.0.0d2
checking for gcc... /opt/local/bin/gcc-mp-13
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /opt/local/bin/gcc-mp-13 accepts -g... yes
checking for /opt/local/bin/gcc-mp-13 option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for sys/select.h... yes
checking Java version... 1.8.0_372
checking Java compatibility version (integer)... 8
checking whether /Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javah actually works... yes
checking for target flags...  -target 1.4 -source 1.4
checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
checking whether JNI programs can be run... yes
checking JNI data types... ok
checking whether Rinterface.h exports R_CStackXXX variables... yes
checking whether Rinterface.h exports R_SignalHandlers... yes
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating run
config.status: creating src/config.h
** libs
using C compiler: ‘gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0’
Warning in system2("xcrun", "--show-sdk-path", TRUE, TRUE) :
  running command ''xcrun' --show-sdk-path 2>&1' had status 64
using SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c Rglue.c -o Rglue.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c arrayc.c -o arrayc.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c callJNI.c -o callJNI.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c callback.c -o callback.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fields.c -o fields.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c init.c -o init.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c jri_glue.c -o jri_glue.o
jri_glue.c: In function 'RReleaseREXP':
jri_glue.c:52:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   52 |         SEXP x = (SEXP) r;
      |                  ^
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c loader.c -o loader.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c otables.c -o otables.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c rJava.c -o rJava.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c registration.c -o registration.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c rjstring.c -o rjstring.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c tools.c -o tools.o
/opt/local/bin/gcc-mp-13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/lib -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -Wl,-rpath,/opt/local/lib/libgcc -arch ppc -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o registration.o rjstring.o tools.o -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
(cd ../jri && make)
make -C src JRI.jar
/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
2024-07-11 04:11:46.185 javac[28162:1803] *** __NSAutoreleaseNoPool(): Object 0x7512df0 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:11:46.188 javac[28162:1803] *** __NSAutoreleaseNoPool(): Object 0x75132b0 of class NSCFData autoreleased with no pool in place - just leaking
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
if [ -n "/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javah" ]; then /Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javah -d . -classpath . org.rosuda.JRI.Rengine; fi
2024-07-11 04:11:57.288 javah[28167:1803] *** __NSAutoreleaseNoPool(): Object 0x7512cb0 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:11:57.291 javah[28167:1803] *** __NSAutoreleaseNoPool(): Object 0x7513170 of class NSCFData autoreleased with no pool in place - just leaking
/opt/local/bin/gcc-mp-13 -c -o Rengine.o Rengine.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -pipe -Os -arch ppc  -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -fno-common -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin -I/opt/local/Library/Frameworks/R.framework/Resources/include -I/opt/local/Library/Frameworks/R.framework/Resources/include 
In file included from Rengine.c:4:
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniEval':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:135:36: note: in expansion of macro 'L2SEXP'
  135 |       SEXP es = R_NilValue, exps = L2SEXP(exp);
      |                                    ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:136:23: note: in expansion of macro 'L2SEXP'
  136 |       SEXP eval_env = L2SEXP(rho);
      |                       ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniAssign':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:179:20: note: in expansion of macro 'L2SEXP'
  179 |     s.rho = rhoL ? L2SEXP(rhoL) : R_GlobalEnv;
      |                    ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:180:20: note: in expansion of macro 'L2SEXP'
  180 |     s.val = valL ? L2SEXP(valL) : R_NilValue;
      |                    ^~~~~~
In file included from jri.h:9:
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniProtect':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
/opt/local/Library/Frameworks/R.framework/Resources/include/Rinternals.h:371:36: note: in definition of macro 'PROTECT'
  371 | #define PROTECT(s)      Rf_protect(s)
      |                                    ^
Rengine.c:189:17: note: in expansion of macro 'L2SEXP'
  189 |         PROTECT(L2SEXP(exp));
      |                 ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniRelease':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:201:34: note: in expansion of macro 'L2SEXP'
  201 |         if (exp) R_ReleaseObject(L2SEXP(exp));
      |                                  ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPreserve':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:207:35: note: in expansion of macro 'L2SEXP'
  207 |         if (exp) R_PreserveObject(L2SEXP(exp));
      |                                   ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPrintValue':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:213:29: note: in expansion of macro 'L2SEXP'
  213 |         Rf_PrintValue(exp ? L2SEXP(exp) : R_NilValue);
      |                             ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniParentEnv':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
jri.h:24:37: note: in definition of macro 'SEXP2L'
   24 | #define SEXP2L(s) ((jlong)((size_t)(s)))
      |                                     ^
Rengine.c:219:30: note: in expansion of macro 'L2SEXP'
  219 |   return SEXP2L(ENCLOS(exp ? L2SEXP(exp) : R_GlobalEnv));
      |                              ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniFindVar':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
jri.h:24:37: note: in definition of macro 'SEXP2L'
   24 | #define SEXP2L(s) ((jlong)((size_t)(s)))
      |                                     ^
Rengine.c:228:45: note: in expansion of macro 'L2SEXP'
  228 |         return SEXP2L(Rf_findVar(sym, rho ? L2SEXP(rho) : R_GlobalEnv));
      |                                             ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniListEnv':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
jri.h:24:37: note: in definition of macro 'SEXP2L'
   24 | #define SEXP2L(s) ((jlong)((size_t)(s)))
      |                                     ^
Rengine.c:234:42: note: in expansion of macro 'L2SEXP'
  234 |         return SEXP2L(R_lsInternal(rho ? L2SEXP(rho) : R_GlobalEnv, all));
      |                                          ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniXrefToJava':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:256:19: note: in expansion of macro 'L2SEXP'
  256 |         SEXP xp = L2SEXP(exp);
      |                   ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetString':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:272:33: note: in expansion of macro 'L2SEXP'
  272 |       return jri_putString(env, L2SEXP(exp), 0);
      |                                 ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetStringArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:279:38: note: in expansion of macro 'L2SEXP'
  279 |       return jri_putStringArray(env, L2SEXP(exp));
      |                                      ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetIntArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:285:35: note: in expansion of macro 'L2SEXP'
  285 |       return jri_putIntArray(env, L2SEXP(exp));
      |                                   ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetRawArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:291:36: note: in expansion of macro 'L2SEXP'
  291 |       return jri_putByteArray(env, L2SEXP(exp));
      |                                    ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetBoolArrayI':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:297:37: note: in expansion of macro 'L2SEXP'
  297 |       return jri_putBoolArrayI(env, L2SEXP(exp));
      |                                     ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetDoubleArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:303:38: note: in expansion of macro 'L2SEXP'
  303 |       return jri_putDoubleArray(env, L2SEXP(exp));
      |                                      ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetVector':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:309:35: note: in expansion of macro 'L2SEXP'
  309 |     return jri_putSEXPLArray(env, L2SEXP(exp));
      |                                   ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniExpType':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:315:25: note: in expansion of macro 'L2SEXP'
  315 |     return exp ? TYPEOF(L2SEXP(exp)) : 0;
      |                         ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetAttr':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:386:44: note: in expansion of macro 'L2SEXP'
  386 |     if (!an || an==R_NilValue || exp==0 || L2SEXP(exp)==R_NilValue) return 0;
      |                                            ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:388:28: note: in expansion of macro 'L2SEXP'
  388 |         SEXP a = getAttrib(L2SEXP(exp), an);
      |                            ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetAttrNames':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:396:14: note: in expansion of macro 'L2SEXP'
  396 |     SEXP o = L2SEXP(exp);
      |              ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniSetAttr':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:428:44: note: in expansion of macro 'L2SEXP'
  428 |     if (!an || an==R_NilValue || exp==0 || L2SEXP(exp)==R_NilValue) return;
      |                                            ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:430:15: note: in expansion of macro 'L2SEXP'
  430 |     setAttrib(L2SEXP(exp), an, (attr==0)?R_NilValue:L2SEXP(attr));
      |               ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:430:53: note: in expansion of macro 'L2SEXP'
  430 |     setAttrib(L2SEXP(exp), an, (attr==0)?R_NilValue:L2SEXP(attr));
      |                                                     ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetSymbolName':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:449:39: note: in expansion of macro 'L2SEXP'
  449 |         return jri_putSymbolName(env, L2SEXP(exp));
      |                                       ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniInherits':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:459:30: note: in expansion of macro 'L2SEXP'
  459 |                 if (inherits(L2SEXP(exp), (char*)c)) res = 1;
      |                              ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniCons':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
/opt/local/Library/Frameworks/R.framework/Resources/include/Rinternals.h:311:35: note: in definition of macro 'LCONS'
  311 | #define LCONS(a, b)     Rf_lcons((a), (b))              /* language lists */
      |                                   ^
Rengine.c:470:36: note: in expansion of macro 'L2SEXP'
  470 |     l = LCONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
      |                                    ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
/opt/local/Library/Frameworks/R.framework/Resources/include/Rinternals.h:311:40: note: in definition of macro 'LCONS'
  311 | #define LCONS(a, b)     Rf_lcons((a), (b))              /* language lists */
      |                                        ^
Rengine.c:470:71: note: in expansion of macro 'L2SEXP'
  470 |     l = LCONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
      |                                                                       ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
/opt/local/Library/Frameworks/R.framework/Resources/include/Rinternals.h:310:34: note: in definition of macro 'CONS'
  310 | #define CONS(a, b)      Rf_cons((a), (b))               /* data lists */
      |                                  ^
Rengine.c:472:35: note: in expansion of macro 'L2SEXP'
  472 |     l = CONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
      |                                   ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
/opt/local/Library/Frameworks/R.framework/Resources/include/Rinternals.h:310:39: note: in definition of macro 'CONS'
  310 | #define CONS(a, b)      Rf_cons((a), (b))               /* data lists */
      |                                       ^
Rengine.c:472:70: note: in expansion of macro 'L2SEXP'
  472 |     l = CONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
      |                                                                      ^~~~~~
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:474:23: note: in expansion of macro 'L2SEXP'
  474 |   if (tag) SET_TAG(l, L2SEXP(tag));
      |                       ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniCAR':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:482:22: note: in expansion of macro 'L2SEXP'
  482 |         SEXP r = CAR(L2SEXP(exp));
      |                      ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniCDR':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:492:22: note: in expansion of macro 'L2SEXP'
  492 |         SEXP r = CDR(L2SEXP(exp));
      |                      ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniTAG':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:502:22: note: in expansion of macro 'L2SEXP'
  502 |         SEXP r = TAG(L2SEXP(exp));
      |                      ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutList':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
/opt/local/Library/Frameworks/R.framework/Resources/include/Rinternals.h:310:34: note: in definition of macro 'CONS'
  310 | #define CONS(a, b)      Rf_cons((a), (b))               /* data lists */
      |                                  ^
Rengine.c:523:38: note: in expansion of macro 'L2SEXP'
  523 |         t=CONS((ap[i]==0)?R_NilValue:L2SEXP(ap[i]), t);
      |                                      ^~~~~~
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetList':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
Rengine.c:535:12: note: in expansion of macro 'L2SEXP'
  535 |     SEXP e=L2SEXP(exp);
      |            ^~~~~~
/opt/local/bin/gcc-mp-13 -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -pipe -Os -arch ppc  -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -fno-common -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin -I/opt/local/Library/Frameworks/R.framework/Resources/include -I/opt/local/Library/Frameworks/R.framework/Resources/include 
In file included from jri.c:3:
jri.c: In function 'jri_getSEXPLArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   25 | #define L2SEXP(s) ((SEXP)((jlong)((size_t)(s))))
      |                    ^
jri.c:472:31: note: in expansion of macro 'L2SEXP'
  472 |         SET_VECTOR_ELT(ar, i, L2SEXP(ap[i]));
      |                               ^~~~~~
/opt/local/bin/gcc-mp-13 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -pipe -Os -arch ppc  -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -fno-common -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin -I/opt/local/Library/Frameworks/R.framework/Resources/include -I/opt/local/Library/Frameworks/R.framework/Resources/include 
/opt/local/bin/gcc-mp-13 -c -o Rinit.o Rinit.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -pipe -Os -arch ppc  -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -fno-common -I/opt/local/Library/Frameworks/R.framework/Resources/include -I/opt/local/Library/Frameworks/R.framework/Resources/include 
/opt/local/bin/gcc-mp-13 -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -pipe -Os -arch ppc  -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -fno-common -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin 
/opt/local/bin/gcc-mp-13 -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -pipe -Os -arch ppc  -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -fno-common -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin 
/opt/local/bin/gcc-mp-13 -c -o rjstring.o rjstring.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -pipe -Os -arch ppc  -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin  -fno-common -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/include/darwin -I/opt/local/Library/Frameworks/R.framework/Resources/include -I/opt/local/Library/Frameworks/R.framework/Resources/include 
/opt/local/bin/gcc-mp-13 -o libjri.jnilib Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o rjstring.o -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -Wl,-rpath,/opt/local/lib/libgcc -arch ppc -dynamiclib -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/jre/lib/server -ljvm -fopenmp -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -Wl,-rpath,/opt/local/lib/libgcc -arch ppc -F/opt/local/Library/Frameworks/R.framework/.. -framework R -L/opt/local/lib -lpcre2-8 -ldeflate -llzma -lbz2 -lz -ldl -lm -liconv -licuuc -licui18n 
/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
2024-07-11 04:12:06.147 javac[28204:1803] *** __NSAutoreleaseNoPool(): Object 0x7512df0 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:12:06.150 javac[28204:1803] *** __NSAutoreleaseNoPool(): Object 0x75132b0 of class NSCFData autoreleased with no pool in place - just leaking
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/jar fc JRI.jar org libjri.jnilib
2024-07-11 04:12:17.231 jar[28209:1803] *** __NSAutoreleaseNoPool(): Object 0x7512c70 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:12:17.234 jar[28209:1803] *** __NSAutoreleaseNoPool(): Object 0x7513130 of class NSCFData autoreleased with no pool in place - just leaking
rm -f libjri.jnilib
cp src/libjri.jnilib libjri.jnilib
/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
2024-07-11 04:12:17.757 javac[28216:1803] *** __NSAutoreleaseNoPool(): Object 0x7512cf0 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:12:17.760 javac[28216:1803] *** __NSAutoreleaseNoPool(): Object 0x75131b0 of class NSCFData autoreleased with no pool in place - just leaking
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest2.java
2024-07-11 04:12:25.326 javac[28221:1803] *** __NSAutoreleaseNoPool(): Object 0x7512cf0 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 04:12:25.328 javac[28221:1803] *** __NSAutoreleaseNoPool(): Object 0x75131b0 of class NSCFData autoreleased with no pool in place - just leaking
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
installing via 'install.libs.R' to /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-rJava/R-rJava/work/build/00LOCK-rJava/00new/rJava
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rJava)
nilsvanvelzen commented 1 month ago

I'll test it on 10.5 but macports is still busy compiling the dependencies :-) hence I have not been able to compile/test you macports port yet.

barracuda156 commented 1 month ago

No issues, it is awesome that you doing this.

While compiling with our new java works (at least from two examples), I get errors trying to start any .jar files. One issue is that it needs a symlink to libfontconfig (I will add it to the portfile, now I just did it manually). But it still fails like:

36-25% java -jar /Library/Java/JavaVirtualMachines/openjdk8/Contents/Home/demo/jpda/examples.jar 
Picked up _JAVA_OPTIONS: -Xmx1024M -Djava.awt.headless=true
2024-07-11 05:16:55.231 java[30359:1903] *** __NSAutoreleaseNoPool(): Object 0x5d12ab0 of class NSCFDictionary autoreleased with no pool in place - just leaking
2024-07-11 05:16:55.233 java[30359:1903] *** __NSAutoreleaseNoPool(): Object 0x5d12f70 of class NSCFData autoreleased with no pool in place - just leaking
Error: Could not find or load main class

NSAutoreleaseNoPool are ignorable, they do not break anything, but why classes are not found? Do I miss some variable in the environment? I have only set JAVA_HOME and added its bindir to PATH. I saw something about classpath online, but have no idea what I should set it to :)

barracuda156 commented 1 month ago

I have added symlinks to the tree with the portfile (untested so far!) and will try building the latest release (8u412).

P. S. I think MacPorts could have been wrong, and JVM preferred type should be server, not zero. I will commit that also. UPD. Perhaps zero is also okay, I won’t change that for now.

barracuda156 commented 1 month ago

I have built the latest release, took one simple extra fix and one adjustment in a patch. I will share a portfile soon, but in a separate tree: I will not commit it to MacPorts, since I have no desire to rebase patches for Intel and test the builds there LOL

barracuda156 commented 1 month ago

FWIW,

Tree: https://github.com/barracuda156/macports-ports-powerpc/tree/openjdk8_latest Commit (here all in one): https://github.com/barracuda156/macports-ports-powerpc/commit/97980021ad7921211efe8ab8521443633f159b29

jdk8_2

nilsvanvelzen commented 1 month ago

No issues, it is awesome that you doing this.

You are welcome. I have enjoyed my project in the past a lot to keep stuff working on a G5 such that it could be used for most normal tasks (for me mostly some software development). I have abandoned it some years ago but since you are so actively working to bring my results steps further I'm happy to spent a bit of time helping you out where I can. I do not have time/intrest to debug en dig into issues that cost a lot of time but just helping a bit on the sideline is fun.

My G5 unfortunately did crash twice on my the last 24 hours which it has never done in the 15+ years I have it..I hope it keeps running after I have reseated the memory modules. (I do have two others as well but they are not as fast and I do not have them here at home:-))

nilsvanvelzen commented 1 month ago

FWIW,

Tree: https://github.com/barracuda156/macports-ports-powerpc/tree/openjdk8_latest Commit (here all in one): barracuda156/macports-ports-powerpc@9798002

jdk8_2

Super! macports is compiling again on your new brach (but still busy with gcc7 after my machine crashed yesterday evening) will take some time before my macports it at the pont it really starts compiling openjdk

barracuda156 commented 1 month ago

Does something need C11 from dependencies?

By the way, you could build and use the current gcc for Leopard with minimal fixes (I have a branch gcc-switch, though it is perhaps a bit out of date). The idea is to use gcc10-bootstrap to build gcc14 or whichever. But for OpenJDK it is irrelevant, as of now, I still use gcc-4.2 in the port.

P. S. My main branch for MacPorts repo has some PowerPC-specific improvements, but may need minor modifications for 10.5.

barracuda156 commented 1 month ago

You are welcome. I have enjoyed my project in the past a lot to keep stuff working on a G5 such that it could be used for most normal tasks (for me mostly some software development). I have abandoned it some years ago but since you are so actively working to bring my results steps further I'm happy to spent a bit of time helping you out where I can. I do not have time/intrest to debug en dig into issues that cost a lot of time but just helping a bit on the sideline is fun.

You have done amazing work back then. It is a bit surprising (and disappointing) that nobody seems to have used it: there were queries about Java 1.7 on MacRumors, and discussions about those 2011–2012 binaries, but here you have 1.8, and no one cared…

I should have started myself earlier from building your branch. Instead, I tried first to build JDK with Cocoa, which failed badly, and attempts to fix it failed, and that demotivated me to touch the thing for quite a while. Now that I know that it builds and is not broken, I will probably give it another go to fix X11 build. Cocoa is hopeless and a waste of time, but X11 should work fine, once we find a way to tweak the build system accordingly.

Re G5: bad RAM can cause KP and other bad effects, yeah. At some point I had the Quad going into KP almost daily; turned out, the issue was a corrupt RAM stick.

nilsvanvelzen commented 1 month ago

You are welcome. I have enjoyed my project in the past a lot to keep stuff working on a G5 such that it could be used for most normal tasks (for me mostly some software development). I have abandoned it some years ago but since you are so actively working to bring my results steps further I'm happy to spent a bit of time helping you out where I can. I do not have time/intrest to debug en dig into issues that cost a lot of time but just helping a bit on the sideline is fun.

You have done amazing work back then. It is a bit surprising (and disappointing) that nobody seems to have used it: there were queries about Java 1.7 on MacRumors, and discussions about those 2011–2012 binaries, but here you have 1.8, and no one cared…

I should have started myself earlier from building your branch. Instead, I tried first to build JDK with Cocoa, which failed badly, and attempts to fix it failed, and that demotivated me to touch the thing for quite a while. Now that I know that it builds and is not broken, I will probably give it another go to fix X11 build. Cocoa is hopeless and a waste of time, but X11 should work fine, once we find a way to tweak the build system accordingly.

Re G5: bad RAM can cause KP and other bad effects, yeah. At some point I had the Quad going into KP almost daily; turned out, the issue was a corrupt RAM stick.

I know how demotivated you can get trying it to work when working into the wrong direction. A fundamental challenge lies on how openjdk is set up (and I completely understand it from the perspective of the maintainers.) The native code is split up into 3 parts, Linix/Unix which is super configurable with all kind of macros (what would have been ideal for our application/port), the windows branch + Mac branch (for the both nothing is configurable and they have completely separate codebase). That makes it all very difficult. :-)

The X11 build was on my list (and I tried hard to get it to work for the 1.7 build and failed). When I reached the point of building the headless 1.8 I abandoned using my G5...hence I never took the effort to look at the X11 stuff. In theory I see no fundamental reason why it should not work especially when you try to build with the macport gcc-compilers.

About my crashing machine. I had similar issues years ago with my other G5 and the symptoms look the same. I have now reseated them but when the problems remain I'll just get rid of some of the memory sticks. I have 8Gb in this machine but 2Gb works fine as well. It is now running flawlessly for the last 8+ hours, fingers crossed (all the time building gcc-7 :-))