For reference, GCC 4.0 was released in April 2005.

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

>
> On Wed, Apr 13, 2016 at 12:30 PM, Anders Roxell <anders.rox...@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.salv...@linaro.org>
>> Signed-off-by: Anders Roxell <anders.rox...@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
>>
>
>
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to