diff mbox

[API-NEXT,PATCHv4] api: make only the API visible

Message ID 1460568613-24729-1-git-send-email-anders.roxell@linaro.org
State Accepted
Commit f562a886695fc8eb3832f4e7a13d4bff80db529a
Headers show

Commit Message

Anders Roxell April 13, 2016, 5:30 p.m. UTC
Internal functions should not be part of symbols that are visible
outside the library. Using -fvisibility=hidden hides all internal
functions from the public ABI.

Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 include/odp/api/spec/align.h              |  8 ++++++++
 include/odp/api/spec/atomic.h             |  8 ++++++++
 include/odp/api/spec/barrier.h            |  8 ++++++++
 include/odp/api/spec/buffer.h             |  8 ++++++++
 include/odp/api/spec/byteorder.h          |  8 ++++++++
 include/odp/api/spec/classification.h     |  8 ++++++++
 include/odp/api/spec/compiler.h           |  8 ++++++++
 include/odp/api/spec/config.h             |  8 ++++++++
 include/odp/api/spec/cpu.h                |  8 ++++++++
 include/odp/api/spec/cpumask.h            |  8 ++++++++
 include/odp/api/spec/crypto.h             |  8 ++++++++
 include/odp/api/spec/debug.h              |  8 ++++++++
 include/odp/api/spec/errno.h              |  8 ++++++++
 include/odp/api/spec/event.h              |  8 ++++++++
 include/odp/api/spec/hash.h               |  8 ++++++++
 include/odp/api/spec/hints.h              |  8 ++++++++
 include/odp/api/spec/init.h               |  8 ++++++++
 include/odp/api/spec/packet.h             |  8 ++++++++
 include/odp/api/spec/packet_flags.h       |  8 ++++++++
 include/odp/api/spec/packet_io.h          |  8 ++++++++
 include/odp/api/spec/packet_io_stats.h    |  8 ++++++++
 include/odp/api/spec/pool.h               |  8 ++++++++
 include/odp/api/spec/queue.h              |  8 ++++++++
 include/odp/api/spec/random.h             |  8 ++++++++
 include/odp/api/spec/rwlock.h             |  8 ++++++++
 include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++
 include/odp/api/spec/schedule.h           |  8 ++++++++
 include/odp/api/spec/schedule_types.h     |  8 ++++++++
 include/odp/api/spec/shared_memory.h      |  8 ++++++++
 include/odp/api/spec/spinlock.h           |  8 ++++++++
 include/odp/api/spec/spinlock_recursive.h |  8 ++++++++
 include/odp/api/spec/std_clib.h           |  8 ++++++++
 include/odp/api/spec/std_types.h          |  8 ++++++++
 include/odp/api/spec/sync.h               |  8 ++++++++
 include/odp/api/spec/system_info.h        |  8 ++++++++
 include/odp/api/spec/thread.h             |  8 ++++++++
 include/odp/api/spec/thrmask.h            |  8 ++++++++
 include/odp/api/spec/ticketlock.h         |  8 ++++++++
 include/odp/api/spec/time.h               |  8 ++++++++
 include/odp/api/spec/timer.h              |  8 ++++++++
 include/odp/api/spec/traffic_mngr.h       |  8 ++++++++
 include/odp/api/spec/version.h            |  8 ++++++++
 platform/Makefile.inc                     |  1 +
 platform/linux-generic/m4/configure.m4    | 12 ++++++++++++
 44 files changed, 349 insertions(+)

Comments

Bill Fischofer April 13, 2016, 5:47 p.m. UTC | #1
On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell <anders.roxell@linaro.org>
wrote:

> Internal functions should not be part of symbols that are visible

> outside the library. Using -fvisibility=hidden hides all internal

> functions from the public ABI.

>

> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>

> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> ---

>  include/odp/api/spec/align.h              |  8 ++++++++

>  include/odp/api/spec/atomic.h             |  8 ++++++++

>  include/odp/api/spec/barrier.h            |  8 ++++++++

>  include/odp/api/spec/buffer.h             |  8 ++++++++

>  include/odp/api/spec/byteorder.h          |  8 ++++++++

>  include/odp/api/spec/classification.h     |  8 ++++++++

>  include/odp/api/spec/compiler.h           |  8 ++++++++

>  include/odp/api/spec/config.h             |  8 ++++++++

>  include/odp/api/spec/cpu.h                |  8 ++++++++

>  include/odp/api/spec/cpumask.h            |  8 ++++++++

>  include/odp/api/spec/crypto.h             |  8 ++++++++

>  include/odp/api/spec/debug.h              |  8 ++++++++

>  include/odp/api/spec/errno.h              |  8 ++++++++

>  include/odp/api/spec/event.h              |  8 ++++++++

>  include/odp/api/spec/hash.h               |  8 ++++++++

>  include/odp/api/spec/hints.h              |  8 ++++++++

>  include/odp/api/spec/init.h               |  8 ++++++++

>  include/odp/api/spec/packet.h             |  8 ++++++++

>  include/odp/api/spec/packet_flags.h       |  8 ++++++++

>  include/odp/api/spec/packet_io.h          |  8 ++++++++

>  include/odp/api/spec/packet_io_stats.h    |  8 ++++++++

>  include/odp/api/spec/pool.h               |  8 ++++++++

>  include/odp/api/spec/queue.h              |  8 ++++++++

>  include/odp/api/spec/random.h             |  8 ++++++++

>  include/odp/api/spec/rwlock.h             |  8 ++++++++

>  include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++

>  include/odp/api/spec/schedule.h           |  8 ++++++++

>  include/odp/api/spec/schedule_types.h     |  8 ++++++++

>  include/odp/api/spec/shared_memory.h      |  8 ++++++++

>  include/odp/api/spec/spinlock.h           |  8 ++++++++

>  include/odp/api/spec/spinlock_recursive.h |  8 ++++++++

>  include/odp/api/spec/std_clib.h           |  8 ++++++++

>  include/odp/api/spec/std_types.h          |  8 ++++++++

>  include/odp/api/spec/sync.h               |  8 ++++++++

>  include/odp/api/spec/system_info.h        |  8 ++++++++

>  include/odp/api/spec/thread.h             |  8 ++++++++

>  include/odp/api/spec/thrmask.h            |  8 ++++++++

>  include/odp/api/spec/ticketlock.h         |  8 ++++++++

>  include/odp/api/spec/time.h               |  8 ++++++++

>  include/odp/api/spec/timer.h              |  8 ++++++++

>  include/odp/api/spec/traffic_mngr.h       |  8 ++++++++

>  include/odp/api/spec/version.h            |  8 ++++++++

>  platform/Makefile.inc                     |  1 +

>  platform/linux-generic/m4/configure.m4    | 12 ++++++++++++

>  44 files changed, 349 insertions(+)

>

> diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h

> index 677ff12..027b080 100644

> --- a/include/odp/api/spec/align.h

> +++ b/include/odp/api/spec/align.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

>


Do these need to be guarded?  Do we care about GCC < 4 at this point? How
does this affect clang?


> +

>  /** @addtogroup odp_compiler_optim

>   *  Macros that allow cache line size configuration, check that

>   *  alignment is a power of two etc.

> @@ -70,6 +74,10 @@ extern "C" {

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h

> index a16d90b..b926964 100644

> --- a/include/odp/api/spec/atomic.h

> +++ b/include/odp/api/spec/atomic.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @defgroup odp_atomic ODP ATOMIC

>   * @details

> @@ -624,6 +628,10 @@ int odp_atomic_lock_free_u64(odp_atomic_op_t

> *atomic_op);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/barrier.h

> b/include/odp/api/spec/barrier.h

> index 823eae6..34c3658 100644

> --- a/include/odp/api/spec/barrier.h

> +++ b/include/odp/api/spec/barrier.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @defgroup odp_barrier ODP BARRIER

>   * Thread excution and memory ordering barriers.

> @@ -59,6 +63,10 @@ void odp_barrier_wait(odp_barrier_t *barr);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h

> index 6631f47..caa2cb6 100644

> --- a/include/odp/api/spec/buffer.h

> +++ b/include/odp/api/spec/buffer.h

> @@ -19,6 +19,10 @@ extern "C" {

>  #endif

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_buffer ODP BUFFER

>   *  Operations on a buffer.

>   *  @{

> @@ -163,6 +167,10 @@ uint64_t odp_buffer_to_u64(odp_buffer_t hdl);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/byteorder.h

> b/include/odp/api/spec/byteorder.h

> index a12a729..17f7ebe 100644

> --- a/include/odp/api/spec/byteorder.h

> +++ b/include/odp/api/spec/byteorder.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_compiler_optim ODP COMPILER / OPTIMIZATION

>   *  Macros that check byte order and operations for byte order conversion.

>   *  @{

> @@ -173,6 +177,10 @@ odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/classification.h

> b/include/odp/api/spec/classification.h

> index 076b3de..f200869 100644

> --- a/include/odp/api/spec/classification.h

> +++ b/include/odp/api/spec/classification.h

> @@ -19,6 +19,10 @@ extern "C" {

>  #endif

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_classification ODP CLASSIFICATION

>   *  Classification operations.

>   *  @{

> @@ -392,6 +396,10 @@ uint64_t odp_pmr_to_u64(odp_pmr_t hdl);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/compiler.h

> b/include/odp/api/spec/compiler.h

> index 5a24bfb..1b6d05f 100644

> --- a/include/odp/api/spec/compiler.h

> +++ b/include/odp/api/spec/compiler.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @addtogroup odp_compiler_optim

>   *  Macro for old compilers

>   *  @{

> @@ -44,6 +48,10 @@ extern "C" {

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/config.h b/include/odp/api/spec/config.h

> index c9879d6..14e54e1 100644

> --- a/include/odp/api/spec/config.h

> +++ b/include/odp/api/spec/config.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_config ODP CONFIG

>   *  Platform-specific configuration limits.

>   *

> @@ -157,6 +161,10 @@ int odp_config_shm_blocks(void);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h

> index f0e20c4..e87875e 100644

> --- a/include/odp/api/spec/cpu.h

> +++ b/include/odp/api/spec/cpu.h

> @@ -20,6 +20,10 @@ extern "C" {

>

>  #include <odp/api/std_types.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_cpu ODP CPU

>   *  @{

>   */

> @@ -172,6 +176,10 @@ void odp_cpu_pause(void);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/cpumask.h

> b/include/odp/api/spec/cpumask.h

> index 42098c2..3fc7694 100644

> --- a/include/odp/api/spec/cpumask.h

> +++ b/include/odp/api/spec/cpumask.h

