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

Unclear use of OMRSIG_SIGNAL / OMRSIG_SIGACTION #1889

Closed
dnakamura opened this issue May 10, 2018 · 3 comments
Closed

Unclear use of OMRSIG_SIGNAL / OMRSIG_SIGACTION #1889

dnakamura opened this issue May 10, 2018 · 3 comments
Labels

Comments

@dnakamura
Copy link
Contributor

dnakamura commented May 10, 2018

A number of places in the jvm ( eg 1 2 3 among others ), we use the macros OMRSIG_SIGNAL / OMRSIG_SIGACTION These macros are conditionally defined in omrport.h to expand to omrsig_primary_signal / omr_primary_sigaction if OMRPORT_OMRSIG_SUPPORT is defined, or signal / sigaction otherwise.

The issue is that we only define OMRPORT_OMRSIG_SUPPORT when compiling the port library. Thus these other reference are actually just calling signal/sigaction. Is this the intended behaviour? If so, shouldn't we make it more clear by avoiding the use of the macros? If not, we should be defining OMRPORT_OMRSIG_SUPPORT globally, or merging it with OMR_OMRPORT.

@babsingh
Copy link
Contributor

@dnakamura OMRPORT_OMRSIG_SUPPORT should be defined globally. OpenJ9 and OMR should consistently use either omrsig_primary_signal/omr_primary_sigaction or signal/sigaction.

How should we enable OMRPORT_OMRSIG_SUPPORT globally? Can you provide details about merging with OMR_OMRPORT?

@dnakamura
Copy link
Contributor Author

I would maybe add something to the bottom of omrcfg.h like:

#if defined(OMR_PORT) && defined(OMR_OMRSIG)
#define OMRPORT_OMRSIG_SUPPORT
#endif

@babsingh
Copy link
Contributor

babsingh commented Jul 31, 2018

@dnakamura In OpenJ9, the J9VM_PORT_OMRSIG_SUPPORT flag is used to enable the OMRPORT_OMRSIG_SUPPORT flag when building the port library.

If we use the above approach to enable OMRPORT_OMRSIG_SUPPORT globally, then OMRPORT_OMRSIG_SUPPORT won't be disabled when J9VM_PORT_OMRSIG_SUPPORT is disabled.

Will the below changes work?

  1. Enable OMRPORT_OMRSIG_SUPPORT in runtime/gc_glue_java/configure_includes/configure_common.mk.ftl:
<#if uma.spec.flags.port_omrsigSupport.enabled>
  --enable-OMRPORT_OMRSIG_SUPPORT \
</#if>
  1. Add OMRPORT_OMRSIG_SUPPORT in
    i) omr/omrmakefiles/configure..mk.in
    ii) omr/configure.ac
    iii) omr/omrcfg.CMakeTemplate.h
    iv) omr/include_core/omrcfg.h.in
    v) omr/cmake/config.cmake

Also, did you find a fix for the linkage issue which occurs when OMRPORT_OMRSIG_SUPPORT is enabled globally?

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

No branches or pull requests

3 participants