Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __optnone__ attribute for Clang #4715

Merged
merged 3 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion config/opal_check_attributes.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved
dnl Copyright (c) 2013 Mellanox Technologies, Inc.
dnl All rights reserved.
dnl Copyright (c) 2015 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2017 Intel, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
Expand Down Expand Up @@ -221,6 +222,7 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
opal_cv___attribute__warn_unused_result=0
opal_cv___attribute__weak_alias=0
opal_cv___attribute__destructor=0
opal_cv___attribute__optnone=0
else
AC_MSG_RESULT([yes])

Expand Down Expand Up @@ -556,6 +558,21 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
],
[],
[])

_OPAL_CHECK_SPECIFIC_ATTRIBUTE([optnone],
[
void __attribute__ ((__optnone__)) foo(void);
void foo(void) { return ; }
],
[],
[])

_OPAL_CHECK_SPECIFIC_ATTRIBUTE([extension],
[
int i = __extension__ 3;
],
[],
[])
fi

# Now that all the values are set, define them
Expand Down Expand Up @@ -608,4 +625,8 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
[Whether your compiler has __attribute__ weak alias or not])
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_DESTRUCTOR, [$opal_cv___attribute__destructor],
[Whether your compiler has __attribute__ destructor or not])
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_OPTNONE, [$opal_cv___attribute__optnone],
[Whether your compiler has __attribute__ optnone or not])
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_EXTENSION, [$opal_cv___attribute__extension],
[Whether your compiler has __attribute__ extension or not])
])
20 changes: 16 additions & 4 deletions opal/include/opal_config_bottom.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* All rights reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -234,6 +234,18 @@
# define __opal_attribute_destructor__
#endif

#if OPAL_HAVE_ATTRIBUTE_OPTNONE
# define __opal_attribute_optnone__ __attribute__((__optnone__))
#else
# define __opal_attribute_optnone__
#endif

#if OPAL_HAVE_ATTRIBUTE_EXTENSION
# define __opal_attribute_extension__ __extension__
#else
# define __opal_attribute_extension__
#endif

# if OPAL_C_HAVE_VISIBILITY
# define OPAL_DECLSPEC __opal_attribute_visibility__("default")
# define OPAL_MODULE_DECLSPEC __opal_attribute_visibility__("default")
Expand Down Expand Up @@ -268,11 +280,11 @@
#include <sys/param.h>
#endif
#if defined(PATH_MAX)
#define OPAL_PATH_MAX (PATH_MAX + 1)
#define OPAL_PATH_MAX (PATH_MAX + 1)
#elif defined(_POSIX_PATH_MAX)
#define OPAL_PATH_MAX (_POSIX_PATH_MAX + 1)
#define OPAL_PATH_MAX (_POSIX_PATH_MAX + 1)
#else
#define OPAL_PATH_MAX 256
#define OPAL_PATH_MAX 256
#endif

/*
Expand Down
2 changes: 1 addition & 1 deletion orte/orted/orted_submit.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ char MPIR_attach_fifo[MPIR_MAX_PATH_LENGTH] = {0};
int MPIR_force_to_main = 0;
static void orte_debugger_init_before_spawn(orte_job_t *jdata);

ORTE_DECLSPEC void* MPIR_Breakpoint(void);
ORTE_DECLSPEC void* __opal_attribute_optnone__ MPIR_Breakpoint(void);

/*
* Breakpoint function for parallel debuggers
Expand Down