> @@ -20,6 +20,10 @@ extern "C" {

>

>  #include <odp/api/config.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_cpumask ODP CPUMASK

>   *  CPU mask operations.

>   *  @{

> @@ -247,6 +251,10 @@ int odp_cpumask_all_available(odp_cpumask_t *mask);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h

> index 7c6f9bc..7ac5ad1 100644

> --- a/include/odp/api/spec/crypto.h

> +++ b/include/odp/api/spec/crypto.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_crypto ODP CRYPTO

>   *  Macros, enums, types and operations to utilise crypto.

>   *  @{

> @@ -367,6 +371,10 @@ uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t

> hdl);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/debug.h b/include/odp/api/spec/debug.h

> index 252a82f..c1ecd78 100644

> --- a/include/odp/api/spec/debug.h

> +++ b/include/odp/api/spec/debug.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  #if defined(__GNUC__) && !defined(__clang__)

>

>

> @@ -43,6 +47,10 @@ extern "C" {

>  #define _ODP_STATIC_ASSERT(cond, msg)  _Static_assert(cond, msg)

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/errno.h b/include/odp/api/spec/errno.h

> index 33998b6..a337334 100644

> --- a/include/odp/api/spec/errno.h

> +++ b/include/odp/api/spec/errno.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @defgroup odp_errno ODP ERRNO

>   * @details

> @@ -78,6 +82,10 @@ const char *odp_errno_str(int errnum);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h

> index 29547f3..3a7c149 100644

> --- a/include/odp/api/spec/event.h

> +++ b/include/odp/api/spec/event.h

> @@ -19,6 +19,10 @@ extern "C" {

>  #endif

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_event ODP EVENT

>   *  Operations on an event.

>   *  @{

> @@ -79,6 +83,10 @@ void odp_event_free(odp_event_t event);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/hash.h b/include/odp/api/spec/hash.h

> index a6bc753..b00a6ad 100644

> --- a/include/odp/api/spec/hash.h

> +++ b/include/odp/api/spec/hash.h

> @@ -19,6 +19,10 @@ extern "C" {

>

>  #include <odp/api/std_types.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_hash ODP HASH FUNCTIONS

>   *  ODP Hash functions

>   *  @{

> @@ -91,6 +95,10 @@ int odp_hash_crc_gen64(const void *data, uint32_t

> data_len,

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/hints.h b/include/odp/api/spec/hints.h

> index ea67fc4..325ef15 100644

> --- a/include/odp/api/spec/hints.h

> +++ b/include/odp/api/spec/hints.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @addtogroup odp_compiler_optim

>   *  Macros that will give hints to the compiler.

>   *  @{

> @@ -109,6 +113,10 @@ extern "C" {

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h

> index 8560663..ff9e343 100644

> --- a/include/odp/api/spec/init.h

> +++ b/include/odp/api/spec/init.h

> @@ -33,6 +33,10 @@ extern "C" {

>  #include <odp/api/thread.h>

>  #include <odp/api/cpumask.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_initialization ODP INITIALIZATION

>   *  Initialisation operations.

>   *  @{

> @@ -274,6 +278,10 @@ int odp_term_local(void);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h

> index 7da353b..4305ea0 100644

> --- a/include/odp/api/spec/packet.h

> +++ b/include/odp/api/spec/packet.h

> @@ -20,6 +20,10 @@ extern "C" {

>

>  #include <odp/api/time.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_packet ODP PACKET

>   *  Operations on a packet.

>   *  @{

> @@ -1060,6 +1064,10 @@ uint64_t odp_packet_seg_to_u64(odp_packet_seg_t

> hdl);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/packet_flags.h

> b/include/odp/api/spec/packet_flags.h

> index 35d44e1..cc63cda 100644

> --- a/include/odp/api/spec/packet_flags.h

> +++ b/include/odp/api/spec/packet_flags.h

> @@ -21,6 +21,10 @@ extern "C" {

>  #include <odp/api/std_types.h>

>  #include <odp/api/packet.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @addtogroup odp_packet

>   *  Boolean operations on a packet.

>   *  @{

> @@ -489,6 +493,10 @@ void odp_packet_has_ts_clr(odp_packet_t pkt);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/packet_io.h

> b/include/odp/api/spec/packet_io.h

> index 466cab6..ddf9e05 100644

> --- a/include/odp/api/spec/packet_io.h

> +++ b/include/odp/api/spec/packet_io.h

> @@ -22,6 +22,10 @@ extern "C" {

>  #include <odp/api/queue.h>

>  #include <odp/api/time.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_packet_io ODP PACKET IO

>   *  Operations on a packet Input/Output interface.

>   *

> @@ -1034,6 +1038,10 @@ odp_time_t odp_pktin_ts_from_ns(odp_pktio_t pktio,

> uint64_t ns);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/packet_io_stats.h

> b/include/odp/api/spec/packet_io_stats.h

> index 148ad8d..3fe31d7 100644

> --- a/include/odp/api/spec/packet_io_stats.h

> +++ b/include/odp/api/spec/packet_io_stats.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @addtogroup odp_packet_io

>   *  @{

>   */

> @@ -134,6 +138,10 @@ int odp_pktio_stats_reset(odp_pktio_t pktio);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h

> index 94a302e..8f3c19e 100644

> --- a/include/odp/api/spec/pool.h

> +++ b/include/odp/api/spec/pool.h

> @@ -22,6 +22,10 @@ extern "C" {

>

>  #include <odp/api/std_types.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_pool ODP POOL

>   *  Operations on a pool.

>   *  @{

> @@ -206,6 +210,10 @@ void odp_pool_param_init(odp_pool_param_t *param);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h

> index 51d94a2..2e767e7 100644

> --- a/include/odp/api/spec/queue.h

> +++ b/include/odp/api/spec/queue.h

> @@ -21,6 +21,10 @@ extern "C" {

>  #include <odp/api/schedule_types.h>

>  #include <odp/api/event.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_queue ODP QUEUE

>   *  Macros and operation on a queue.

>   *  @{

> @@ -370,6 +374,10 @@ int odp_queue_info(odp_queue_t queue,

> odp_queue_info_t *info);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/random.h b/include/odp/api/spec/random.h

> index 435783a..d1f9267 100644

> --- a/include/odp/api/spec/random.h

> +++ b/include/odp/api/spec/random.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_random ODP RANDOM

>   *  @{

>   */

> @@ -41,6 +45,10 @@ int32_t odp_random_data(uint8_t *buf, int32_t size,

> odp_bool_t use_entropy);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/rwlock.h b/include/odp/api/spec/rwlock.h

> index 9ca8872..7d23430 100644

> --- a/include/odp/api/spec/rwlock.h

> +++ b/include/odp/api/spec/rwlock.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @defgroup odp_locks ODP LOCKS

>   * @details

> @@ -95,6 +99,10 @@ void odp_rwlock_write_unlock(odp_rwlock_t *rwlock);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/rwlock_recursive.h

> b/include/odp/api/spec/rwlock_recursive.h

> index 965fcc0..1631491 100644

> --- a/include/odp/api/spec/rwlock_recursive.h

> +++ b/include/odp/api/spec/rwlock_recursive.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @addtogroup odp_locks

>   * @details

> @@ -113,6 +117,10 @@ void

> odp_rwlock_recursive_write_unlock(odp_rwlock_recursive_t *lock);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/schedule.h

> b/include/odp/api/spec/schedule.h

> index cd1325a..cff56ac 100644

> --- a/include/odp/api/spec/schedule.h

> +++ b/include/odp/api/spec/schedule.h

> @@ -25,6 +25,10 @@ extern "C" {

>  #include <odp/api/schedule_types.h>

>  #include <odp/api/thrmask.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_scheduler ODP SCHEDULER

>   *  Operations on the scheduler.

>   *  @{

> @@ -371,6 +375,10 @@ void odp_schedule_order_unlock(unsigned lock_index);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/schedule_types.h

> b/include/odp/api/spec/schedule_types.h

> index 34046af..11fc001 100644

> --- a/include/odp/api/spec/schedule_types.h

> +++ b/include/odp/api/spec/schedule_types.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @addtogroup odp_scheduler

>   *  @{

>   */

> @@ -152,6 +156,10 @@ typedef    struct odp_schedule_param_t {

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/shared_memory.h

> b/include/odp/api/spec/shared_memory.h

> index 5d851ce..8969462 100644

> --- a/include/odp/api/spec/shared_memory.h

> +++ b/include/odp/api/spec/shared_memory.h

> @@ -19,6 +19,10 @@ extern "C" {

>  #endif

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_shared_memory ODP SHARED MEMORY

>   *  Operations on shared memory.

>   *  @{

> @@ -148,6 +152,10 @@ uint64_t odp_shm_to_u64(odp_shm_t hdl);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/spinlock.h

> b/include/odp/api/spec/spinlock.h

> index a73359d..02e9d1a 100644

> --- a/include/odp/api/spec/spinlock.h

> +++ b/include/odp/api/spec/spinlock.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @addtogroup odp_locks

>   * @details

> @@ -84,6 +88,10 @@ int odp_spinlock_is_locked(odp_spinlock_t *splock);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/spinlock_recursive.h

> b/include/odp/api/spec/spinlock_recursive.h

> index d98f2bb..457998a 100644

> --- a/include/odp/api/spec/spinlock_recursive.h

> +++ b/include/odp/api/spec/spinlock_recursive.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @addtogroup odp_locks

>   * @details

> @@ -78,6 +82,10 @@ int

> odp_spinlock_recursive_is_locked(odp_spinlock_recursive_t *lock);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/std_clib.h

> b/include/odp/api/spec/std_clib.h

> index 791b72f..de5976c 100644

> --- a/include/odp/api/spec/std_clib.h

> +++ b/include/odp/api/spec/std_clib.h

> @@ -17,6 +17,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @defgroup odp_std_clib ODP STD CLIB

>   * @details

> @@ -75,6 +79,10 @@ int odp_memcmp(const void *ptr1, const void *ptr2,

> size_t num);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/std_types.h

> b/include/odp/api/spec/std_types.h

> index 7558c64..f138e94 100644

> --- a/include/odp/api/spec/std_types.h

> +++ b/include/odp/api/spec/std_types.h

> @@ -20,6 +20,10 @@ extern "C" {

>  #endif

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @addtogroup odp_system ODP SYSTEM

>   *  @{

>   */

> @@ -35,6 +39,10 @@ extern "C" {

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/sync.h b/include/odp/api/spec/sync.h

> index c6f790c..1faa49b 100644

> --- a/include/odp/api/spec/sync.h

> +++ b/include/odp/api/spec/sync.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @addtogroup odp_barrier

>   * @details

> @@ -83,6 +87,10 @@ void odp_mb_full(void);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/system_info.h

> b/include/odp/api/spec/system_info.h

> index bde3a60..0191b88 100644

> --- a/include/odp/api/spec/system_info.h

> +++ b/include/odp/api/spec/system_info.h

> @@ -19,6 +19,10 @@ extern "C" {

>  #endif

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_system ODP SYSTEM

>   *  @{

>   */

> @@ -48,6 +52,10 @@ int odp_sys_cache_line_size(void);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h

> index 3720249..94101c8 100644

> --- a/include/odp/api/spec/thread.h

> +++ b/include/odp/api/spec/thread.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_thread ODP THREAD

>   *  @{

>   */

> @@ -105,6 +109,10 @@ odp_thread_type_t odp_thread_type(void);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/thrmask.h

> b/include/odp/api/spec/thrmask.h

> index a22da8c..4eb8e29 100644

> --- a/include/odp/api/spec/thrmask.h

> +++ b/include/odp/api/spec/thrmask.h

> @@ -19,6 +19,10 @@ extern "C" {

>

>  #include <odp/api/std_types.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @addtogroup odp_thread

>   *  Thread mask operations.

>   *  @{

> @@ -232,6 +236,10 @@ int odp_thrmask_control(odp_thrmask_t *mask);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/ticketlock.h

> b/include/odp/api/spec/ticketlock.h

> index 3f0e3f5..071a5f0 100644

> --- a/include/odp/api/spec/ticketlock.h

> +++ b/include/odp/api/spec/ticketlock.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @addtogroup odp_locks

>   * @details

> @@ -83,6 +87,10 @@ int odp_ticketlock_is_locked(odp_ticketlock_t *tklock);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h

> index 85692ec..62873bc 100644

> --- a/include/odp/api/spec/time.h

> +++ b/include/odp/api/spec/time.h

> @@ -19,6 +19,10 @@ extern "C" {

>  #endif

>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_time ODP TIME

>   *  @{

>   */

> @@ -174,6 +178,10 @@ uint64_t odp_time_to_u64(odp_time_t time);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h

> index 435c004..e83a76c 100644

> --- a/include/odp/api/spec/timer.h

> +++ b/include/odp/api/spec/timer.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /** @defgroup odp_timer ODP TIMER

>   *  @{

>   */

> @@ -408,6 +412,10 @@ uint64_t odp_timeout_to_u64(odp_timeout_t hdl);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/traffic_mngr.h

> b/include/odp/api/spec/traffic_mngr.h

> index ce124a8..d7a6248 100644

> --- a/include/odp/api/spec/traffic_mngr.h

> +++ b/include/odp/api/spec/traffic_mngr.h

> @@ -14,6 +14,10 @@ extern "C" {

>  #include <odp/api/std_types.h>

>  #include <odp/api/packet_io.h>

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @file

>   *

> @@ -1367,6 +1371,10 @@ void odp_tm_stats_print(odp_tm_t odp_tm);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/include/odp/api/spec/version.h

> b/include/odp/api/spec/version.h

> index 642831c..22cb371 100644

> --- a/include/odp/api/spec/version.h

> +++ b/include/odp/api/spec/version.h

> @@ -18,6 +18,10 @@

>  extern "C" {

>  #endif

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility push(default)

> +#endif

> +

>  /**

>   * @defgroup odp_version ODP VERSION

>   * @details

> @@ -98,6 +102,10 @@ const char *odp_version_impl_str(void);

>   * @}

>   */

>

> +#if __GNUC__ >= 4

> +#pragma GCC visibility pop

> +#endif

> +

>  #ifdef __cplusplus

>  }

>  #endif

> diff --git a/platform/Makefile.inc b/platform/Makefile.inc

> index 1cb7a71..5aa3fed 100644

> --- a/platform/Makefile.inc

> +++ b/platform/Makefile.inc

> @@ -15,6 +15,7 @@ AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'

>  GIT_DESC = `$(top_srcdir)/scripts/get_impl_str.sh $(top_srcdir)`

>  AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"

>  AM_CFLAGS += -DPLATFORM=${with_platform}

> +AM_CFLAGS += $(VISIBILITY_CFLAGS)

>

>  #The implementation will need to retain the deprecated implementation

>  AM_CFLAGS += -Wno-deprecated-declarations

> diff --git a/platform/linux-generic/m4/configure.m4

> b/platform/linux-generic/m4/configure.m4

> index f80c66c..75a3797 100644

> --- a/platform/linux-generic/m4/configure.m4

> +++ b/platform/linux-generic/m4/configure.m4

> @@ -1,3 +1,15 @@

> +# Enable -fvisibility=hidden if using a gcc that supports it

> +OLD_CFLAGS="$CFLAGS"

> +AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])

> +VISIBILITY_CFLAGS="-fvisibility=hidden"

> +CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"

> +AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),

> +       [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);

> +

> +AC_SUBST(VISIBILITY_CFLAGS)

> +# Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.

> +CFLAGS=$OLD_CFLAGS

> +

>  AC_MSG_CHECKING(for GCC atomic builtins)

>  AC_LINK_IFELSE(

>      [AC_LANG_SOURCE(

> --

> 2.1.4

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Bill Fischofer April 13, 2016, 5:48 p.m. UTC | #2
For reference, GCC 4.0 was released in April 2005.

On Wed, Apr 13, 2016 at 12:47 PM, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

>

> On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell <anders.roxell@linaro.org>

> wrote:

>

>> Internal functions should not be part of symbols that are visible

>> outside the library. Using -fvisibility=hidden hides all internal

>> functions from the public ABI.

>>

>> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>

>> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

>> ---

>>  include/odp/api/spec/align.h              |  8 ++++++++

>>  include/odp/api/spec/atomic.h             |  8 ++++++++

>>  include/odp/api/spec/barrier.h            |  8 ++++++++

>>  include/odp/api/spec/buffer.h             |  8 ++++++++

>>  include/odp/api/spec/byteorder.h          |  8 ++++++++

>>  include/odp/api/spec/classification.h     |  8 ++++++++

>>  include/odp/api/spec/compiler.h           |  8 ++++++++

>>  include/odp/api/spec/config.h             |  8 ++++++++

>>  include/odp/api/spec/cpu.h                |  8 ++++++++

>>  include/odp/api/spec/cpumask.h            |  8 ++++++++

>>  include/odp/api/spec/crypto.h             |  8 ++++++++

>>  include/odp/api/spec/debug.h              |  8 ++++++++

>>  include/odp/api/spec/errno.h              |  8 ++++++++

>>  include/odp/api/spec/event.h              |  8 ++++++++

>>  include/odp/api/spec/hash.h               |  8 ++++++++

>>  include/odp/api/spec/hints.h              |  8 ++++++++

>>  include/odp/api/spec/init.h               |  8 ++++++++

>>  include/odp/api/spec/packet.h             |  8 ++++++++

>>  include/odp/api/spec/packet_flags.h       |  8 ++++++++

>>  include/odp/api/spec/packet_io.h          |  8 ++++++++

>>  include/odp/api/spec/packet_io_stats.h    |  8 ++++++++

>>  include/odp/api/spec/pool.h               |  8 ++++++++

>>  include/odp/api/spec/queue.h              |  8 ++++++++

>>  include/odp/api/spec/random.h             |  8 ++++++++

>>  include/odp/api/spec/rwlock.h             |  8 ++++++++

>>  include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++

>>  include/odp/api/spec/schedule.h           |  8 ++++++++

>>  include/odp/api/spec/schedule_types.h     |  8 ++++++++

>>  include/odp/api/spec/shared_memory.h      |  8 ++++++++

>>  include/odp/api/spec/spinlock.h           |  8 ++++++++

>>  include/odp/api/spec/spinlock_recursive.h |  8 ++++++++

>>  include/odp/api/spec/std_clib.h           |  8 ++++++++

>>  include/odp/api/spec/std_types.h          |  8 ++++++++

>>  include/odp/api/spec/sync.h               |  8 ++++++++

>>  include/odp/api/spec/system_info.h        |  8 ++++++++

>>  include/odp/api/spec/thread.h             |  8 ++++++++

>>  include/odp/api/spec/thrmask.h            |  8 ++++++++

>>  include/odp/api/spec/ticketlock.h         |  8 ++++++++

>>  include/odp/api/spec/time.h               |  8 ++++++++

>>  include/odp/api/spec/timer.h              |  8 ++++++++

>>  include/odp/api/spec/traffic_mngr.h       |  8 ++++++++

>>  include/odp/api/spec/version.h            |  8 ++++++++

>>  platform/Makefile.inc                     |  1 +

>>  platform/linux-generic/m4/configure.m4    | 12 ++++++++++++

>>  44 files changed, 349 insertions(+)

>>

>> diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h

>> index 677ff12..027b080 100644

>> --- a/include/odp/api/spec/align.h

>> +++ b/include/odp/api/spec/align.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>>

>

> Do these need to be guarded?  Do we care about GCC < 4 at this point? How

> does this affect clang?

>

>

>> +

>>  /** @addtogroup odp_compiler_optim

>>   *  Macros that allow cache line size configuration, check that

>>   *  alignment is a power of two etc.

>> @@ -70,6 +74,10 @@ extern "C" {

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h

>> index a16d90b..b926964 100644

>> --- a/include/odp/api/spec/atomic.h

>> +++ b/include/odp/api/spec/atomic.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @defgroup odp_atomic ODP ATOMIC

>>   * @details

>> @@ -624,6 +628,10 @@ int odp_atomic_lock_free_u64(odp_atomic_op_t

>> *atomic_op);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/barrier.h

>> b/include/odp/api/spec/barrier.h

>> index 823eae6..34c3658 100644

>> --- a/include/odp/api/spec/barrier.h

>> +++ b/include/odp/api/spec/barrier.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @defgroup odp_barrier ODP BARRIER

>>   * Thread excution and memory ordering barriers.

>> @@ -59,6 +63,10 @@ void odp_barrier_wait(odp_barrier_t *barr);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h

>> index 6631f47..caa2cb6 100644

>> --- a/include/odp/api/spec/buffer.h

>> +++ b/include/odp/api/spec/buffer.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>  #endif

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_buffer ODP BUFFER

>>   *  Operations on a buffer.

>>   *  @{

>> @@ -163,6 +167,10 @@ uint64_t odp_buffer_to_u64(odp_buffer_t hdl);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/byteorder.h

>> b/include/odp/api/spec/byteorder.h

>> index a12a729..17f7ebe 100644

>> --- a/include/odp/api/spec/byteorder.h

>> +++ b/include/odp/api/spec/byteorder.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_compiler_optim ODP COMPILER / OPTIMIZATION

>>   *  Macros that check byte order and operations for byte order

>> conversion.

>>   *  @{

>> @@ -173,6 +177,10 @@ odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/classification.h

>> b/include/odp/api/spec/classification.h

>> index 076b3de..f200869 100644

>> --- a/include/odp/api/spec/classification.h

>> +++ b/include/odp/api/spec/classification.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>  #endif

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_classification ODP CLASSIFICATION

>>   *  Classification operations.

>>   *  @{

>> @@ -392,6 +396,10 @@ uint64_t odp_pmr_to_u64(odp_pmr_t hdl);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/compiler.h

>> b/include/odp/api/spec/compiler.h

>> index 5a24bfb..1b6d05f 100644

>> --- a/include/odp/api/spec/compiler.h

>> +++ b/include/odp/api/spec/compiler.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @addtogroup odp_compiler_optim

>>   *  Macro for old compilers

>>   *  @{

>> @@ -44,6 +48,10 @@ extern "C" {

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/config.h b/include/odp/api/spec/config.h

>> index c9879d6..14e54e1 100644

>> --- a/include/odp/api/spec/config.h

>> +++ b/include/odp/api/spec/config.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_config ODP CONFIG

>>   *  Platform-specific configuration limits.

>>   *

>> @@ -157,6 +161,10 @@ int odp_config_shm_blocks(void);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h

>> index f0e20c4..e87875e 100644

>> --- a/include/odp/api/spec/cpu.h

>> +++ b/include/odp/api/spec/cpu.h

>> @@ -20,6 +20,10 @@ extern "C" {

>>

>>  #include <odp/api/std_types.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_cpu ODP CPU

>>   *  @{

>>   */

>> @@ -172,6 +176,10 @@ void odp_cpu_pause(void);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/cpumask.h

>> b/include/odp/api/spec/cpumask.h

>> index 42098c2..3fc7694 100644

>> --- a/include/odp/api/spec/cpumask.h

>> +++ b/include/odp/api/spec/cpumask.h

>> @@ -20,6 +20,10 @@ extern "C" {

>>

>>  #include <odp/api/config.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_cpumask ODP CPUMASK

>>   *  CPU mask operations.

>>   *  @{

>> @@ -247,6 +251,10 @@ int odp_cpumask_all_available(odp_cpumask_t *mask);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h

>> index 7c6f9bc..7ac5ad1 100644

>> --- a/include/odp/api/spec/crypto.h

>> +++ b/include/odp/api/spec/crypto.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_crypto ODP CRYPTO

>>   *  Macros, enums, types and operations to utilise crypto.

>>   *  @{

>> @@ -367,6 +371,10 @@ uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t

>> hdl);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/debug.h b/include/odp/api/spec/debug.h

>> index 252a82f..c1ecd78 100644

>> --- a/include/odp/api/spec/debug.h

>> +++ b/include/odp/api/spec/debug.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  #if defined(__GNUC__) && !defined(__clang__)

>>

>>

>> @@ -43,6 +47,10 @@ extern "C" {

>>  #define _ODP_STATIC_ASSERT(cond, msg)  _Static_assert(cond, msg)

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/errno.h b/include/odp/api/spec/errno.h

>> index 33998b6..a337334 100644

>> --- a/include/odp/api/spec/errno.h

>> +++ b/include/odp/api/spec/errno.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @defgroup odp_errno ODP ERRNO

>>   * @details

>> @@ -78,6 +82,10 @@ const char *odp_errno_str(int errnum);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h

>> index 29547f3..3a7c149 100644

>> --- a/include/odp/api/spec/event.h

>> +++ b/include/odp/api/spec/event.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>  #endif

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_event ODP EVENT

>>   *  Operations on an event.

>>   *  @{

>> @@ -79,6 +83,10 @@ void odp_event_free(odp_event_t event);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/hash.h b/include/odp/api/spec/hash.h

>> index a6bc753..b00a6ad 100644

>> --- a/include/odp/api/spec/hash.h

>> +++ b/include/odp/api/spec/hash.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>

>>  #include <odp/api/std_types.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_hash ODP HASH FUNCTIONS

>>   *  ODP Hash functions

>>   *  @{

>> @@ -91,6 +95,10 @@ int odp_hash_crc_gen64(const void *data, uint32_t

>> data_len,

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/hints.h b/include/odp/api/spec/hints.h

>> index ea67fc4..325ef15 100644

>> --- a/include/odp/api/spec/hints.h

>> +++ b/include/odp/api/spec/hints.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @addtogroup odp_compiler_optim

>>   *  Macros that will give hints to the compiler.

>>   *  @{

>> @@ -109,6 +113,10 @@ extern "C" {

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h

>> index 8560663..ff9e343 100644

>> --- a/include/odp/api/spec/init.h

>> +++ b/include/odp/api/spec/init.h

>> @@ -33,6 +33,10 @@ extern "C" {

>>  #include <odp/api/thread.h>

>>  #include <odp/api/cpumask.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_initialization ODP INITIALIZATION

>>   *  Initialisation operations.

>>   *  @{

>> @@ -274,6 +278,10 @@ int odp_term_local(void);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h

>> index 7da353b..4305ea0 100644

>> --- a/include/odp/api/spec/packet.h

>> +++ b/include/odp/api/spec/packet.h

>> @@ -20,6 +20,10 @@ extern "C" {

>>

>>  #include <odp/api/time.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_packet ODP PACKET

>>   *  Operations on a packet.

>>   *  @{

>> @@ -1060,6 +1064,10 @@ uint64_t odp_packet_seg_to_u64(odp_packet_seg_t

>> hdl);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/packet_flags.h

>> b/include/odp/api/spec/packet_flags.h

>> index 35d44e1..cc63cda 100644

>> --- a/include/odp/api/spec/packet_flags.h

>> +++ b/include/odp/api/spec/packet_flags.h

>> @@ -21,6 +21,10 @@ extern "C" {

>>  #include <odp/api/std_types.h>

>>  #include <odp/api/packet.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @addtogroup odp_packet

>>   *  Boolean operations on a packet.

>>   *  @{

>> @@ -489,6 +493,10 @@ void odp_packet_has_ts_clr(odp_packet_t pkt);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/packet_io.h

>> b/include/odp/api/spec/packet_io.h

>> index 466cab6..ddf9e05 100644

>> --- a/include/odp/api/spec/packet_io.h

>> +++ b/include/odp/api/spec/packet_io.h

>> @@ -22,6 +22,10 @@ extern "C" {

>>  #include <odp/api/queue.h>

>>  #include <odp/api/time.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_packet_io ODP PACKET IO

>>   *  Operations on a packet Input/Output interface.

>>   *

>> @@ -1034,6 +1038,10 @@ odp_time_t odp_pktin_ts_from_ns(odp_pktio_t pktio,

>> uint64_t ns);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/packet_io_stats.h

>> b/include/odp/api/spec/packet_io_stats.h

>> index 148ad8d..3fe31d7 100644

>> --- a/include/odp/api/spec/packet_io_stats.h

>> +++ b/include/odp/api/spec/packet_io_stats.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @addtogroup odp_packet_io

>>   *  @{

>>   */

>> @@ -134,6 +138,10 @@ int odp_pktio_stats_reset(odp_pktio_t pktio);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h

>> index 94a302e..8f3c19e 100644

>> --- a/include/odp/api/spec/pool.h

>> +++ b/include/odp/api/spec/pool.h

>> @@ -22,6 +22,10 @@ extern "C" {

>>

>>  #include <odp/api/std_types.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_pool ODP POOL

>>   *  Operations on a pool.

>>   *  @{

>> @@ -206,6 +210,10 @@ void odp_pool_param_init(odp_pool_param_t *param);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h

>> index 51d94a2..2e767e7 100644

>> --- a/include/odp/api/spec/queue.h

>> +++ b/include/odp/api/spec/queue.h

>> @@ -21,6 +21,10 @@ extern "C" {

>>  #include <odp/api/schedule_types.h>

>>  #include <odp/api/event.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_queue ODP QUEUE

>>   *  Macros and operation on a queue.

>>   *  @{

>> @@ -370,6 +374,10 @@ int odp_queue_info(odp_queue_t queue,

>> odp_queue_info_t *info);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/random.h b/include/odp/api/spec/random.h

>> index 435783a..d1f9267 100644

>> --- a/include/odp/api/spec/random.h

>> +++ b/include/odp/api/spec/random.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_random ODP RANDOM

>>   *  @{

>>   */

>> @@ -41,6 +45,10 @@ int32_t odp_random_data(uint8_t *buf, int32_t size,

>> odp_bool_t use_entropy);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/rwlock.h b/include/odp/api/spec/rwlock.h

>> index 9ca8872..7d23430 100644

>> --- a/include/odp/api/spec/rwlock.h

>> +++ b/include/odp/api/spec/rwlock.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @defgroup odp_locks ODP LOCKS

>>   * @details

>> @@ -95,6 +99,10 @@ void odp_rwlock_write_unlock(odp_rwlock_t *rwlock);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/rwlock_recursive.h

>> b/include/odp/api/spec/rwlock_recursive.h

>> index 965fcc0..1631491 100644

>> --- a/include/odp/api/spec/rwlock_recursive.h

>> +++ b/include/odp/api/spec/rwlock_recursive.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @addtogroup odp_locks

>>   * @details

>> @@ -113,6 +117,10 @@ void

>> odp_rwlock_recursive_write_unlock(odp_rwlock_recursive_t *lock);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/schedule.h

>> b/include/odp/api/spec/schedule.h

>> index cd1325a..cff56ac 100644

>> --- a/include/odp/api/spec/schedule.h

>> +++ b/include/odp/api/spec/schedule.h

>> @@ -25,6 +25,10 @@ extern "C" {

>>  #include <odp/api/schedule_types.h>

>>  #include <odp/api/thrmask.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_scheduler ODP SCHEDULER

>>   *  Operations on the scheduler.

>>   *  @{

>> @@ -371,6 +375,10 @@ void odp_schedule_order_unlock(unsigned lock_index);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/schedule_types.h

>> b/include/odp/api/spec/schedule_types.h

>> index 34046af..11fc001 100644

>> --- a/include/odp/api/spec/schedule_types.h

>> +++ b/include/odp/api/spec/schedule_types.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @addtogroup odp_scheduler

>>   *  @{

>>   */

>> @@ -152,6 +156,10 @@ typedef    struct odp_schedule_param_t {

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/shared_memory.h

>> b/include/odp/api/spec/shared_memory.h

>> index 5d851ce..8969462 100644

>> --- a/include/odp/api/spec/shared_memory.h

>> +++ b/include/odp/api/spec/shared_memory.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>  #endif

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_shared_memory ODP SHARED MEMORY

>>   *  Operations on shared memory.

>>   *  @{

>> @@ -148,6 +152,10 @@ uint64_t odp_shm_to_u64(odp_shm_t hdl);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/spinlock.h

>> b/include/odp/api/spec/spinlock.h

>> index a73359d..02e9d1a 100644

>> --- a/include/odp/api/spec/spinlock.h

>> +++ b/include/odp/api/spec/spinlock.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @addtogroup odp_locks

>>   * @details

>> @@ -84,6 +88,10 @@ int odp_spinlock_is_locked(odp_spinlock_t *splock);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/spinlock_recursive.h

>> b/include/odp/api/spec/spinlock_recursive.h

>> index d98f2bb..457998a 100644

>> --- a/include/odp/api/spec/spinlock_recursive.h

>> +++ b/include/odp/api/spec/spinlock_recursive.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @addtogroup odp_locks

>>   * @details

>> @@ -78,6 +82,10 @@ int

>> odp_spinlock_recursive_is_locked(odp_spinlock_recursive_t *lock);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/std_clib.h

>> b/include/odp/api/spec/std_clib.h

>> index 791b72f..de5976c 100644

>> --- a/include/odp/api/spec/std_clib.h

>> +++ b/include/odp/api/spec/std_clib.h

>> @@ -17,6 +17,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @defgroup odp_std_clib ODP STD CLIB

>>   * @details

>> @@ -75,6 +79,10 @@ int odp_memcmp(const void *ptr1, const void *ptr2,

>> size_t num);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/std_types.h

>> b/include/odp/api/spec/std_types.h

>> index 7558c64..f138e94 100644

>> --- a/include/odp/api/spec/std_types.h

>> +++ b/include/odp/api/spec/std_types.h

>> @@ -20,6 +20,10 @@ extern "C" {

>>  #endif

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @addtogroup odp_system ODP SYSTEM

>>   *  @{

>>   */

>> @@ -35,6 +39,10 @@ extern "C" {

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/sync.h b/include/odp/api/spec/sync.h

>> index c6f790c..1faa49b 100644

>> --- a/include/odp/api/spec/sync.h

>> +++ b/include/odp/api/spec/sync.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @addtogroup odp_barrier

>>   * @details

>> @@ -83,6 +87,10 @@ void odp_mb_full(void);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/system_info.h

>> b/include/odp/api/spec/system_info.h

>> index bde3a60..0191b88 100644

>> --- a/include/odp/api/spec/system_info.h

>> +++ b/include/odp/api/spec/system_info.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>  #endif

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_system ODP SYSTEM

>>   *  @{

>>   */

>> @@ -48,6 +52,10 @@ int odp_sys_cache_line_size(void);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h

>> index 3720249..94101c8 100644

>> --- a/include/odp/api/spec/thread.h

>> +++ b/include/odp/api/spec/thread.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_thread ODP THREAD

>>   *  @{

>>   */

>> @@ -105,6 +109,10 @@ odp_thread_type_t odp_thread_type(void);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/thrmask.h

>> b/include/odp/api/spec/thrmask.h

>> index a22da8c..4eb8e29 100644

>> --- a/include/odp/api/spec/thrmask.h

>> +++ b/include/odp/api/spec/thrmask.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>

>>  #include <odp/api/std_types.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @addtogroup odp_thread

>>   *  Thread mask operations.

>>   *  @{

>> @@ -232,6 +236,10 @@ int odp_thrmask_control(odp_thrmask_t *mask);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/ticketlock.h

>> b/include/odp/api/spec/ticketlock.h

>> index 3f0e3f5..071a5f0 100644

>> --- a/include/odp/api/spec/ticketlock.h

>> +++ b/include/odp/api/spec/ticketlock.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @addtogroup odp_locks

>>   * @details

>> @@ -83,6 +87,10 @@ int odp_ticketlock_is_locked(odp_ticketlock_t *tklock);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h

>> index 85692ec..62873bc 100644

>> --- a/include/odp/api/spec/time.h

>> +++ b/include/odp/api/spec/time.h

>> @@ -19,6 +19,10 @@ extern "C" {

>>  #endif

>>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_time ODP TIME

>>   *  @{

>>   */

>> @@ -174,6 +178,10 @@ uint64_t odp_time_to_u64(odp_time_t time);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h

>> index 435c004..e83a76c 100644

>> --- a/include/odp/api/spec/timer.h

>> +++ b/include/odp/api/spec/timer.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /** @defgroup odp_timer ODP TIMER

>>   *  @{

>>   */

>> @@ -408,6 +412,10 @@ uint64_t odp_timeout_to_u64(odp_timeout_t hdl);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/traffic_mngr.h

>> b/include/odp/api/spec/traffic_mngr.h

>> index ce124a8..d7a6248 100644

>> --- a/include/odp/api/spec/traffic_mngr.h

>> +++ b/include/odp/api/spec/traffic_mngr.h

>> @@ -14,6 +14,10 @@ extern "C" {

>>  #include <odp/api/std_types.h>

>>  #include <odp/api/packet_io.h>

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @file

>>   *

>> @@ -1367,6 +1371,10 @@ void odp_tm_stats_print(odp_tm_t odp_tm);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/include/odp/api/spec/version.h

>> b/include/odp/api/spec/version.h

>> index 642831c..22cb371 100644

>> --- a/include/odp/api/spec/version.h

>> +++ b/include/odp/api/spec/version.h

>> @@ -18,6 +18,10 @@

>>  extern "C" {

>>  #endif

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility push(default)

>> +#endif

>> +

>>  /**

>>   * @defgroup odp_version ODP VERSION

>>   * @details

>> @@ -98,6 +102,10 @@ const char *odp_version_impl_str(void);

>>   * @}

>>   */

>>

>> +#if __GNUC__ >= 4

>> +#pragma GCC visibility pop

>> +#endif

>> +

>>  #ifdef __cplusplus

>>  }

>>  #endif

>> diff --git a/platform/Makefile.inc b/platform/Makefile.inc

>> index 1cb7a71..5aa3fed 100644

>> --- a/platform/Makefile.inc

>> +++ b/platform/Makefile.inc

>> @@ -15,6 +15,7 @@ AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'

>>  GIT_DESC = `$(top_srcdir)/scripts/get_impl_str.sh $(top_srcdir)`

>>  AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"

>>  AM_CFLAGS += -DPLATFORM=${with_platform}

>> +AM_CFLAGS += $(VISIBILITY_CFLAGS)

>>

>>  #The implementation will need to retain the deprecated implementation

>>  AM_CFLAGS += -Wno-deprecated-declarations

>> diff --git a/platform/linux-generic/m4/configure.m4

>> b/platform/linux-generic/m4/configure.m4

>> index f80c66c..75a3797 100644

>> --- a/platform/linux-generic/m4/configure.m4

>> +++ b/platform/linux-generic/m4/configure.m4

>> @@ -1,3 +1,15 @@

>> +# Enable -fvisibility=hidden if using a gcc that supports it

>> +OLD_CFLAGS="$CFLAGS"

>> +AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])

>> +VISIBILITY_CFLAGS="-fvisibility=hidden"

>> +CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"

>> +AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),

>> +       [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);

>> +

>> +AC_SUBST(VISIBILITY_CFLAGS)

>> +# Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.

>> +CFLAGS=$OLD_CFLAGS

>> +

>>  AC_MSG_CHECKING(for GCC atomic builtins)

>>  AC_LINK_IFELSE(

>>      [AC_LANG_SOURCE(

>> --

>> 2.1.4

>>

>> _______________________________________________

>> lng-odp mailing list

>> lng-odp@lists.linaro.org

>> https://lists.linaro.org/mailman/listinfo/lng-odp

>>

>

>
Ricardo Salveti April 13, 2016, 6:47 p.m. UTC | #3
On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer
<bill.fischofer@linaro.org> wrote:
>
> On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell <anders.roxell@linaro.org>
> wrote:
>>
>> Internal functions should not be part of symbols that are visible
>> outside the library. Using -fvisibility=hidden hides all internal
>> functions from the public ABI.
>>
>> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>
>> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>> ---
>>  include/odp/api/spec/align.h              |  8 ++++++++
>>  include/odp/api/spec/atomic.h             |  8 ++++++++
>>  include/odp/api/spec/barrier.h            |  8 ++++++++
>>  include/odp/api/spec/buffer.h             |  8 ++++++++
>>  include/odp/api/spec/byteorder.h          |  8 ++++++++
>>  include/odp/api/spec/classification.h     |  8 ++++++++
>>  include/odp/api/spec/compiler.h           |  8 ++++++++
>>  include/odp/api/spec/config.h             |  8 ++++++++
>>  include/odp/api/spec/cpu.h                |  8 ++++++++
>>  include/odp/api/spec/cpumask.h            |  8 ++++++++
>>  include/odp/api/spec/crypto.h             |  8 ++++++++
>>  include/odp/api/spec/debug.h              |  8 ++++++++
>>  include/odp/api/spec/errno.h              |  8 ++++++++
>>  include/odp/api/spec/event.h              |  8 ++++++++
>>  include/odp/api/spec/hash.h               |  8 ++++++++
>>  include/odp/api/spec/hints.h              |  8 ++++++++
>>  include/odp/api/spec/init.h               |  8 ++++++++
>>  include/odp/api/spec/packet.h             |  8 ++++++++
>>  include/odp/api/spec/packet_flags.h       |  8 ++++++++
>>  include/odp/api/spec/packet_io.h          |  8 ++++++++
>>  include/odp/api/spec/packet_io_stats.h    |  8 ++++++++
>>  include/odp/api/spec/pool.h               |  8 ++++++++
>>  include/odp/api/spec/queue.h              |  8 ++++++++
>>  include/odp/api/spec/random.h             |  8 ++++++++
>>  include/odp/api/spec/rwlock.h             |  8 ++++++++
>>  include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++
>>  include/odp/api/spec/schedule.h           |  8 ++++++++
>>  include/odp/api/spec/schedule_types.h     |  8 ++++++++
>>  include/odp/api/spec/shared_memory.h      |  8 ++++++++
>>  include/odp/api/spec/spinlock.h           |  8 ++++++++
>>  include/odp/api/spec/spinlock_recursive.h |  8 ++++++++
>>  include/odp/api/spec/std_clib.h           |  8 ++++++++
>>  include/odp/api/spec/std_types.h          |  8 ++++++++
>>  include/odp/api/spec/sync.h               |  8 ++++++++
>>  include/odp/api/spec/system_info.h        |  8 ++++++++
>>  include/odp/api/spec/thread.h             |  8 ++++++++
>>  include/odp/api/spec/thrmask.h            |  8 ++++++++
>>  include/odp/api/spec/ticketlock.h         |  8 ++++++++
>>  include/odp/api/spec/time.h               |  8 ++++++++
>>  include/odp/api/spec/timer.h              |  8 ++++++++
>>  include/odp/api/spec/traffic_mngr.h       |  8 ++++++++
>>  include/odp/api/spec/version.h            |  8 ++++++++
>>  platform/Makefile.inc                     |  1 +
>>  platform/linux-generic/m4/configure.m4    | 12 ++++++++++++
>>  44 files changed, 349 insertions(+)
>>
>> diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h
>> index 677ff12..027b080 100644
>> --- a/include/odp/api/spec/align.h
>> +++ b/include/odp/api/spec/align.h
>> @@ -18,6 +18,10 @@
>>  extern "C" {
>>  #endif
>>
>> +#if __GNUC__ >= 4
>> +#pragma GCC visibility push(default)
>> +#endif
>
>
> Do these need to be guarded?  Do we care about GCC < 4 at this point? How
> does this affect clang?

It's usually good to protect that with the supported GCC version, but
then the question is if the ODP project itself would be fine to drop
support for GCC < 4.

And for clang, it doesn't affect since it also works fine with it.

Cheers,
Bill Fischofer April 13, 2016, 6:51 p.m. UTC | #4
On Wed, Apr 13, 2016 at 1:47 PM, Ricardo Salveti <ricardo.salveti@linaro.org
> wrote:


> On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer

> <bill.fischofer@linaro.org> wrote:

> >

> > On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell <

> anders.roxell@linaro.org>

> > wrote:

> >>

> >> Internal functions should not be part of symbols that are visible

> >> outside the library. Using -fvisibility=hidden hides all internal

> >> functions from the public ABI.

> >>

> >> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>

> >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> >> ---

> >>  include/odp/api/spec/align.h              |  8 ++++++++

> >>  include/odp/api/spec/atomic.h             |  8 ++++++++

> >>  include/odp/api/spec/barrier.h            |  8 ++++++++

> >>  include/odp/api/spec/buffer.h             |  8 ++++++++

> >>  include/odp/api/spec/byteorder.h          |  8 ++++++++

> >>  include/odp/api/spec/classification.h     |  8 ++++++++

> >>  include/odp/api/spec/compiler.h           |  8 ++++++++

> >>  include/odp/api/spec/config.h             |  8 ++++++++

> >>  include/odp/api/spec/cpu.h                |  8 ++++++++

> >>  include/odp/api/spec/cpumask.h            |  8 ++++++++

> >>  include/odp/api/spec/crypto.h             |  8 ++++++++

> >>  include/odp/api/spec/debug.h              |  8 ++++++++

> >>  include/odp/api/spec/errno.h              |  8 ++++++++

> >>  include/odp/api/spec/event.h              |  8 ++++++++

> >>  include/odp/api/spec/hash.h               |  8 ++++++++

> >>  include/odp/api/spec/hints.h              |  8 ++++++++

> >>  include/odp/api/spec/init.h               |  8 ++++++++

> >>  include/odp/api/spec/packet.h             |  8 ++++++++

> >>  include/odp/api/spec/packet_flags.h       |  8 ++++++++

> >>  include/odp/api/spec/packet_io.h          |  8 ++++++++

> >>  include/odp/api/spec/packet_io_stats.h    |  8 ++++++++

> >>  include/odp/api/spec/pool.h               |  8 ++++++++

> >>  include/odp/api/spec/queue.h              |  8 ++++++++

> >>  include/odp/api/spec/random.h             |  8 ++++++++

> >>  include/odp/api/spec/rwlock.h             |  8 ++++++++

> >>  include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++

> >>  include/odp/api/spec/schedule.h           |  8 ++++++++

> >>  include/odp/api/spec/schedule_types.h     |  8 ++++++++

> >>  include/odp/api/spec/shared_memory.h      |  8 ++++++++

> >>  include/odp/api/spec/spinlock.h           |  8 ++++++++

> >>  include/odp/api/spec/spinlock_recursive.h |  8 ++++++++

> >>  include/odp/api/spec/std_clib.h           |  8 ++++++++

> >>  include/odp/api/spec/std_types.h          |  8 ++++++++

> >>  include/odp/api/spec/sync.h               |  8 ++++++++

> >>  include/odp/api/spec/system_info.h        |  8 ++++++++

> >>  include/odp/api/spec/thread.h             |  8 ++++++++

> >>  include/odp/api/spec/thrmask.h            |  8 ++++++++

> >>  include/odp/api/spec/ticketlock.h         |  8 ++++++++

> >>  include/odp/api/spec/time.h               |  8 ++++++++

> >>  include/odp/api/spec/timer.h              |  8 ++++++++

> >>  include/odp/api/spec/traffic_mngr.h       |  8 ++++++++

> >>  include/odp/api/spec/version.h            |  8 ++++++++

> >>  platform/Makefile.inc                     |  1 +

> >>  platform/linux-generic/m4/configure.m4    | 12 ++++++++++++

> >>  44 files changed, 349 insertions(+)

> >>

> >> diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h

> >> index 677ff12..027b080 100644

> >> --- a/include/odp/api/spec/align.h

> >> +++ b/include/odp/api/spec/align.h

> >> @@ -18,6 +18,10 @@

> >>  extern "C" {

> >>  #endif

> >>

> >> +#if __GNUC__ >= 4

> >> +#pragma GCC visibility push(default)

> >> +#endif

> >

> >

> > Do these need to be guarded?  Do we care about GCC < 4 at this point? How

> > does this affect clang?

>

> It's usually good to protect that with the supported GCC version, but

> then the question is if the ODP project itself would be fine to drop

> support for GCC < 4.

>

> And for clang, it doesn't affect since it also works fine with it.

>


So clang exports symbol __GNUC__ with a value of at least 4?


>

> Cheers,

> --

> Ricardo Salveti

>
Ricardo Salveti April 13, 2016, 7:04 p.m. UTC | #5
On Wed, Apr 13, 2016 at 3:51 PM, Bill Fischofer
<bill.fischofer@linaro.org> wrote:
> On Wed, Apr 13, 2016 at 1:47 PM, Ricardo Salveti
> <ricardo.salveti@linaro.org> wrote:
>>
>> On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer
>> <bill.fischofer@linaro.org> wrote:
>> >
>> > On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell
>> > <anders.roxell@linaro.org>
>> > wrote:
>> >>
>> >> Internal functions should not be part of symbols that are visible
>> >> outside the library. Using -fvisibility=hidden hides all internal
>> >> functions from the public ABI.
>> >>
>> >> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>
>> >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>> >> ---
>> >>  include/odp/api/spec/align.h              |  8 ++++++++
>> >>  include/odp/api/spec/atomic.h             |  8 ++++++++
>> >>  include/odp/api/spec/barrier.h            |  8 ++++++++
>> >>  include/odp/api/spec/buffer.h             |  8 ++++++++
>> >>  include/odp/api/spec/byteorder.h          |  8 ++++++++
>> >>  include/odp/api/spec/classification.h     |  8 ++++++++
>> >>  include/odp/api/spec/compiler.h           |  8 ++++++++
>> >>  include/odp/api/spec/config.h             |  8 ++++++++
>> >>  include/odp/api/spec/cpu.h                |  8 ++++++++
>> >>  include/odp/api/spec/cpumask.h            |  8 ++++++++
>> >>  include/odp/api/spec/crypto.h             |  8 ++++++++
>> >>  include/odp/api/spec/debug.h              |  8 ++++++++
>> >>  include/odp/api/spec/errno.h              |  8 ++++++++
>> >>  include/odp/api/spec/event.h              |  8 ++++++++
>> >>  include/odp/api/spec/hash.h               |  8 ++++++++
>> >>  include/odp/api/spec/hints.h              |  8 ++++++++
>> >>  include/odp/api/spec/init.h               |  8 ++++++++
>> >>  include/odp/api/spec/packet.h             |  8 ++++++++
>> >>  include/odp/api/spec/packet_flags.h       |  8 ++++++++
>> >>  include/odp/api/spec/packet_io.h          |  8 ++++++++
>> >>  include/odp/api/spec/packet_io_stats.h    |  8 ++++++++
>> >>  include/odp/api/spec/pool.h               |  8 ++++++++
>> >>  include/odp/api/spec/queue.h              |  8 ++++++++
>> >>  include/odp/api/spec/random.h             |  8 ++++++++
>> >>  include/odp/api/spec/rwlock.h             |  8 ++++++++
>> >>  include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++
>> >>  include/odp/api/spec/schedule.h           |  8 ++++++++
>> >>  include/odp/api/spec/schedule_types.h     |  8 ++++++++
>> >>  include/odp/api/spec/shared_memory.h      |  8 ++++++++
>> >>  include/odp/api/spec/spinlock.h           |  8 ++++++++
>> >>  include/odp/api/spec/spinlock_recursive.h |  8 ++++++++
>> >>  include/odp/api/spec/std_clib.h           |  8 ++++++++
>> >>  include/odp/api/spec/std_types.h          |  8 ++++++++
>> >>  include/odp/api/spec/sync.h               |  8 ++++++++
>> >>  include/odp/api/spec/system_info.h        |  8 ++++++++
>> >>  include/odp/api/spec/thread.h             |  8 ++++++++
>> >>  include/odp/api/spec/thrmask.h            |  8 ++++++++
>> >>  include/odp/api/spec/ticketlock.h         |  8 ++++++++
>> >>  include/odp/api/spec/time.h               |  8 ++++++++
>> >>  include/odp/api/spec/timer.h              |  8 ++++++++
>> >>  include/odp/api/spec/traffic_mngr.h       |  8 ++++++++
>> >>  include/odp/api/spec/version.h            |  8 ++++++++
>> >>  platform/Makefile.inc                     |  1 +
>> >>  platform/linux-generic/m4/configure.m4    | 12 ++++++++++++
>> >>  44 files changed, 349 insertions(+)
>> >>
>> >> diff --git a/include/odp/api/spec/align.h
>> >> b/include/odp/api/spec/align.h
>> >> index 677ff12..027b080 100644
>> >> --- a/include/odp/api/spec/align.h
>> >> +++ b/include/odp/api/spec/align.h
>> >> @@ -18,6 +18,10 @@
>> >>  extern "C" {
>> >>  #endif
>> >>
>> >> +#if __GNUC__ >= 4
>> >> +#pragma GCC visibility push(default)
>> >> +#endif
>> >
>> >
>> > Do these need to be guarded?  Do we care about GCC < 4 at this point?
>> > How
>> > does this affect clang?
>>
>> It's usually good to protect that with the supported GCC version, but
>> then the question is if the ODP project itself would be fine to drop
>> support for GCC < 4.
>>
>> And for clang, it doesn't affect since it also works fine with it.
>
>
> So clang exports symbol __GNUC__ with a value of at least 4?

Yes, https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/InitPreprocessor.cpp#L494

Added quite a while ago.

Cheers,
Bill Fischofer April 13, 2016, 7:06 p.m. UTC | #6
Ok, thanks.  With that:

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


On Wed, Apr 13, 2016 at 2:04 PM, Ricardo Salveti <ricardo.salveti@linaro.org
> wrote:


> On Wed, Apr 13, 2016 at 3:51 PM, Bill Fischofer

> <bill.fischofer@linaro.org> wrote:

> > On Wed, Apr 13, 2016 at 1:47 PM, Ricardo Salveti

> > <ricardo.salveti@linaro.org> wrote:

> >>

> >> On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer

> >> <bill.fischofer@linaro.org> wrote:

> >> >

> >> > On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell

> >> > <anders.roxell@linaro.org>

> >> > wrote:

> >> >>

> >> >> Internal functions should not be part of symbols that are visible

> >> >> outside the library. Using -fvisibility=hidden hides all internal

> >> >> functions from the public ABI.

> >> >>

> >> >> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>

> >> >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> >> >> ---

> >> >>  include/odp/api/spec/align.h              |  8 ++++++++

> >> >>  include/odp/api/spec/atomic.h             |  8 ++++++++

> >> >>  include/odp/api/spec/barrier.h            |  8 ++++++++

> >> >>  include/odp/api/spec/buffer.h             |  8 ++++++++

> >> >>  include/odp/api/spec/byteorder.h          |  8 ++++++++

> >> >>  include/odp/api/spec/classification.h     |  8 ++++++++

> >> >>  include/odp/api/spec/compiler.h           |  8 ++++++++

> >> >>  include/odp/api/spec/config.h             |  8 ++++++++

> >> >>  include/odp/api/spec/cpu.h                |  8 ++++++++

> >> >>  include/odp/api/spec/cpumask.h            |  8 ++++++++

> >> >>  include/odp/api/spec/crypto.h             |  8 ++++++++

> >> >>  include/odp/api/spec/debug.h              |  8 ++++++++

> >> >>  include/odp/api/spec/errno.h              |  8 ++++++++

> >> >>  include/odp/api/spec/event.h              |  8 ++++++++

> >> >>  include/odp/api/spec/hash.h               |  8 ++++++++

> >> >>  include/odp/api/spec/hints.h              |  8 ++++++++

> >> >>  include/odp/api/spec/init.h               |  8 ++++++++

> >> >>  include/odp/api/spec/packet.h             |  8 ++++++++

> >> >>  include/odp/api/spec/packet_flags.h       |  8 ++++++++

> >> >>  include/odp/api/spec/packet_io.h          |  8 ++++++++

> >> >>  include/odp/api/spec/packet_io_stats.h    |  8 ++++++++

> >> >>  include/odp/api/spec/pool.h               |  8 ++++++++

> >> >>  include/odp/api/spec/queue.h              |  8 ++++++++

> >> >>  include/odp/api/spec/random.h             |  8 ++++++++

> >> >>  include/odp/api/spec/rwlock.h             |  8 ++++++++

> >> >>  include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++

> >> >>  include/odp/api/spec/schedule.h           |  8 ++++++++

> >> >>  include/odp/api/spec/schedule_types.h     |  8 ++++++++

> >> >>  include/odp/api/spec/shared_memory.h      |  8 ++++++++

> >> >>  include/odp/api/spec/spinlock.h           |  8 ++++++++

> >> >>  include/odp/api/spec/spinlock_recursive.h |  8 ++++++++

> >> >>  include/odp/api/spec/std_clib.h           |  8 ++++++++

> >> >>  include/odp/api/spec/std_types.h          |  8 ++++++++

> >> >>  include/odp/api/spec/sync.h               |  8 ++++++++

> >> >>  include/odp/api/spec/system_info.h        |  8 ++++++++

> >> >>  include/odp/api/spec/thread.h             |  8 ++++++++

> >> >>  include/odp/api/spec/thrmask.h            |  8 ++++++++

> >> >>  include/odp/api/spec/ticketlock.h         |  8 ++++++++

> >> >>  include/odp/api/spec/time.h               |  8 ++++++++

> >> >>  include/odp/api/spec/timer.h              |  8 ++++++++

> >> >>  include/odp/api/spec/traffic_mngr.h       |  8 ++++++++

> >> >>  include/odp/api/spec/version.h            |  8 ++++++++

> >> >>  platform/Makefile.inc                     |  1 +

> >> >>  platform/linux-generic/m4/configure.m4    | 12 ++++++++++++

> >> >>  44 files changed, 349 insertions(+)

> >> >>

> >> >> diff --git a/include/odp/api/spec/align.h

> >> >> b/include/odp/api/spec/align.h

> >> >> index 677ff12..027b080 100644

> >> >> --- a/include/odp/api/spec/align.h

> >> >> +++ b/include/odp/api/spec/align.h

> >> >> @@ -18,6 +18,10 @@

> >> >>  extern "C" {

> >> >>  #endif

> >> >>

> >> >> +#if __GNUC__ >= 4

> >> >> +#pragma GCC visibility push(default)

> >> >> +#endif

> >> >

> >> >

> >> > Do these need to be guarded?  Do we care about GCC < 4 at this point?

> >> > How

> >> > does this affect clang?

> >>

> >> It's usually good to protect that with the supported GCC version, but

> >> then the question is if the ODP project itself would be fine to drop

> >> support for GCC < 4.

> >>

> >> And for clang, it doesn't affect since it also works fine with it.

> >

> >

> > So clang exports symbol __GNUC__ with a value of at least 4?

>

> Yes,

> https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/InitPreprocessor.cpp#L494

>

> Added quite a while ago.

>

> Cheers,

> --

> Ricardo Salveti

>
Maxim Uvarov April 15, 2016, 10:38 a.m. UTC | #7
Petri, please review this patch. For me it's not clear why it touches 
include/odp/api/spec files at all.

Maxim.

On 04/13/16 22:06, Bill Fischofer wrote:
> Ok, thanks.  With that:
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
> On Wed, Apr 13, 2016 at 2:04 PM, Ricardo Salveti 
> <ricardo.salveti@linaro.org <mailto:ricardo.salveti@linaro.org>> wrote:
>
>     On Wed, Apr 13, 2016 at 3:51 PM, Bill Fischofer
>     <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>     > On Wed, Apr 13, 2016 at 1:47 PM, Ricardo Salveti
>     > <ricardo.salveti@linaro.org <mailto:ricardo.salveti@linaro.org>>
>     wrote:
>     >>
>     >> On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer
>     >> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>>
>     wrote:
>     >> >
>     >> > On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell
>     >> > <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>
>     >> > wrote:
>     >> >>
>     >> >> Internal functions should not be part of symbols that are
>     visible
>     >> >> outside the library. Using -fvisibility=hidden hides all
>     internal
>     >> >> functions from the public ABI.
>     >> >>
>     >> >> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org
>     <mailto:ricardo.salveti@linaro.org>>
>     >> >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org
>     <mailto:anders.roxell@linaro.org>>
>     >> >> ---
>     >> >>  include/odp/api/spec/align.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/atomic.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/barrier.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/buffer.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/byteorder.h     |  8 ++++++++
>     >> >> include/odp/api/spec/classification.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/compiler.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/config.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/cpu.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/cpumask.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/crypto.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/debug.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/errno.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/event.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/hash.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/hints.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/init.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/packet.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/packet_flags.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/packet_io.h     |  8 ++++++++
>     >> >> include/odp/api/spec/packet_io_stats.h    |  8 ++++++++
>     >> >>  include/odp/api/spec/pool.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/queue.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/random.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/rwlock.h      |  8 ++++++++
>     >> >> include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++
>     >> >>  include/odp/api/spec/schedule.h      |  8 ++++++++
>     >> >> include/odp/api/spec/schedule_types.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/shared_memory.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/spinlock.h      |  8 ++++++++
>     >> >> include/odp/api/spec/spinlock_recursive.h |  8 ++++++++
>     >> >>  include/odp/api/spec/std_clib.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/std_types.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/sync.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/system_info.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/thread.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/thrmask.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/ticketlock.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/time.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/timer.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/traffic_mngr.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/version.h     |  8 ++++++++
>     >> >>  platform/Makefile.inc      |  1 +
>     >> >> platform/linux-generic/m4/configure.m4    | 12 ++++++++++++
>     >> >>  44 files changed, 349 insertions(+)
>     >> >>
>     >> >> diff --git a/include/odp/api/spec/align.h
>     >> >> b/include/odp/api/spec/align.h
>     >> >> index 677ff12..027b080 100644
>     >> >> --- a/include/odp/api/spec/align.h
>     >> >> +++ b/include/odp/api/spec/align.h
>     >> >> @@ -18,6 +18,10 @@
>     >> >>  extern "C" {
>     >> >>  #endif
>     >> >>
>     >> >> +#if __GNUC__ >= 4
>     >> >> +#pragma GCC visibility push(default)
>     >> >> +#endif
>     >> >
>     >> >
>     >> > Do these need to be guarded?  Do we care about GCC < 4 at
>     this point?
>     >> > How
>     >> > does this affect clang?
>     >>
>     >> It's usually good to protect that with the supported GCC
>     version, but
>     >> then the question is if the ODP project itself would be fine to
>     drop
>     >> support for GCC < 4.
>     >>
>     >> And for clang, it doesn't affect since it also works fine with it.
>     >
>     >
>     > So clang exports symbol __GNUC__ with a value of at least 4?
>
>     Yes,
>     https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/InitPreprocessor.cpp#L494
>
>     Added quite a while ago.
>
>     Cheers,
>     --
>     Ricardo Salveti
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes April 15, 2016, 10:43 a.m. UTC | #8
Maxim it needs to be in the spec, it is the spec that defines the ABI, if
you dont do this then everyone implementing will have to manually mark
hundreds of other apis as internal rather than we just export the correct
list.

At least that is my understanding at least.



On 15 April 2016 at 06:38, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> Petri, please review this patch. For me it's not clear why it touches

> include/odp/api/spec files at all.

>

> Maxim.

>

> On 04/13/16 22:06, Bill Fischofer wrote:

>

>> Ok, thanks.  With that:

>>

>> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org <mailto:

>> bill.fischofer@linaro.org>>

>>

>> On Wed, Apr 13, 2016 at 2:04 PM, Ricardo Salveti <

>> ricardo.salveti@linaro.org <mailto:ricardo.salveti@linaro.org>> wrote:

>>

>>     On Wed, Apr 13, 2016 at 3:51 PM, Bill Fischofer

>>     <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:

>>     > On Wed, Apr 13, 2016 at 1:47 PM, Ricardo Salveti

>>     > <ricardo.salveti@linaro.org <mailto:ricardo.salveti@linaro.org>>

>>     wrote:

>>     >>

>>     >> On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer

>>     >> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>>

>>     wrote:

>>     >> >

>>     >> > On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell

>>     >> > <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>

>>     >> > wrote:

>>     >> >>

>>     >> >> Internal functions should not be part of symbols that are

>>     visible

>>     >> >> outside the library. Using -fvisibility=hidden hides all

>>     internal

>>     >> >> functions from the public ABI.

>>     >> >>

>>     >> >> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org

>>     <mailto:ricardo.salveti@linaro.org>>

>>     >> >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org

>>     <mailto:anders.roxell@linaro.org>>

>>

>>     >> >> ---

>>     >> >>  include/odp/api/spec/align.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/atomic.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/barrier.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/buffer.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/byteorder.h     |  8 ++++++++

>>     >> >> include/odp/api/spec/classification.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/compiler.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/config.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/cpu.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/cpumask.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/crypto.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/debug.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/errno.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/event.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/hash.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/hints.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/init.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/packet.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/packet_flags.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/packet_io.h     |  8 ++++++++

>>     >> >> include/odp/api/spec/packet_io_stats.h    |  8 ++++++++

>>     >> >>  include/odp/api/spec/pool.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/queue.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/random.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/rwlock.h      |  8 ++++++++

>>     >> >> include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++

>>     >> >>  include/odp/api/spec/schedule.h      |  8 ++++++++

>>     >> >> include/odp/api/spec/schedule_types.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/shared_memory.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/spinlock.h      |  8 ++++++++

>>     >> >> include/odp/api/spec/spinlock_recursive.h |  8 ++++++++

>>     >> >>  include/odp/api/spec/std_clib.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/std_types.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/sync.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/system_info.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/thread.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/thrmask.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/ticketlock.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/time.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/timer.h     |  8 ++++++++

>>     >> >>  include/odp/api/spec/traffic_mngr.h      |  8 ++++++++

>>     >> >>  include/odp/api/spec/version.h     |  8 ++++++++

>>     >> >>  platform/Makefile.inc      |  1 +

>>     >> >> platform/linux-generic/m4/configure.m4    | 12 ++++++++++++

>>     >> >>  44 files changed, 349 insertions(+)

>>     >> >>

>>     >> >> diff --git a/include/odp/api/spec/align.h

>>     >> >> b/include/odp/api/spec/align.h

>>     >> >> index 677ff12..027b080 100644

>>     >> >> --- a/include/odp/api/spec/align.h

>>     >> >> +++ b/include/odp/api/spec/align.h

>>     >> >> @@ -18,6 +18,10 @@

>>     >> >>  extern "C" {

>>     >> >>  #endif

>>     >> >>

>>     >> >> +#if __GNUC__ >= 4

>>     >> >> +#pragma GCC visibility push(default)

>>     >> >> +#endif

>>     >> >

>>     >> >

>>     >> > Do these need to be guarded?  Do we care about GCC < 4 at

>>     this point?

>>     >> > How

>>     >> > does this affect clang?

>>     >>

>>     >> It's usually good to protect that with the supported GCC

>>     version, but

>>     >> then the question is if the ODP project itself would be fine to

>>     drop

>>     >> support for GCC < 4.

>>     >>

>>     >> And for clang, it doesn't affect since it also works fine with it.

>>     >

>>     >

>>     > So clang exports symbol __GNUC__ with a value of at least 4?

>>

>>     Yes,

>>

>> https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/InitPreprocessor.cpp#L494

>>

>>     Added quite a while ago.

>>

>>     Cheers,

>>     --

>>     Ricardo Salveti

>>

>>

>>

>>

>> _______________________________________________

>> lng-odp mailing list

>> lng-odp@lists.linaro.org

>> https://lists.linaro.org/mailman/listinfo/lng-odp

>>

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Anders Roxell April 15, 2016, 11:23 a.m. UTC | #9
On 15 April 2016 at 13:02, Savolainen, Petri (Nokia - FI/Espoo)
<petri.savolainen@nokia.com> wrote:
> Agree, that it gets ugly (for interface specification readability), if GCC
> pragmas are added into spec header files. Wouldn’t it work the same way if
> the pragmas are defined where the spec file is included. Namely e.g. here
> for the barrier:

I guess it would work, haven't tried. That means that all the implementations
have to add this into their files.
If we what we have in this patch implementations gets it for "free".

Cheers,
Anders

>
>
>
>
>
> #ifndef ODP_PLAT_BARRIER_H_
>
> #define ODP_PLAT_BARRIER_H_
>
>
>
> #ifdef __cplusplus
>
> extern "C" {
>
> #endif
>
>
>
> #include <odp/api/std_types.h>
>
> #include <odp/api/atomic.h>
>
> #include <odp/api/plat/shared_memory_types.h>
>
> #include <odp/api/plat/barrier_types.h>
>
>
>
> if __GNUC__ >= 4
> #pragma GCC visibility push(default)
> #endif
>
>
>
> #include <odp/api/spec/barrier.h>
>
>
>
> if __GNUC__ >= 4
> #pragma GCC visibility pop
> #endif
>
>
>
>
>
> #ifdef __cplusplus
>
> }
>
> #endif
>
>
>
> #endif
>
>
>
>
>
> -Petri
>
>
>
>
>
> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT
> Mike Holmes
> Sent: Friday, April 15, 2016 1:44 PM
> To: Maxim Uvarov <maxim.uvarov@linaro.org>
> Cc: lng-odp <lng-odp@lists.linaro.org>
> Subject: Re: [lng-odp] [API-NEXT PATCHv4] api: make only the API visible
>
>
>
> Maxim it needs to be in the spec, it is the spec that defines the ABI, if
> you dont do this then everyone implementing will have to manually mark
> hundreds of other apis as internal rather than we just export the correct
> list.
>
>
>
> At least that is my understanding at least.
>
>
>
>
>
>
>
> On 15 April 2016 at 06:38, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> Petri, please review this patch. For me it's not clear why it touches
> include/odp/api/spec files at all.
>
> Maxim.
>
> On 04/13/16 22:06, Bill Fischofer wrote:
>
> Ok, thanks.  With that:
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org
> <mailto:bill.fischofer@linaro.org>>
>
> On Wed, Apr 13, 2016 at 2:04 PM, Ricardo Salveti <ricardo.salveti@linaro.org
> <mailto:ricardo.salveti@linaro.org>> wrote:
>
>     On Wed, Apr 13, 2016 at 3:51 PM, Bill Fischofer
>     <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>     > On Wed, Apr 13, 2016 at 1:47 PM, Ricardo Salveti
>     > <ricardo.salveti@linaro.org <mailto:ricardo.salveti@linaro.org>>
>     wrote:
>     >>
>     >> On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer
>     >> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>>
>     wrote:
>     >> >
>     >> > On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell
>     >> > <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>
>     >> > wrote:
>     >> >>
>     >> >> Internal functions should not be part of symbols that are
>     visible
>     >> >> outside the library. Using -fvisibility=hidden hides all
>     internal
>     >> >> functions from the public ABI.
>     >> >>
>     >> >> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org
>     <mailto:ricardo.salveti@linaro.org>>
>     >> >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org
>     <mailto:anders.roxell@linaro.org>>
>
>
>     >> >> ---
>     >> >>  include/odp/api/spec/align.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/atomic.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/barrier.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/buffer.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/byteorder.h     |  8 ++++++++
>     >> >> include/odp/api/spec/classification.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/compiler.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/config.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/cpu.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/cpumask.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/crypto.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/debug.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/errno.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/event.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/hash.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/hints.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/init.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/packet.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/packet_flags.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/packet_io.h     |  8 ++++++++
>     >> >> include/odp/api/spec/packet_io_stats.h    |  8 ++++++++
>     >> >>  include/odp/api/spec/pool.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/queue.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/random.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/rwlock.h      |  8 ++++++++
>     >> >> include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++
>     >> >>  include/odp/api/spec/schedule.h      |  8 ++++++++
>     >> >> include/odp/api/spec/schedule_types.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/shared_memory.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/spinlock.h      |  8 ++++++++
>     >> >> include/odp/api/spec/spinlock_recursive.h |  8 ++++++++
>     >> >>  include/odp/api/spec/std_clib.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/std_types.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/sync.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/system_info.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/thread.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/thrmask.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/ticketlock.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/time.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/timer.h     |  8 ++++++++
>     >> >>  include/odp/api/spec/traffic_mngr.h      |  8 ++++++++
>     >> >>  include/odp/api/spec/version.h     |  8 ++++++++
>     >> >>  platform/Makefile.inc      |  1 +
>     >> >> platform/linux-generic/m4/configure.m4    | 12 ++++++++++++
>     >> >>  44 files changed, 349 insertions(+)
>     >> >>
>     >> >> diff --git a/include/odp/api/spec/align.h
>     >> >> b/include/odp/api/spec/align.h
>     >> >> index 677ff12..027b080 100644
>     >> >> --- a/include/odp/api/spec/align.h
>     >> >> +++ b/include/odp/api/spec/align.h
>     >> >> @@ -18,6 +18,10 @@
>     >> >>  extern "C" {
>     >> >>  #endif
>     >> >>
>     >> >> +#if __GNUC__ >= 4
>     >> >> +#pragma GCC visibility push(default)
>     >> >> +#endif
>     >> >
>     >> >
>     >> > Do these need to be guarded?  Do we care about GCC < 4 at
>     this point?
>     >> > How
>     >> > does this affect clang?
>     >>
>     >> It's usually good to protect that with the supported GCC
>     version, but
>     >> then the question is if the ODP project itself would be fine to
>     drop
>     >> support for GCC < 4.
>     >>
>     >> And for clang, it doesn't affect since it also works fine with it.
>     >
>     >
>     > So clang exports symbol __GNUC__ with a value of at least 4?
>
>     Yes,
>
> https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/InitPreprocessor.cpp#L494
>
>     Added quite a while ago.
>
>     Cheers,
>     --
>     Ricardo Salveti
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
>
> --
>
> Mike Holmes
>
> Technical Manager - Linaro Networking Group
>
> Linaro.org │ Open source software for ARM SoCs
>
> "Work should be fun and collaborative, the rest follows"
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Mike Holmes April 15, 2016, 11:35 a.m. UTC | #10
On 15 April 2016 at 07:23, Anders Roxell <anders.roxell@linaro.org> wrote:

> On 15 April 2016 at 13:02, Savolainen, Petri (Nokia - FI/Espoo)

> <petri.savolainen@nokia.com> wrote:

> > Agree, that it gets ugly (for interface specification readability), if

> GCC

> > pragmas are added into spec header files. Wouldn’t it work the same way

> if

> > the pragmas are defined where the spec file is included. Namely e.g. here

> > for the barrier:

>

> I guess it would work, haven't tried. That means that all the

> implementations

> have to add this into their files.

> If we what we have in this patch implementations gets it for "free".

>


I agree with Anders, the spec should define what the API IS, rather than
have all implementations exclude what is not in the API


>

> Cheers,

> Anders

>

> >

> >

> >

> >

> >

> > #ifndef ODP_PLAT_BARRIER_H_

> >

> > #define ODP_PLAT_BARRIER_H_

> >

> >

> >

> > #ifdef __cplusplus

> >

> > extern "C" {

> >

> > #endif

> >

> >

> >

> > #include <odp/api/std_types.h>

> >

> > #include <odp/api/atomic.h>

> >

> > #include <odp/api/plat/shared_memory_types.h>

> >

> > #include <odp/api/plat/barrier_types.h>

> >

> >

> >

> > if __GNUC__ >= 4

> > #pragma GCC visibility push(default)

> > #endif

> >

> >

> >

> > #include <odp/api/spec/barrier.h>

> >

> >

> >

> > if __GNUC__ >= 4

> > #pragma GCC visibility pop

> > #endif

> >

> >

> >

> >

> >

> > #ifdef __cplusplus

> >

> > }

> >

> > #endif

> >

> >

> >

> > #endif

> >

> >

> >

> >

> >

> > -Petri

> >

> >

> >

> >

> >

> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT

> > Mike Holmes

> > Sent: Friday, April 15, 2016 1:44 PM

> > To: Maxim Uvarov <maxim.uvarov@linaro.org>

> > Cc: lng-odp <lng-odp@lists.linaro.org>

> > Subject: Re: [lng-odp] [API-NEXT PATCHv4] api: make only the API visible

> >

> >

> >

> > Maxim it needs to be in the spec, it is the spec that defines the ABI, if

> > you dont do this then everyone implementing will have to manually mark

> > hundreds of other apis as internal rather than we just export the correct

> > list.

> >

> >

> >

> > At least that is my understanding at least.

> >

> >

> >

> >

> >

> >

> >

> > On 15 April 2016 at 06:38, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> >

> > Petri, please review this patch. For me it's not clear why it touches

> > include/odp/api/spec files at all.

> >

> > Maxim.

> >

> > On 04/13/16 22:06, Bill Fischofer wrote:

> >

> > Ok, thanks.  With that:

> >

> > Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org

> > <mailto:bill.fischofer@linaro.org>>

> >

> > On Wed, Apr 13, 2016 at 2:04 PM, Ricardo Salveti <

> ricardo.salveti@linaro.org

> > <mailto:ricardo.salveti@linaro.org>> wrote:

> >

> >     On Wed, Apr 13, 2016 at 3:51 PM, Bill Fischofer

> >     <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>>

> wrote:

> >     > On Wed, Apr 13, 2016 at 1:47 PM, Ricardo Salveti

> >     > <ricardo.salveti@linaro.org <mailto:ricardo.salveti@linaro.org>>

> >     wrote:

> >     >>

> >     >> On Wed, Apr 13, 2016 at 2:47 PM, Bill Fischofer

> >     >> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>>

> >     wrote:

> >     >> >

> >     >> > On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell

> >     >> > <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>

> >     >> > wrote:

> >     >> >>

> >     >> >> Internal functions should not be part of symbols that are

> >     visible

> >     >> >> outside the library. Using -fvisibility=hidden hides all

> >     internal

> >     >> >> functions from the public ABI.

> >     >> >>

> >     >> >> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org

> >     <mailto:ricardo.salveti@linaro.org>>

> >     >> >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org

> >     <mailto:anders.roxell@linaro.org>>

> >

> >

> >     >> >> ---

> >     >> >>  include/odp/api/spec/align.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/atomic.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/barrier.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/buffer.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/byteorder.h     |  8 ++++++++

> >     >> >> include/odp/api/spec/classification.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/compiler.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/config.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/cpu.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/cpumask.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/crypto.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/debug.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/errno.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/event.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/hash.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/hints.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/init.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/packet.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/packet_flags.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/packet_io.h     |  8 ++++++++

> >     >> >> include/odp/api/spec/packet_io_stats.h    |  8 ++++++++

> >     >> >>  include/odp/api/spec/pool.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/queue.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/random.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/rwlock.h      |  8 ++++++++

> >     >> >> include/odp/api/spec/rwlock_recursive.h   |  8 ++++++++

> >     >> >>  include/odp/api/spec/schedule.h      |  8 ++++++++

> >     >> >> include/odp/api/spec/schedule_types.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/shared_memory.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/spinlock.h      |  8 ++++++++

> >     >> >> include/odp/api/spec/spinlock_recursive.h |  8 ++++++++

> >     >> >>  include/odp/api/spec/std_clib.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/std_types.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/sync.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/system_info.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/thread.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/thrmask.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/ticketlock.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/time.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/timer.h     |  8 ++++++++

> >     >> >>  include/odp/api/spec/traffic_mngr.h      |  8 ++++++++

> >     >> >>  include/odp/api/spec/version.h     |  8 ++++++++

> >     >> >>  platform/Makefile.inc      |  1 +

> >     >> >> platform/linux-generic/m4/configure.m4    | 12 ++++++++++++

> >     >> >>  44 files changed, 349 insertions(+)

> >     >> >>

> >     >> >> diff --git a/include/odp/api/spec/align.h

> >     >> >> b/include/odp/api/spec/align.h

> >     >> >> index 677ff12..027b080 100644

> >     >> >> --- a/include/odp/api/spec/align.h

> >     >> >> +++ b/include/odp/api/spec/align.h

> >     >> >> @@ -18,6 +18,10 @@

> >     >> >>  extern "C" {

> >     >> >>  #endif

> >     >> >>

> >     >> >> +#if __GNUC__ >= 4

> >     >> >> +#pragma GCC visibility push(default)

> >     >> >> +#endif

> >     >> >

> >     >> >

> >     >> > Do these need to be guarded?  Do we care about GCC < 4 at

> >     this point?

> >     >> > How

> >     >> > does this affect clang?

> >     >>

> >     >> It's usually good to protect that with the supported GCC

> >     version, but

> >     >> then the question is if the ODP project itself would be fine to

> >     drop

> >     >> support for GCC < 4.

> >     >>

> >     >> And for clang, it doesn't affect since it also works fine with it.

> >     >

> >     >

> >     > So clang exports symbol __GNUC__ with a value of at least 4?

> >

> >     Yes,

> >

> >

> https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/InitPreprocessor.cpp#L494

> >

> >     Added quite a while ago.

> >

> >     Cheers,

> >     --

> >     Ricardo Salveti

> >

> >

> >

> > _______________________________________________

> > lng-odp mailing list

> > lng-odp@lists.linaro.org

> > https://lists.linaro.org/mailman/listinfo/lng-odp

> >

> >

> > _______________________________________________

> > lng-odp mailing list

> > lng-odp@lists.linaro.org

> > https://lists.linaro.org/mailman/listinfo/lng-odp

> >

> >

> >

> >

> >

> > --

> >

> > Mike Holmes

> >

> > Technical Manager - Linaro Networking Group

> >

> > Linaro.org │ Open source software for ARM SoCs

> >

> > "Work should be fun and collaborative, the rest follows"

> >

> >

> >

> >

> > _______________________________________________

> > lng-odp mailing list

> > lng-odp@lists.linaro.org

> > https://lists.linaro.org/mailman/listinfo/lng-odp

> >

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Bill Fischofer April 15, 2016, 1:09 p.m. UTC | #11
On Fri, Apr 15, 2016 at 6:39 AM, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>

>

> > -----Original Message-----

> > From: EXT Anders Roxell [mailto:anders.roxell@linaro.org]

> > Sent: Friday, April 15, 2016 2:24 PM

> > To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolainen@nokia.com>

> > Cc: EXT Mike Holmes <mike.holmes@linaro.org>; Maxim Uvarov

> > <maxim.uvarov@linaro.org>; lng-odp <lng-odp@lists.linaro.org>

> > Subject: Re: [lng-odp] [API-NEXT PATCHv4] api: make only the API visible

> >

> > On 15 April 2016 at 13:02, Savolainen, Petri (Nokia - FI/Espoo)

> > <petri.savolainen@nokia.com> wrote:

> > > Agree, that it gets ugly (for interface specification readability), if

> > GCC

> > > pragmas are added into spec header files. Wouldn’t it work the same way

> > if

> > > the pragmas are defined where the spec file is included. Namely e.g.

> > here

> > > for the barrier:

> >

> > I guess it would work, haven't tried. That means that all the

> > implementations

> > have to add this into their files.

> > If we what we have in this patch implementations gets it for "free".

> >

> > Cheers,

> > Anders

> >

>

> Since all implementations may not support binary compatible libs or even

> GCC. I think it belong to implementation and those may solve it in

> different ways. So, I don't think that "get for free" is as important here

> as a clean set API spec files.

>


These changes enable but do not force ABI mode and they work for both GCC
and clang.  Enabling ABI mode involves compiling with -fvisibility=hidden.
When you do that then all symbols are hidden by default and the result is
only the ODP APIs are exposed, due to these pragmas.

This is exactly what we want.  If an implementation wishes to expose
symbols other than those that are part of the ODP API then it can simply
follow this override model for those symbols.


>

> -Petri

>

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Maxim Uvarov April 15, 2016, 3:24 p.m. UTC | #12
We need more review for that patch.

 From one side it's good changes and logically it's right to make api 
visible and other functions not visible by default. From other point of 
view I can
not find any other libs which do exactly the same thing. So it's not 
clear what we can break with that changes, if we can.

Maxim.

On 04/15/16 16:09, Bill Fischofer wrote:
>
>
> On Fri, Apr 15, 2016 at 6:39 AM, Savolainen, Petri (Nokia - FI/Espoo) 
> <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>> wrote:
>
>
>
>     > -----Original Message-----
>     > From: EXT Anders Roxell [mailto:anders.roxell@linaro.org
>     <mailto:anders.roxell@linaro.org>]
>     > Sent: Friday, April 15, 2016 2:24 PM
>     > To: Savolainen, Petri (Nokia - FI/Espoo)
>     <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>>
>     > Cc: EXT Mike Holmes <mike.holmes@linaro.org
>     <mailto:mike.holmes@linaro.org>>; Maxim Uvarov
>     > <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>>;
>     lng-odp <lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>
>     > Subject: Re: [lng-odp] [API-NEXT PATCHv4] api: make only the API
>     visible
>     >
>     > On 15 April 2016 at 13:02, Savolainen, Petri (Nokia - FI/Espoo)
>     > <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>>
>     wrote:
>     > > Agree, that it gets ugly (for interface specification
>     readability), if
>     > GCC
>     > > pragmas are added into spec header files. Wouldn’t it work the
>     same way
>     > if
>     > > the pragmas are defined where the spec file is included.
>     Namely e.g.
>     > here
>     > > for the barrier:
>     >
>     > I guess it would work, haven't tried. That means that all the
>     > implementations
>     > have to add this into their files.
>     > If we what we have in this patch implementations gets it for "free".
>     >
>     > Cheers,
>     > Anders
>     >
>
>     Since all implementations may not support binary compatible libs
>     or even GCC. I think it belong to implementation and those may
>     solve it in different ways. So, I don't think that "get for free"
>     is as important here as a clean set API spec files.
>
>
> These changes enable but do not force ABI mode and they work for both 
> GCC and clang.  Enabling ABI mode involves compiling with 
> -fvisibility=hidden.  When you do that then all symbols are hidden by 
> default and the result is only the ODP APIs are exposed, due to these 
> pragmas.
>
> This is exactly what we want.  If an implementation wishes to expose 
> symbols other than those that are part of the ODP API then it can 
> simply follow this override model for those symbols.
>
>
>     -Petri
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Ricardo Salveti April 15, 2016, 3:54 p.m. UTC | #13
On Fri, Apr 15, 2016 at 10:09 AM, Bill Fischofer
<bill.fischofer@linaro.org> wrote:
> On Fri, Apr 15, 2016 at 6:39 AM, Savolainen, Petri (Nokia - FI/Espoo)
> <petri.savolainen@nokia.com> wrote:
>> > -----Original Message-----
>> > From: EXT Anders Roxell [mailto:anders.roxell@linaro.org]
>> > Sent: Friday, April 15, 2016 2:24 PM
>> > To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolainen@nokia.com>
>> > Cc: EXT Mike Holmes <mike.holmes@linaro.org>; Maxim Uvarov
>> > <maxim.uvarov@linaro.org>; lng-odp <lng-odp@lists.linaro.org>
>> > Subject: Re: [lng-odp] [API-NEXT PATCHv4] api: make only the API visible
>> >
>> > On 15 April 2016 at 13:02, Savolainen, Petri (Nokia - FI/Espoo)
>> > <petri.savolainen@nokia.com> wrote:
>> > > Agree, that it gets ugly (for interface specification readability), if
>> > GCC
>> > > pragmas are added into spec header files. Wouldn’t it work the same
>> > > way
>> > if
>> > > the pragmas are defined where the spec file is included. Namely e.g.
>> > here
>> > > for the barrier:
>> >
>> > I guess it would work, haven't tried. That means that all the
>> > implementations
>> > have to add this into their files.
>> > If we what we have in this patch implementations gets it for "free".
>> >
>> > Cheers,
>> > Anders
>> >
>>
>> Since all implementations may not support binary compatible libs or even
>> GCC. I think it belong to implementation and those may solve it in different
>> ways. So, I don't think that "get for free" is as important here as a clean
>> set API spec files.
>
>
> These changes enable but do not force ABI mode and they work for both GCC
> and clang.  Enabling ABI mode involves compiling with -fvisibility=hidden.
> When you do that then all symbols are hidden by default and the result is
> only the ODP APIs are exposed, due to these pragmas.
>
> This is exactly what we want.  If an implementation wishes to expose symbols
> other than those that are part of the ODP API then it can simply follow this
> override model for those symbols.

Right, I think it is useful to provide a way for people creating
different implementations to easily see which functions are exported
by default.

And this will do nothing if not GCC/clang.

Cheers,
Ricardo Salveti April 15, 2016, 3:59 p.m. UTC | #14
On Fri, Apr 15, 2016 at 12:24 PM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> We need more review for that patch.
>
> From one side it's good changes and logically it's right to make api visible
> and other functions not visible by default. From other point of view I can
> not find any other libs which do exactly the same thing. So it's not clear
> what we can break with that changes, if we can.

We do have quite a few other examples of libraries and projects using
a similar approach (e.g. mesa, wayland, tslib), but they are usually
controlling symbol by symbol instead of using pragma for the entire
header.

A common example is defining EXPORT as __attribute__
((visibility("default"))) and then manually having that as part of
each public symbol/declaration.

So I guess the decision to make is if we want to have that as part of
the header, and if pragma or manual exposure via __attribute__ should
be used.

Cheers,
Mike Holmes April 15, 2016, 4:33 p.m. UTC | #15
Thanks all, this is on Mondays ARCH call to expedite things since we want
to get 1.9 out.

On 15 April 2016 at 11:59, Ricardo Salveti <ricardo.salveti@linaro.org>
wrote:

> On Fri, Apr 15, 2016 at 12:24 PM, Maxim Uvarov <maxim.uvarov@linaro.org>

> wrote:

> > We need more review for that patch.

> >

> > From one side it's good changes and logically it's right to make api

> visible

> > and other functions not visible by default. From other point of view I

> can

> > not find any other libs which do exactly the same thing. So it's not

> clear

> > what we can break with that changes, if we can.

>

> We do have quite a few other examples of libraries and projects using

> a similar approach (e.g. mesa, wayland, tslib), but they are usually

> controlling symbol by symbol instead of using pragma for the entire

> header.

>

> A common example is defining EXPORT as __attribute__

> ((visibility("default"))) and then manually having that as part of

> each public symbol/declaration.

>

> So I guess the decision to make is if we want to have that as part of

> the header, and if pragma or manual exposure via __attribute__ should

> be used.

>

> Cheers,

> --

> Ricardo Salveti

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Bill Fischofer April 15, 2016, 6:02 p.m. UTC | #16
The argument for the #pragma in the ODP API files is that by design they
should contain nothing that isn't intended for export, so not marking each
struct/API individually both saves time and discourages someone trying to
put something private in those files (by not marking the individual entity).

It's unfortunate that by design a C macro cannot emit a #pragma as this
means you can't hide the somewhat awkward syntax.  An alternative would be
to wrap these #pragmas in separate #include files., e.g.:

#include <odp_api_def_begin.h>
...odp API file contents
#include <odp_api_def_end.h>



On Fri, Apr 15, 2016 at 11:33 AM, Mike Holmes <mike.holmes@linaro.org>
wrote:

> Thanks all, this is on Mondays ARCH call to expedite things since we want

> to get 1.9 out.

>

> On 15 April 2016 at 11:59, Ricardo Salveti <ricardo.salveti@linaro.org>

> wrote:

>

>> On Fri, Apr 15, 2016 at 12:24 PM, Maxim Uvarov <maxim.uvarov@linaro.org>

>> wrote:

>> > We need more review for that patch.

>> >

>> > From one side it's good changes and logically it's right to make api

>> visible

>> > and other functions not visible by default. From other point of view I

>> can

>> > not find any other libs which do exactly the same thing. So it's not

>> clear

>> > what we can break with that changes, if we can.

>>

>> We do have quite a few other examples of libraries and projects using

>> a similar approach (e.g. mesa, wayland, tslib), but they are usually

>> controlling symbol by symbol instead of using pragma for the entire

>> header.

>>

>> A common example is defining EXPORT as __attribute__

>> ((visibility("default"))) and then manually having that as part of

>> each public symbol/declaration.

>>

>> So I guess the decision to make is if we want to have that as part of

>> the header, and if pragma or manual exposure via __attribute__ should

>> be used.

>>

>> Cheers,

>> --

>> Ricardo Salveti

>> _______________________________________________

>> lng-odp mailing list

>> lng-odp@lists.linaro.org

>> https://lists.linaro.org/mailman/listinfo/lng-odp

>>

>

>

>

> --

> Mike Holmes

> Technical Manager - Linaro Networking Group

> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs

> "Work should be fun and collaborative, the rest follows"

>

>

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>

>
diff mbox

Patch

diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h
index 677ff12..027b080 100644
--- a/include/odp/api/spec/align.h
+++ b/include/odp/api/spec/align.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_compiler_optim
  *  Macros that allow cache line size configuration, check that
  *  alignment is a power of two etc.
@@ -70,6 +74,10 @@  extern "C" {
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h
index a16d90b..b926964 100644
--- a/include/odp/api/spec/atomic.h
+++ b/include/odp/api/spec/atomic.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @defgroup odp_atomic ODP ATOMIC
  * @details
@@ -624,6 +628,10 @@  int odp_atomic_lock_free_u64(odp_atomic_op_t *atomic_op);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/barrier.h b/include/odp/api/spec/barrier.h
index 823eae6..34c3658 100644
--- a/include/odp/api/spec/barrier.h
+++ b/include/odp/api/spec/barrier.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @defgroup odp_barrier ODP BARRIER
  * Thread excution and memory ordering barriers.
@@ -59,6 +63,10 @@  void odp_barrier_wait(odp_barrier_t *barr);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h
index 6631f47..caa2cb6 100644
--- a/include/odp/api/spec/buffer.h
+++ b/include/odp/api/spec/buffer.h
@@ -19,6 +19,10 @@  extern "C" {
 #endif
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_buffer ODP BUFFER
  *  Operations on a buffer.
  *  @{
@@ -163,6 +167,10 @@  uint64_t odp_buffer_to_u64(odp_buffer_t hdl);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h
index a12a729..17f7ebe 100644
--- a/include/odp/api/spec/byteorder.h
+++ b/include/odp/api/spec/byteorder.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_compiler_optim ODP COMPILER / OPTIMIZATION
  *  Macros that check byte order and operations for byte order conversion.
  *  @{
@@ -173,6 +177,10 @@  odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h
index 076b3de..f200869 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -19,6 +19,10 @@  extern "C" {
 #endif
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_classification ODP CLASSIFICATION
  *  Classification operations.
  *  @{
@@ -392,6 +396,10 @@  uint64_t odp_pmr_to_u64(odp_pmr_t hdl);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/compiler.h b/include/odp/api/spec/compiler.h
index 5a24bfb..1b6d05f 100644
--- a/include/odp/api/spec/compiler.h
+++ b/include/odp/api/spec/compiler.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_compiler_optim
  *  Macro for old compilers
  *  @{
@@ -44,6 +48,10 @@  extern "C" {
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/config.h b/include/odp/api/spec/config.h
index c9879d6..14e54e1 100644
--- a/include/odp/api/spec/config.h
+++ b/include/odp/api/spec/config.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_config ODP CONFIG
  *  Platform-specific configuration limits.
  *
@@ -157,6 +161,10 @@  int odp_config_shm_blocks(void);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h
index f0e20c4..e87875e 100644
--- a/include/odp/api/spec/cpu.h
+++ b/include/odp/api/spec/cpu.h
@@ -20,6 +20,10 @@  extern "C" {
 
 #include <odp/api/std_types.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_cpu ODP CPU
  *  @{
  */
@@ -172,6 +176,10 @@  void odp_cpu_pause(void);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/cpumask.h b/include/odp/api/spec/cpumask.h
index 42098c2..3fc7694 100644
--- a/include/odp/api/spec/cpumask.h
+++ b/include/odp/api/spec/cpumask.h
@@ -20,6 +20,10 @@  extern "C" {
 
 #include <odp/api/config.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_cpumask ODP CPUMASK
  *  CPU mask operations.
  *  @{
@@ -247,6 +251,10 @@  int odp_cpumask_all_available(odp_cpumask_t *mask);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 7c6f9bc..7ac5ad1 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_crypto ODP CRYPTO
  *  Macros, enums, types and operations to utilise crypto.
  *  @{
@@ -367,6 +371,10 @@  uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/debug.h b/include/odp/api/spec/debug.h
index 252a82f..c1ecd78 100644
--- a/include/odp/api/spec/debug.h
+++ b/include/odp/api/spec/debug.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 #if defined(__GNUC__) && !defined(__clang__)
 
 
@@ -43,6 +47,10 @@  extern "C" {
 #define _ODP_STATIC_ASSERT(cond, msg)  _Static_assert(cond, msg)
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/errno.h b/include/odp/api/spec/errno.h
index 33998b6..a337334 100644
--- a/include/odp/api/spec/errno.h
+++ b/include/odp/api/spec/errno.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @defgroup odp_errno ODP ERRNO
  * @details
@@ -78,6 +82,10 @@  const char *odp_errno_str(int errnum);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
index 29547f3..3a7c149 100644
--- a/include/odp/api/spec/event.h
+++ b/include/odp/api/spec/event.h
@@ -19,6 +19,10 @@  extern "C" {
 #endif
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_event ODP EVENT
  *  Operations on an event.
  *  @{
@@ -79,6 +83,10 @@  void odp_event_free(odp_event_t event);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/hash.h b/include/odp/api/spec/hash.h
index a6bc753..b00a6ad 100644
--- a/include/odp/api/spec/hash.h
+++ b/include/odp/api/spec/hash.h
@@ -19,6 +19,10 @@  extern "C" {
 
 #include <odp/api/std_types.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_hash ODP HASH FUNCTIONS
  *  ODP Hash functions
  *  @{
@@ -91,6 +95,10 @@  int odp_hash_crc_gen64(const void *data, uint32_t data_len,
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/hints.h b/include/odp/api/spec/hints.h
index ea67fc4..325ef15 100644
--- a/include/odp/api/spec/hints.h
+++ b/include/odp/api/spec/hints.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_compiler_optim
  *  Macros that will give hints to the compiler.
  *  @{
@@ -109,6 +113,10 @@  extern "C" {
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 8560663..ff9e343 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -33,6 +33,10 @@  extern "C" {
 #include <odp/api/thread.h>
 #include <odp/api/cpumask.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_initialization ODP INITIALIZATION
  *  Initialisation operations.
  *  @{
@@ -274,6 +278,10 @@  int odp_term_local(void);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 7da353b..4305ea0 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -20,6 +20,10 @@  extern "C" {
 
 #include <odp/api/time.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_packet ODP PACKET
  *  Operations on a packet.
  *  @{
@@ -1060,6 +1064,10 @@  uint64_t odp_packet_seg_to_u64(odp_packet_seg_t hdl);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h
index 35d44e1..cc63cda 100644
--- a/include/odp/api/spec/packet_flags.h
+++ b/include/odp/api/spec/packet_flags.h
@@ -21,6 +21,10 @@  extern "C" {
 #include <odp/api/std_types.h>
 #include <odp/api/packet.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_packet
  *  Boolean operations on a packet.
  *  @{
@@ -489,6 +493,10 @@  void odp_packet_has_ts_clr(odp_packet_t pkt);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 466cab6..ddf9e05 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -22,6 +22,10 @@  extern "C" {
 #include <odp/api/queue.h>
 #include <odp/api/time.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_packet_io ODP PACKET IO
  *  Operations on a packet Input/Output interface.
  *
@@ -1034,6 +1038,10 @@  odp_time_t odp_pktin_ts_from_ns(odp_pktio_t pktio, uint64_t ns);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/packet_io_stats.h b/include/odp/api/spec/packet_io_stats.h
index 148ad8d..3fe31d7 100644
--- a/include/odp/api/spec/packet_io_stats.h
+++ b/include/odp/api/spec/packet_io_stats.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_packet_io
  *  @{
  */
@@ -134,6 +138,10 @@  int odp_pktio_stats_reset(odp_pktio_t pktio);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
index 94a302e..8f3c19e 100644
--- a/include/odp/api/spec/pool.h
+++ b/include/odp/api/spec/pool.h
@@ -22,6 +22,10 @@  extern "C" {
 
 #include <odp/api/std_types.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_pool ODP POOL
  *  Operations on a pool.
  *  @{
@@ -206,6 +210,10 @@  void odp_pool_param_init(odp_pool_param_t *param);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 51d94a2..2e767e7 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -21,6 +21,10 @@  extern "C" {
 #include <odp/api/schedule_types.h>
 #include <odp/api/event.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_queue ODP QUEUE
  *  Macros and operation on a queue.
  *  @{
@@ -370,6 +374,10 @@  int odp_queue_info(odp_queue_t queue, odp_queue_info_t *info);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/random.h b/include/odp/api/spec/random.h
index 435783a..d1f9267 100644
--- a/include/odp/api/spec/random.h
+++ b/include/odp/api/spec/random.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_random ODP RANDOM
  *  @{
  */
@@ -41,6 +45,10 @@  int32_t odp_random_data(uint8_t *buf, int32_t size, odp_bool_t use_entropy);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/rwlock.h b/include/odp/api/spec/rwlock.h
index 9ca8872..7d23430 100644
--- a/include/odp/api/spec/rwlock.h
+++ b/include/odp/api/spec/rwlock.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @defgroup odp_locks ODP LOCKS
  * @details
@@ -95,6 +99,10 @@  void odp_rwlock_write_unlock(odp_rwlock_t *rwlock);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/rwlock_recursive.h b/include/odp/api/spec/rwlock_recursive.h
index 965fcc0..1631491 100644
--- a/include/odp/api/spec/rwlock_recursive.h
+++ b/include/odp/api/spec/rwlock_recursive.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @addtogroup odp_locks
  * @details
@@ -113,6 +117,10 @@  void odp_rwlock_recursive_write_unlock(odp_rwlock_recursive_t *lock);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index cd1325a..cff56ac 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -25,6 +25,10 @@  extern "C" {
 #include <odp/api/schedule_types.h>
 #include <odp/api/thrmask.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_scheduler ODP SCHEDULER
  *  Operations on the scheduler.
  *  @{
@@ -371,6 +375,10 @@  void odp_schedule_order_unlock(unsigned lock_index);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h
index 34046af..11fc001 100644
--- a/include/odp/api/spec/schedule_types.h
+++ b/include/odp/api/spec/schedule_types.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_scheduler
  *  @{
  */
@@ -152,6 +156,10 @@  typedef	struct odp_schedule_param_t {
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h
index 5d851ce..8969462 100644
--- a/include/odp/api/spec/shared_memory.h
+++ b/include/odp/api/spec/shared_memory.h
@@ -19,6 +19,10 @@  extern "C" {
 #endif
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_shared_memory ODP SHARED MEMORY
  *  Operations on shared memory.
  *  @{
@@ -148,6 +152,10 @@  uint64_t odp_shm_to_u64(odp_shm_t hdl);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/spinlock.h b/include/odp/api/spec/spinlock.h
index a73359d..02e9d1a 100644
--- a/include/odp/api/spec/spinlock.h
+++ b/include/odp/api/spec/spinlock.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @addtogroup odp_locks
  * @details
@@ -84,6 +88,10 @@  int odp_spinlock_is_locked(odp_spinlock_t *splock);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/spinlock_recursive.h b/include/odp/api/spec/spinlock_recursive.h
index d98f2bb..457998a 100644
--- a/include/odp/api/spec/spinlock_recursive.h
+++ b/include/odp/api/spec/spinlock_recursive.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @addtogroup odp_locks
  * @details
@@ -78,6 +82,10 @@  int odp_spinlock_recursive_is_locked(odp_spinlock_recursive_t *lock);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/std_clib.h b/include/odp/api/spec/std_clib.h
index 791b72f..de5976c 100644
--- a/include/odp/api/spec/std_clib.h
+++ b/include/odp/api/spec/std_clib.h
@@ -17,6 +17,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @defgroup odp_std_clib ODP STD CLIB
  * @details
@@ -75,6 +79,10 @@  int odp_memcmp(const void *ptr1, const void *ptr2, size_t num);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h
index 7558c64..f138e94 100644
--- a/include/odp/api/spec/std_types.h
+++ b/include/odp/api/spec/std_types.h
@@ -20,6 +20,10 @@  extern "C" {
 #endif
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_system ODP SYSTEM
  *  @{
  */
@@ -35,6 +39,10 @@  extern "C" {
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/sync.h b/include/odp/api/spec/sync.h
index c6f790c..1faa49b 100644
--- a/include/odp/api/spec/sync.h
+++ b/include/odp/api/spec/sync.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @addtogroup odp_barrier
  * @details
@@ -83,6 +87,10 @@  void odp_mb_full(void);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/system_info.h b/include/odp/api/spec/system_info.h
index bde3a60..0191b88 100644
--- a/include/odp/api/spec/system_info.h
+++ b/include/odp/api/spec/system_info.h
@@ -19,6 +19,10 @@  extern "C" {
 #endif
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_system ODP SYSTEM
  *  @{
  */
@@ -48,6 +52,10 @@  int odp_sys_cache_line_size(void);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h
index 3720249..94101c8 100644
--- a/include/odp/api/spec/thread.h
+++ b/include/odp/api/spec/thread.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_thread ODP THREAD
  *  @{
  */
@@ -105,6 +109,10 @@  odp_thread_type_t odp_thread_type(void);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/thrmask.h b/include/odp/api/spec/thrmask.h
index a22da8c..4eb8e29 100644
--- a/include/odp/api/spec/thrmask.h
+++ b/include/odp/api/spec/thrmask.h
@@ -19,6 +19,10 @@  extern "C" {
 
 #include <odp/api/std_types.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @addtogroup odp_thread
  *  Thread mask operations.
  *  @{
@@ -232,6 +236,10 @@  int odp_thrmask_control(odp_thrmask_t *mask);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/ticketlock.h b/include/odp/api/spec/ticketlock.h
index 3f0e3f5..071a5f0 100644
--- a/include/odp/api/spec/ticketlock.h
+++ b/include/odp/api/spec/ticketlock.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @addtogroup odp_locks
  * @details
@@ -83,6 +87,10 @@  int odp_ticketlock_is_locked(odp_ticketlock_t *tklock);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h
index 85692ec..62873bc 100644
--- a/include/odp/api/spec/time.h
+++ b/include/odp/api/spec/time.h
@@ -19,6 +19,10 @@  extern "C" {
 #endif
 
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_time ODP TIME
  *  @{
  */
@@ -174,6 +178,10 @@  uint64_t odp_time_to_u64(odp_time_t time);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h
index 435c004..e83a76c 100644
--- a/include/odp/api/spec/timer.h
+++ b/include/odp/api/spec/timer.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /** @defgroup odp_timer ODP TIMER
  *  @{
  */
@@ -408,6 +412,10 @@  uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h
index ce124a8..d7a6248 100644
--- a/include/odp/api/spec/traffic_mngr.h
+++ b/include/odp/api/spec/traffic_mngr.h
@@ -14,6 +14,10 @@  extern "C" {
 #include <odp/api/std_types.h>
 #include <odp/api/packet_io.h>
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @file
  *
@@ -1367,6 +1371,10 @@  void odp_tm_stats_print(odp_tm_t odp_tm);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/odp/api/spec/version.h b/include/odp/api/spec/version.h
index 642831c..22cb371 100644
--- a/include/odp/api/spec/version.h
+++ b/include/odp/api/spec/version.h
@@ -18,6 +18,10 @@ 
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
 /**
  * @defgroup odp_version ODP VERSION
  * @details
@@ -98,6 +102,10 @@  const char *odp_version_impl_str(void);
  * @}
  */
 
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 1cb7a71..5aa3fed 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -15,6 +15,7 @@  AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
 GIT_DESC = `$(top_srcdir)/scripts/get_impl_str.sh $(top_srcdir)`
 AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"
 AM_CFLAGS += -DPLATFORM=${with_platform}
+AM_CFLAGS += $(VISIBILITY_CFLAGS)
 
 #The implementation will need to retain the deprecated implementation
 AM_CFLAGS += -Wno-deprecated-declarations
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index f80c66c..75a3797 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -1,3 +1,15 @@ 
+# Enable -fvisibility=hidden if using a gcc that supports it
+OLD_CFLAGS="$CFLAGS"
+AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
+VISIBILITY_CFLAGS="-fvisibility=hidden"
+CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
+       [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
+
+AC_SUBST(VISIBILITY_CFLAGS)
+# Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
+CFLAGS=$OLD_CFLAGS
+
 AC_MSG_CHECKING(for GCC atomic builtins)
 AC_LINK_IFELSE(
     [AC_LANG_SOURCE(