Skip to content

Commit 8cc3f28

Browse files
committed
opal: fix opal_class_finalize() usage
the class system can be initialized/finalized as many times as we like, so there is no more need to have opal_class_finalize() invoked in a destructor Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 31799ec commit 8cc3f28

File tree

4 files changed

+5
-40
lines changed

4 files changed

+5
-40
lines changed

configure.ac

-14
Original file line numberDiff line numberDiff line change
@@ -823,20 +823,6 @@ AC_TRY_LINK([void finalize (void) {}], [], [AC_MSG_RESULT([yes])
823823
LDFLAGS=$LDFLAGS_save
824824
OPAL_VAR_SCOPE_POP
825825

826-
opal_destructor_use_fini=0
827-
opal_no_destructor=0
828-
if test x$opal_cv___attribute__destructor = x0 ; then
829-
if test x$opal_ld_have_fini = x1 ; then
830-
opal_destructor_use_fini=1
831-
else
832-
opal_no_destructor=1;
833-
fi
834-
fi
835-
836-
AC_DEFINE_UNQUOTED(OPAL_NO_LIB_DESTRUCTOR, [$opal_no_destructor],
837-
[Whether libraries can be configured with destructor functions])
838-
AM_CONDITIONAL(OPAL_DESTRUCTOR_USE_FINI, [test x$opal_destructor_use_fini = x1])
839-
840826
##################################
841827
# Libraries
842828
##################################

opal/Makefile.am

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# All rights reserved.
1212
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
1313
# Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
14+
# Copyright (c) 2016 Research Organization for Information Science
15+
# and Technology (RIST). All rights reserved.
1416
# $COPYRIGHT$
1517
#
1618
# Additional copyrights may follow
@@ -56,12 +58,6 @@ lib@OPAL_LIB_PREFIX@open_pal_la_LIBADD = \
5658
lib@OPAL_LIB_PREFIX@open_pal_la_DEPENDENCIES = $(lib@OPAL_LIB_PREFIX@open_pal_la_LIBADD)
5759
lib@OPAL_LIB_PREFIX@open_pal_la_LDFLAGS = -version-info $(libopen_pal_so_version)
5860

59-
if OPAL_DESTRUCTOR_USE_FINI
60-
61-
lib@OPAL_LIB_PREFIX@open_pal_la_LDFLAGS += -Wl,-fini -Wl,opal_cleanup
62-
63-
endif
64-
6561
# included subdirectory Makefile.am's and appended-to variables
6662
headers =
6763
noinst_LTLIBRARIES =

opal/runtime/opal_finalize.c

+2-9
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ extern int opal_initialized;
6060
extern int opal_util_initialized;
6161
extern bool opal_init_called;
6262

63-
static void __opal_attribute_destructor__ opal_cleanup (void)
64-
{
65-
/* finalize the class/object system */
66-
opal_class_finalize();
67-
}
68-
6963
int
7064
opal_finalize_util(void)
7165
{
@@ -109,9 +103,8 @@ opal_finalize_util(void)
109103

110104
opal_datatype_finalize();
111105

112-
#if OPAL_NO_LIB_DESTRUCTOR
113-
opal_cleanup ();
114-
#endif
106+
/* finalize the class/object system */
107+
opal_class_finalize();
115108

116109
free (opal_process_info.nodename);
117110
opal_process_info.nodename = NULL;

opal/runtime/opal_init.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
1717
* All rights reserved.
1818
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved
19-
* Copyright (c) 2015 Research Organization for Information Science
19+
* Copyright (c) 2015-2016 Research Organization for Information Science
2020
* and Technology (RIST). All rights reserved.
2121
* $COPYRIGHT$
2222
*
@@ -343,16 +343,6 @@ opal_init_util(int* pargc, char*** pargv)
343343
return OPAL_SUCCESS;
344344
}
345345

346-
#if OPAL_NO_LIB_DESTRUCTOR
347-
if (opal_init_called) {
348-
/* can't use show_help here */
349-
fprintf (stderr, "opal_init_util: attempted to initialize after finalize without compiler "
350-
"support for either __attribute__(destructor) or linker support for -fini -- process "
351-
"will likely abort\n");
352-
return OPAL_ERR_NOT_SUPPORTED;
353-
}
354-
#endif
355-
356346
opal_init_called = true;
357347

358348
/* set the nodename right away so anyone who needs it has it. Note

0 commit comments

Comments
 (0)