From e75fb3e5ecb4d64f78bb18a196a2467071580e6d Mon Sep 17 00:00:00 2001 From: Alastair McKinstry Date: Thu, 3 May 2018 04:49:34 +0100 Subject: [PATCH] build_hurd Gbp-Pq: Name build_hurd --- ompi/include/ompi_config.h | 4 ++++ ompi/mca/fbtl/posix/fbtl_posix_preadv.c | 4 ++++ ompi/mca/fbtl/posix/fbtl_posix_pwritev.c | 4 ++++ opal/mca/base/mca_base_var.c | 8 +++++++ .../pmix/src/mca/base/pmix_mca_base_var.c | 4 ++++ opal/util/stacktrace.c | 4 ++++ orte/include/orte_config.h | 7 +++++++ orte/mca/odls/base/odls_base_default_fns.c | 21 +++++++++++++++++-- test/util/opal_path_nfs.c | 4 +++- 9 files changed, 57 insertions(+), 3 deletions(-) diff --git a/ompi/include/ompi_config.h b/ompi/include/ompi_config.h index a7a2c1fa..2428ddea 100644 --- a/ompi/include/ompi_config.h +++ b/ompi/include/ompi_config.h @@ -28,6 +28,10 @@ #include "opal_config.h" +#ifndef PATH_MAX /* Hurd */ +#define PATH_MAX 65535 +#endif + #define OMPI_IDENT_STRING OPAL_IDENT_STRING /*********************************************************************** diff --git a/ompi/mca/fbtl/posix/fbtl_posix_preadv.c b/ompi/mca/fbtl/posix/fbtl_posix_preadv.c index 5f5593c8..5b8bcc14 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix_preadv.c +++ b/ompi/mca/fbtl/posix/fbtl_posix_preadv.c @@ -28,6 +28,10 @@ #include "ompi/constants.h" #include "ompi/mca/fbtl/fbtl.h" +#ifndef IOV_MAX +#define IOV_MAX 1024 +#endif + ssize_t mca_fbtl_posix_preadv (mca_io_ompio_file_t *fh ) { /*int *fp = NULL;*/ diff --git a/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c b/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c index c6a64029..3d076d1f 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c +++ b/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c @@ -30,6 +30,10 @@ #include "ompi/constants.h" #include "ompi/mca/fbtl/fbtl.h" +#ifndef IOV_MAX +#define IOV_MAX 1024 +#endif + ssize_t mca_fbtl_posix_pwritev(mca_io_ompio_file_t *fh ) { /*int *fp = NULL;*/ diff --git a/opal/mca/base/mca_base_var.c b/opal/mca/base/mca_base_var.c index 728f023e..e4356981 100644 --- a/opal/mca/base/mca_base_var.c +++ b/opal/mca/base/mca_base_var.c @@ -50,6 +50,14 @@ #include "opal/util/opal_environ.h" #include "opal/runtime/opal.h" +#ifndef MAXPATHLEN /* Hurd */ +#define MAXPATHLEN 65535 +#endif + +#ifndef PATH_MAX /* Hurd */ +#define PATH_MAX 65535 +#endif + /* * local variables */ diff --git a/opal/mca/pmix/pmix2x/pmix/src/mca/base/pmix_mca_base_var.c b/opal/mca/pmix/pmix2x/pmix/src/mca/base/pmix_mca_base_var.c index 858ca1a9..370959ac 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/mca/base/pmix_mca_base_var.c +++ b/opal/mca/pmix/pmix2x/pmix/src/mca/base/pmix_mca_base_var.c @@ -50,6 +50,10 @@ #include "src/util/output.h" #include "src/util/pmix_environ.h" +#ifndef MAXPATHLEN /* Hurd */ +#define MAXPATHLEN 1024 +#endif + /* * local variables */ diff --git a/opal/util/stacktrace.c b/opal/util/stacktrace.c index 4ae9a975..ad321a4c 100644 --- a/opal/util/stacktrace.c +++ b/opal/util/stacktrace.c @@ -579,8 +579,12 @@ int opal_util_register_stackhandlers (void) /* Setup the signals to catch */ memset(&act, 0, sizeof(act)); +#ifdef SA_SIGINFO act.sa_sigaction = show_stackframe; act.sa_flags = SA_SIGINFO; +#else + act.sa_handler = show_stackframe_handler; +#endif #ifdef SA_ONESHOT act.sa_flags |= SA_ONESHOT; #else diff --git a/orte/include/orte_config.h b/orte/include/orte_config.h index 9c951b7f..6ec28d08 100644 --- a/orte/include/orte_config.h +++ b/orte/include/orte_config.h @@ -26,6 +26,13 @@ #include "opal_config.h" +#ifndef PATH_MAX /* Hurd */ +#define PATH_MAX 65535 +#endif +#ifndef MAXPATHLEN +#define MAXPATHLEN 65535 +#endif + #define ORTE_IDENT_STRING OPAL_IDENT_STRING # if OPAL_C_HAVE_VISIBILITY diff --git a/orte/mca/odls/base/odls_base_default_fns.c b/orte/mca/odls/base/odls_base_default_fns.c index 6528feb3..dd7815c3 100644 --- a/orte/mca/odls/base/odls_base_default_fns.c +++ b/orte/mca/odls/base/odls_base_default_fns.c @@ -874,7 +874,11 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata) orte_app_context_t *app; orte_proc_t *child=NULL; int rc=ORTE_SUCCESS; - char basedir[MAXPATHLEN]; +#if !defined(MAXPATHLEN) && defined(__GLIBC__) + char *basedir=NULL; +#else + char basedir[MAXPATHLEN]; +#endif int j, idx; int total_num_local_procs = 0; orte_odls_launch_local_t *caddy = (orte_odls_launch_local_t*)cbdata; @@ -897,7 +901,11 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata) * bouncing around as we execute various apps, but we will always return * to this place as our default directory */ +#if !defined(MAXPATHLEN) && defined(__GLIBC__) + basedir = get_current_dir_name(); +#else getcwd(basedir, sizeof(basedir)); +#endif /* find the jobdat for this job */ if (NULL == (jobdat = orte_get_job_data_object(job))) { @@ -1784,7 +1792,12 @@ int orte_odls_base_default_restart_proc(orte_proc_t *child, int rc; orte_app_context_t *app; orte_job_t *jobdat; - char basedir[MAXPATHLEN]; +#if !defined(MAXPATHLEN) && defined(__GLIBC__) + char *basedir=NULL; + char *dir=NULL; +#else + char basedir[MAXPATHLEN]; +#endif char *wdir = NULL; orte_odls_spawn_caddy_t *cd; opal_event_base_t *evb; @@ -1798,7 +1811,11 @@ int orte_odls_base_default_restart_proc(orte_proc_t *child, * bouncing around as we execute this app, but we will always return * to this place as our default directory */ +#if !defined(MAXPATHLEN) && defined(__GLIBC__) + basedir = get_current_dir_name(); +#else getcwd(basedir, sizeof(basedir)); +#endif /* find this child's jobdat */ if (NULL == (jobdat = orte_get_job_data_object(child->name.jobid))) { diff --git a/test/util/opal_path_nfs.c b/test/util/opal_path_nfs.c index b5fad7ae..43a68085 100644 --- a/test/util/opal_path_nfs.c +++ b/test/util/opal_path_nfs.c @@ -31,8 +31,10 @@ #include #include +#ifdef HAVE_SYS_MOUNT_H #include -#ifdef HAVE_SYS_STATFS_H +#endif +#if defined(__linux__) /* not present on Hurd */ #include #endif #ifdef HAVE_SYS_VFS_H -- 2.30.2