From c1b707335949fd2932b2058995595e7f6d170fcd Mon Sep 17 00:00:00 2001 From: Gaurav Chaudhari Date: Tue, 23 Jul 2024 13:07:45 -0400 Subject: [PATCH] Open XL implicit function declaration fixes Mostly a collection of missing function declaration fixes and other commonly seen errors/warnings from Open XL compilation. runtime/jcl/common/attach.c : missing int specifier runtime/rasdump/dmpagent.c : missing assembly func declarations (waitpid()) runtime/rasdump/dmpsup.c : implicit function declarations (__cabend()) runtime/rasdump/javadump.cpp : undeclared identifier 'alloca' runtime/redirector/redirector.c : implicit function declarations (dlerror()) runtime/port/zos390/protect_helpers.c: missing declaration for _MPROT/_MUNPROT Signed-off-by: Gaurav Chaudhari --- runtime/jcl/common/attach.c | 2 +- runtime/port/zos390/protect_helpers.c | 4 ++-- runtime/rasdump/dmpagent.c | 1 + runtime/rasdump/dmpsup.c | 1 + runtime/rasdump/javadump.cpp | 2 -- runtime/redirector/redirector.c | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/jcl/common/attach.c b/runtime/jcl/common/attach.c index 278588761bb..eacefb6e346 100644 --- a/runtime/jcl/common/attach.c +++ b/runtime/jcl/common/attach.c @@ -204,7 +204,7 @@ Java_openj9_internal_tools_attach_target_IPC_isUsingDefaultUid(JNIEnv *env, jcla /* all offsets are byte offsets */ U_32* PSATOLD_ADDR = (U_32 *)(UDATA) 0x21c; /* z/OS Pointer to current TCB or zero if in SRB mode. Field fixed by architecture. */ U_32 tcbBase; /* base of the z/OS Task Control Block */ - const TCBSENV_OFFSET = 0x154; /* offset of the TCBSENV field in the TCB. This field contains a pointer to the ACEE. */ + const U_32 TCBSENV_OFFSET = 0x154; /* offset of the TCBSENV field in the TCB. This field contains a pointer to the ACEE. */ U_32 aceeBaseAddr; /* Address of a control block field which contains a pointer to the base of the RACF Accessor Environment Element (ACEE) */ U_32 aceeBase; /* absolute address of the start of the ACEE */ U_32 aceeflg3Addr; /* address of the "Miscellaneous flags" byte of the ACEE */ diff --git a/runtime/port/zos390/protect_helpers.c b/runtime/port/zos390/protect_helpers.c index 01e4e4ea0ae..573a454217f 100644 --- a/runtime/port/zos390/protect_helpers.c +++ b/runtime/port/zos390/protect_helpers.c @@ -25,6 +25,8 @@ #include #include +extern intptr_t _MPROT(uintptr_t address, uintptr_t length); /* j9mprotect.s */ +extern intptr_t _MUNPROT(uintptr_t address, uintptr_t length); /* j9munprotect.s */ /** * @internal @file @@ -40,8 +42,6 @@ intptr_t protect_memory(struct J9PortLibrary *portLibrary, void *address, uintptr_t length, uintptr_t flags) { OMRPORT_ACCESS_FROM_J9PORT(portLibrary); - uintptr_t index; - intptr_t unixFlags = 0; intptr_t rc = -1; if ((flags & OMRPORT_PAGE_PROTECT_WRITE) == 0) { diff --git a/runtime/rasdump/dmpagent.c b/runtime/rasdump/dmpagent.c index 83a37363e9b..473c664a975 100644 --- a/runtime/rasdump/dmpagent.c +++ b/runtime/rasdump/dmpagent.c @@ -30,6 +30,7 @@ #ifdef J9ZOS390 #include #include +#include #include "atoe.h" #endif #ifdef AIXPPC diff --git a/runtime/rasdump/dmpsup.c b/runtime/rasdump/dmpsup.c index d841ab03122..5c62fbb1ad9 100644 --- a/runtime/rasdump/dmpsup.c +++ b/runtime/rasdump/dmpsup.c @@ -60,6 +60,7 @@ char* dumpDirectoryPrefix = NULL; #if defined(J9ZOS390) #if defined(J9VM_ENV_DATA64) #include <__le_api.h> +#include #else #include #include diff --git a/runtime/rasdump/javadump.cpp b/runtime/rasdump/javadump.cpp index c21622ee361..6843a903469 100644 --- a/runtime/rasdump/javadump.cpp +++ b/runtime/rasdump/javadump.cpp @@ -30,8 +30,6 @@ #include #elif defined(LINUX) || defined(AIXPPC) #include -#elif defined(J9ZOS390) -#include #endif #if defined(J9ZTPF) #include diff --git a/runtime/redirector/redirector.c b/runtime/redirector/redirector.c index 239c1be2d31..ab656c3e585 100644 --- a/runtime/redirector/redirector.c +++ b/runtime/redirector/redirector.c @@ -121,6 +121,7 @@ typedef enum gc_policy{ #endif /* defined(AIXPPC) */ #if defined(J9ZOS390) +#include #include #include "atoe.h" #include