RFR: 8034094: SA agent can't compile when jni_x86.h is used
Erik Helin
erik.helin at oracle.com
Thu May 1 16:16:31 UTC 2014
On Wednesday 30 April 2014 23:18:40 PM Dmitry Samersoff wrote:
> Erik,
>
> Sorry, missed the thread.
No problem, thanks for having a look!
On Wednesday 30 April 2014 23:18:40 PM Dmitry Samersoff wrote:
> Changes (option 2) looks good for me.
Thanks!
Erik
On Wednesday 30 April 2014 23:18:40 PM Dmitry Samersoff wrote:
> -Dmitry
>
> On 2014-02-10 19:21, Erik Helin wrote:
> > Sigh, I forgot the subject...
> >
> > "RFR: 8034094: SA agent can't compile when jni_x86.h is used"
> >
> > Thanks,
> > Erik
> >
> > On 2014-02-10 16:08, Erik Helin wrote:
> >> Hi all,
> >>
> >> this patch fixes an issue with HotSpot's makefiles, IMPORT_JDK and
> >> jni_md.h.
> >>
> >> The bug manifests itself when using an IMPORT_JDK which
> >> include/linux/jni_md.h has a timestamp that is older than
> >> hotspot/src/cpu/x86/jni_x86.h. When this happens, the Makefiles will
> >> copy hotspot/src/cpu/x86/jni_x86.h to
> >> hotspot/build/jdk-linux-amd64/fastdebug/include/linux/jni_md.h.
> >>
> >> The issue is that hotspot/src/cpu/x86/jni_x86.h differs slightly from
> >> jdk/include/jni.h, since it is used for all operating systems:
> >>
> >> #if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE)
> >> ... // common stuff
> >> #else
> >> ... // windows stuff
> >> #endif
> >>
> >> We compile the SA agent, see make/linux/makefiles/saproc.make, without
> >> defining LINUX (LINUX is hotspot's own define, gcc uses __linux__).
> >>
> >> In my opinion, there are two ways to solve this:
> >> 1. Add -DLINUX to make/linux/makefiles/saproc.make (and corresponding
> >>
> >> defines for Solaris and BSD).
> >>
> >> 2. Rewrite the #if check in jni_x86.h to use platform specific "native"
> >>
> >> defines.
> >>
> >> I've created a patch for each alternative:
> >> 1: http://cr.openjdk.java.net/~ehelin/8034094/webrev.1/
> >> 2: http://cr.openjdk.java.net/~ehelin/8034094/webrev.2/
> >>
> >> For the second patch, note that I've inverted the #if check so that it
> >> checks for _WIN32 is defined and treat all others operating systems as
> >> "#else".
> >>
> >> Bug:
> >> https://bugs.openjdk.java.net/browse/JDK-8034094
> >>
> >> Testing:
> >> - Compiled both version locally and made sure it worked
> >> - JPRT
> >>
> >> Thanks,
> >> Erik
More information about the build-dev
mailing list