-
Notifications
You must be signed in to change notification settings - Fork 738
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
OpenJ9 fixes for OSX support [Part 1] #2858
Conversation
On OSX, linker fails to find the definition of __cxa_pure_virtual. Existing stub for __cxa_pure_virtual is enabled on OSX to satisfy the runtime linker. The stub for __cxa_pure_virtual should never be called. Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Reviewers:
|
83e08d7
to
2df4b92
Compare
IDATA RTCfd; | ||
#endif /* defined(LINUX) && !defined(J9ZTPF) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please also add "&& !defined(J9ZTPF)" to MM_RTCAlarm::sleep() in MetronomeAlarm.cpp for consistency ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6c213ca
to
553d6e4
Compare
runtime/vm/statistics.c
Outdated
statistic->dataSlot = 0; | ||
statistic->dataType = (U_32) dataType; | ||
strcpy((char*)&(statistic->name), (char*)name); | ||
|
||
statistic->name = j9mem_allocate_memory(stringSize, OMRMEM_CATEGORY_VM); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statistics kept the full data in a single allocation. This doubles the allocations for a statistic. It looks like the right amount of memory has been allocated originally....
Any insight into why this is aborting? Are we missing a "no-strict-aliasing" style compile option here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the &
may have been causing issues. i reverted to the old implementation. but, i changed how the size of J9Statistic
is evaluated and removed the &
during strcpy
. now, the code works on OSX. remaining changes are done to satisfy coding standards.
553d6e4
to
2dad599
Compare
On OSX, "Abort trap: 6" happens while copying a name into J9Statistic->name using strcpy. Reworked memory allocation of J9Statistic in order to prevent "Abort trap: 6". Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
While compiling OpenJ9 with Clang 9.1.0 on OSX, the following error is seen: ./BarrierSynchronization.hpp:48:7: error: private field '_tokenCount' is not used [-Werror,-Wunused-private-field] private field _tokenCount is removed since it is unused. Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
In MetronomeAlarm.hpp, private field 'RTCfd' is used to store real-time clock related information. On OSX, real-time clock is not supported. So, private field 'RTCfd' is unused. While compiling OpenJ9 with Clang 9.1.0 on OSX, the following error is seen: ./MetronomeAlarm.hpp:103:8: error: private field 'RTCfd' is not used [-Werror,-Wunused-private-field] The declaration of private field 'RTCfd' is surrounded by '#if defined(LINUX) && !defined(J9ZTPF)'. This resolves the compiler error on OSX. Also, fixed ifdefs related to RTCfd in MM_RTCAlarm::sleep(). Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
2dad599
to
6c6a0c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Jenkins test sanity plinux jdk8 |
Related to #36. |
1) Satisfy runtime linker on OSX for
__cxa_pure_virtual's
definitionOn OSX, linker fails to find the definition of
__cxa_pure_virtual
. Existing stub for__cxa_pure_virtual
is enabled on OSX to satisfy the runtime linker. The stub for__cxa_pure_virtual
should never be called.2) Fix "Abort trap: 6" on OSX
On OSX, Abort trap: 6 happens while copying a name into
J9Statistic->name
using strcpy. Reworked memory allocation ofJ9Statistic
in order to prevent Abort trap: 6.3) private field
_tokenCount
unused in BarrierSynchronizationWhile compiling OpenJ9 with Clang 9.1.0 on OSX, the following error is seen:
./BarrierSynchronization.hpp:48:7: error: private field '_tokenCount' is not used [-Werror,-Wunused-private-field]
private field
_tokenCount
is removed since it is unused.4) Real-time clock is not supported on OSX
In MetronomeAlarm.hpp, private field
RTCfd
is used to store real-time clock related information.On OSX, real-time clock is not supported. So, private field
RTCfd
is unused. While compiling OpenJ9 with Clang 9.1.0 on OSX, the following error is seen:./MetronomeAlarm.hpp:103:8: error: private field 'RTCfd' is not used [-Werror,-Wunused-private-field]
The declaration of private field
RTCfd
is surrounded by#if defined(LINUX) && !defined(J9ZTPF)
. This resolves the compiler error on OSX.Also, fixed ifdefs related to
RTCfd
inMM_RTCAlarm::sleep()
.Signed-off-by: Babneet Singh sbabneet@ca.ibm.com