John E. Malmberg
2017-07-03 23:22:32 UTC
This is some of the things that I still need to do to get gnulib to the
point of compiling on OpenVMS.
OpenVMS needs __UNIX_PUTC macro defined for putc_unlocked
and friends to be visible.
This needs "_X_OPEN_SOURCE_EXTENDED" for the XPG4 V2 features
in the code to compile on OpenVMS. Specifically the "msg_control"
and "msg_controllen" members of struct msghdr.
This would need to be defined before any system header files are
OpenVMS provides _CMSG_SPACE and _CMSG_LEN macros instead of
CMSG_SPACE and CMSG_LEN. This looks like I would need to
find out how gllib/sys/socket.h got generated.
For the OpenVMS header files, enabling _X_OPEN_SOURCE_EXTENDED
causes macros and symbols not defined by the applicable
standard to be hidden from the compiler. There currently
is no way to make them visible and have XPG4 V2 features enabled.
So I either need to have lib/passfd.c for OpenVMS define the
_X_OPEN_SOURCE_EXTENDED macro as such:
#ifdef __VMS /* OpenVMS enable XPG4 V2 */
# define _X_OPEN_SOURCE_EXTENDED
Or I need to have my build procedure create a file named
lib/gnv$passfd.c_first that contains that macro definition.
The cc emulation program in OpenVMS GNV will automatically treat
such files as a "first_include".
* The OpenVMS iconv.h header file has a bug where it does not
* The OpenVMS math.h header file has a bug where it is missing
NAN and INFINITY, these are found in the fp.h header file.
* In gl_sublist.c, the OpenVMS compiler is generating a
"MISSINGRETURN" warning because it does not realize that there
is no return from an abort() call.
This should fix that:
# pragma message disable missingreturn
So would adding a useless return statement, but that may cause some
compilers to complain about unreachable code.
I do see GCC specific pragmas in the source code.
* The OpenVMS stropts.h header file definition for ioctl() is
non-standard, which causes problems when it is wrapped
* OpenVMS sys/resource does not define RUSAGE_SELF or
RUSAGE_CHILDREN. Comments say ru_stime member of rusage
is present, but not implemented.
* Because the replacement C99 routines are not prefixed
with "RPL_" or another prefix, the OpenVMS C Compiler is
generating a warning when encountering them:
%CC-W-NOTINCRTL, Identifier "strtoumax" is reserved by the C99 standard
and will be mapped to "DECC$STRTOUMAX" although it is not available in
the CRTL available to the compiler.
These appear to be routines that the compiler would inline when the
optimization level allows it.
It looks like something in the configure tests determine if the
prefix is generated for a replacement routine or not. OpenVMS
generally always will need the prefix on a replacement routine.
* Work out the how to patch the configure test for getdtablesize()
to pass on OpenVMS.
* The configure test for the real directory for OpenVMS system
supplied header file fails because they are not in a real directory.
They are in a library file. If OpenVMS does not find a header
file in supplied paths header files or in the source, it junks
the directory portion the the header file path, and just looks
up the filename in the text library.
I export some symbols to cause Configure on VMS to skip the test.
It looks like for some of these I need to find the appropriate m4 macros
and others I need to find the templates for generating the local header
Any suggestions on the preferred way to implement patches for these
would be appreciated.