Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting OS X Mac builds #36

Closed
mstoodle opened this issue Sep 16, 2017 · 43 comments
Closed

Supporting OS X Mac builds #36

mstoodle opened this issue Sep 16, 2017 · 43 comments

Comments

@mstoodle
Copy link
Contributor

It has been pointed out that Eclipse OpenJ9 does not yet have OS X builds. Eclipse OMR provides OS X support. In this issue we can discuss what would be needed.

@gireeshpunathil
Copy link
Contributor

A first-cut porting outline to kick-start some conversation:

  • API library: already available as openjdk component?
  • JIT: I guess macOS X > 10 (Sierra) supports only x64 so codegen is re-used. Control modules may need to accommodate the new platform
  • GC: no port required?
  • Port library: Major code changes expected here. MacOS is fundamentally a BSD variant with POSIX compliance, so has good affinity with Linux. Threading, networking, file system, process management, memory management, sync. primitives needs to be looked upon on each system call level, rather than build-and- fix-breaks approach I guess.
  • RAS: tracing and dumping should be straightorward, but postmortem tooling needs fresh development (MAT, DDR, IDDE, GCMV, HC..)
  • Build: Not known (to me)
  • Test: Not known

@charliegracie
Copy link
Contributor

charliegracie commented Sep 18, 2017

  • GC will require minor work since most of the GC code lives in OMR and it already works on OS X. GC policies like metronome and balanced may require work since they have not been moved into OMR yet so they have not been tested on OS X. Balanced does rely on numa to to improve pause times and object layout so this is something that would have to be investigated. Also the compressed references option requires being able to directly malloc / reserve memory below the 4G memory boundary. I have not investigated this yet to see if it is possible on OS X but I assume it is.
  • Most of the Port Library is in OMR which already support OS X so this should be minimal work.
  • Most of the RAS tooling should just work. I assume there will be minor tweaks required but this should not be that difficult and likely not required to get a build up and going initially.

@jdekonin
Copy link
Contributor

jdekonin commented Oct 6, 2017

I started playing with this two nights ago. Please assign to me and I'll have 2 wip pull requests and while I can certainly take comments, there are changes that I have to go back and investigate/resolve still. These changes do not compile as yet. I believe I get through a lot (if not all) of java compilation and but I am failing in compiling openj9 native code. I get through OMR native compile through so I believe I have the glue layer correct.

My current failure is looking like this :

/Library/Developer/CommandLineTools/usr/bin/make  -C ./jilgen -f constgen.mk
cc -DJAVA_SPEC_VERSION=9 -O3 -fno-strict-aliasing -g -MMD -DOSX -D_REENTRANT -D_FILE_OFFSET_BITS=64  -fPIC  -DIPv6_FUNCTION_SUPPORT -DJ9HAMMER -m64 -Wimplicit -Wreturn-type -Werror -I. -I../include -I../oti -I../nls -I/Users/joe_dekoning/openjdk/build/macosx-x86_64-normal-server-release/vm/omr/include_core    -DUT_DIRECT_TRACE_REGISTRATION -DTR_HOST_X86 -c -o copyright.o ../makelib/copyright.c
cc -DJAVA_SPEC_VERSION=9 -O3 -fno-strict-aliasing -g -MMD -DOSX -D_REENTRANT -D_FILE_OFFSET_BITS=64  -fPIC  -DIPv6_FUNCTION_SUPPORT -DJ9HAMMER -m64 -Wimplicit -Wreturn-type -Werror -I. -I../include -I../oti -I../nls -I/Users/joe_dekoning/openjdk/build/macosx-x86_64-normal-server-release/vm/omr/include_core    -DUT_DIRECT_TRACE_REGISTRATION -DTR_HOST_X86 -c -o jilconsts.o jilconsts.c
cc  -L. -L../ -L../lib/  \
    copyright.o jilconsts.o \
    -Xlinker --start-group \
    -lj9exelib -lj9utilcore -lj9prtstatic -lj9hashtable -lj9avl -lj9pool -lomrglue \
    -Xlinker --end-group \
    -lj9thr29  \
    -o ../constgen -lm -lpthread -lc -lrt -ldl -lutil -Wl,-z,origin,-rpath,\$ORIGIN,--disable-new-dtags,-rpath-link,../
ld: unknown option: --start-group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [../constgen] Error 1
make[4]: *** [constgen] Error 2
make[3]: *** [build-j9] Error 2
make[2]: *** [j9vm-build] Error 2

Also need changes from ibmruntimes/openj9-openjdk-jdk9#59

@jdekonin
Copy link
Contributor

jdekonin commented Oct 26, 2017

Follow on #456 and #457

Still progressing though failures in portlib

@jdekonin
Copy link
Contributor

@DanHeidinga I see that you have a couple branches of stale changes for OSX. Would you like me to attempt to merge them and rebase?

@DanHeidinga
Copy link
Member

Feel free. I haven't had a chance to get back to them so if you're able to, I'd appreciate the help.

@jdekonin
Copy link
Contributor

jdekonin commented Dec 1, 2017

After #738 is merged the current failure is within the port library looking like this

unix/j9sock.c:1287:13: error: implicit declaration of function 'gethostbyaddr_r' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                        result = gethostbyaddr_r(addr,length,type, hostentBuffer, buffer, bufferSize, &herr);
                                 ^
unix/j9sock.c:1287:13: note: did you mean 'gethostbyaddr'?
/usr/include/netdb.h:270:17: note: 'gethostbyaddr' declared here
struct hostent  *gethostbyaddr(const void *, socklen_t, int);

This needs some rework surrounding gethostby*_r.

@DanHeidinga
Copy link
Member

As we've delivered mac on jdk 11 for the 0.11.0 release, moving the remaining work to 0.12.0

@DanHeidinga
Copy link
Member

Mac support for jdk 8 & 11 is in 0.12.0. Rolling this forward for tracking the other mac defects

@pshipton
Copy link
Member

Mac support for jdk 8, 11, 12 is in 0.14.0. Rolling this forward for tracking the other mac defects, although I'm not sure if this Issue has value any more. https://github.com/eclipse/openj9/projects/7 is also used for tracking remaining Mac issues. @DanHeidinga should we close this?

@DanHeidinga
Copy link
Member

should we close this?

Yes, the project is sufficient for tracking mac-specific issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants