JDK-8071501 : perfMemory_solaris.cpp failing to compile with "Error: dd_fd is not a member of DIR."
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u40,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_11
  • CPU: sparc
  • Submitted: 2015-01-23
  • Updated: 2015-09-29
  • Resolved: 2015-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b56Fixed
Description
> I just pulled the jdk9/dev gate today and hit a build failure on SPARC
> Solaris 11.1 when compiling perfMemory_solaris.cpp in hotspot.  I'm
> using SS12u3 compilers.  Anyone else see a similar error or know what
> might be going wrong?
>
> ...hotspot/src/os/solaris/vm/perfMemory_solaris.cpp", line 337: Error: dd_fd is not a member of DIR.
> ...hotspot/src/os/solaris/vm/perfMemory_solaris.cpp", line 369: Error: dd_fd is not a member of DIR."
> gmake[8]: *** [perfMemory_solaris.o] Error 2

This code was brought in via the recent CPU integration of bug 8050807. (Hi Jerry! - cc'd)

It looks like Solaris has two potential definitions of DIR:

#if defined(__USE_LEGACY_PROTOTYPES__)
/* traditional SVR4 definition */
typedef struct {
        int     dd_fd;          /* file descriptor */
        int     dd_loc;         /* offset in block */
        int     dd_size;        /* amount of valid data */
        char    *dd_buf;        /* directory block */
} DIR;                          /* stream data from opendir() */
#else
/* default definition (POSIX conformant) */
typedef struct {
        int     d_fd;           /* file descriptor */
        int     d_loc;          /* offset in block */
        int     d_size;         /* amount of valid data */
        char    *d_buf;         /* directory block */
} DIR;                          /* stream data from opendir() */
#endif  /* __USE_LEGACY_PROTOTYPES__ */

I can't see what controls __USE_LEGACY_PROTOTYPES__ but presumably either something in Solaris 11.1, or something in SS12u3 is causing this difference.

David 
Comments
The proper fix can be backported to 8u as well. To workaround this for 8u try also setting tools-dir to point into the devkit binary location eg: --with-devkit=/java/devtools/i586/devkit/SS12u3-Solaris10u6/ --with-tools-dir=/java/devtools/i586/devkit/SS12u3-Solaris10u6/SS12u3-slim/bin
10-02-2015

Thanks very much Valerie! It seems devkits are not fully supported in 8u - we would need JDK-8038340 backported. That said it seems Solaris 11 is not a defined build platform for 8u.
10-02-2015

Fix is in the pipeline.
05-02-2015

devkit may be our internal solution but it is not for external OpenJDK contributors . SAP is asking about it.
04-02-2015

Vladimir: a devkit is a bundle of headers etc to represent the official build environment but allow you to build on later versions of the OS. For JDK 9 on Solaris that is currently S10u6, but in the process of changing to S10u10. So on your Solaris 11 build machines you use the S10u6 or S10u10 devkit.
02-02-2015

Count me in, I am also hitting this issue and it is a show stopper.
31-01-2015

Note, Solaris 10, which is used by JPRT and RE, has inverted (relative to Solaris 11) check in /usr/include/dirent.h: #if !defined(__XOPEN_OR_POSIX) typedef struct { int dd_fd; /* file descriptor */ int dd_loc; /* offset in block */ int dd_size; /* amount of valid data */ char *dd_buf; /* directory block */ } DIR; /* stream data from opendir() */ #else typedef struct { int d_fd; /* file descriptor */ int d_loc; /* offset in block */ int d_size; /* amount of valid data */ char *d_buf; /* directory block */ } DIR; /* stream data from opendir() */
30-01-2015

So where is devkit for Solaris 11.0 and 11.1? /java/devtools/sparc/devkit/ has only for Solaris 10. How I am suppose to work now if I can't compile Hotspot on Solaris without patching perfMemory_solaris.cpp?
30-01-2015

I hit the same problem on Solaris 11.0 and 11.1, both x86 and SPARC. It is actually in perfMemory_solaris.cpp: "hotspot/src/os/solaris/vm/perfMemory_solaris.cpp", line 337: Error: dd_fd is not a member of DIR. "hotspot/src/os/solaris/vm/perfMemory_solaris.cpp", line 369: Error: dd_fd is not a member of DIR. 2 Error(s) detected. $ which CC /java/devtools/i386/SUNWspro/SS12u3/bin/CC
30-01-2015

Issue doesn't affect the official devkits for Solaris, but does affect standalone builds. Unclear if this needs to be fixed on standalone builds or whether we can wait until the devkits are to be updated. Otherwise we will need to ifdef the code based on the internal __USE_LEGACY_PROTOTYPES__ value.
27-01-2015

Jerry, this started to happen after some jdk9/cpu changesets were pushed to jdk9/dev on Wednesday, and the changeset below is the prime suspect: Changeset: c656c7540cb1 Author: gthornbr Date: 2014-11-17 15:51 -0500 URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/c656c7540cb1 8050807: Better performing performance data handling Reviewed-by: dcubed, pnauman, ctornqvi, dholmes, mschoene Contributed-by: gerald.thornbrugh@oracle.com ! src/os/bsd/vm/perfMemory_bsd.cpp ! src/os/linux/vm/perfMemory_linux.cpp ! src/os/solaris/vm/perfMemory_solaris.cpp ! src/share/vm/utilities/vmError.cpp Please review and reassign if needed
23-01-2015