From: Pino Toscano Date: Sun, 12 Apr 2020 11:47:29 +0000 (+0100) Subject: Fix build problems on hurd-i386 X-Git-Tag: archive/raspbian/4.0.3-6+rpi1^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8e0fd8e602f715f3c04083fd718ed50e5f3076b2;p=openmpi.git Fix build problems on hurd-i386 Forwarded: partially Last-Update: 2018-10-24 This patch allows Open MPI to build on Debian GNU/HURD. Also, the memory:linux MCA component is disabled, since its use of POSIX API in malloc hooks called very early at startup causes troubles. Also changes by Samuel Thibault See bugs.debian.org/846965 Gbp-Pq: Name build_hurd --- 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 f8a031a9..e642000a 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 (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 7ad6e6d9..ecbf17c3 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(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 d409296d..a1291a21 100644 --- a/opal/mca/base/mca_base_var.c +++ b/opal/mca/base/mca_base_var.c @@ -51,6 +51,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/util/stacktrace.c b/opal/util/stacktrace.c index afb791e6..d435a8a7 100644 --- a/opal/util/stacktrace.c +++ b/opal/util/stacktrace.c @@ -588,8 +588,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 69974bb5..2307e1e9 100644 --- a/orte/mca/odls/base/odls_base_default_fns.c +++ b/orte/mca/odls/base/odls_base_default_fns.c @@ -859,7 +859,11 @@ static int setup_path(orte_app_context_t *app, char **wdir) * again not match getcwd! This is beyond our control - we are only * ensuring they start out matching. */ +#if !defined(MAXPATHLEN) && defined(__GLIBC__) + basedir = get_current_dir_name(); +#else getcwd(dir, sizeof(dir)); +#endif *wdir = strdup(dir); opal_setenv("PWD", dir, true, &app->env); /* update the initial wdir value too */ @@ -1068,7 +1072,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; @@ -2064,7 +2072,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))) {