I've send v5 of this patch that uses the hybrid approach I mentioned
earlier today.  I think that should address Petri's concerns while still
making this automatic for all implementations that reference the spec files.

(I mistakenly posted this as v2 earlier, just reposted renamed to be v5)

Bill

On Mon, Apr 18, 2016 at 8:40 AM, 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>
> ---
>  platform/Makefile.inc                                       |  1 +
>  platform/linux-generic/include/odp/api/align.h              |  6 ++++++
>  platform/linux-generic/include/odp/api/atomic.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/barrier.h            |  6 ++++++
>  platform/linux-generic/include/odp/api/buffer.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/byteorder.h          |  6 ++++++
>  platform/linux-generic/include/odp/api/classification.h     |  6 ++++++
>  platform/linux-generic/include/odp/api/compiler.h           |  6 ++++++
>  platform/linux-generic/include/odp/api/config.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/cpu.h                |  6 ++++++
>  platform/linux-generic/include/odp/api/cpumask.h            |  6 ++++++
>  platform/linux-generic/include/odp/api/crypto.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/debug.h              |  6 ++++++
>  platform/linux-generic/include/odp/api/errno.h              |  6 ++++++
>  platform/linux-generic/include/odp/api/event.h              |  6 ++++++
>  platform/linux-generic/include/odp/api/hash.h               |  6 ++++++
>  platform/linux-generic/include/odp/api/hints.h              |  6 ++++++
>  platform/linux-generic/include/odp/api/init.h               |  6 ++++++
>  platform/linux-generic/include/odp/api/packet.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/packet_flags.h       |  6 ++++++
>  platform/linux-generic/include/odp/api/packet_io.h          |  6 ++++++
>  platform/linux-generic/include/odp/api/packet_io_stats.h    |  6 ++++++
>  platform/linux-generic/include/odp/api/pool.h               |  6 ++++++
>  platform/linux-generic/include/odp/api/queue.h              |  6 ++++++
>  platform/linux-generic/include/odp/api/random.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/rwlock.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/rwlock_recursive.h   |  6 ++++++
>  platform/linux-generic/include/odp/api/schedule.h           |  6 ++++++
>  platform/linux-generic/include/odp/api/schedule_types.h     |  6 ++++++
>  platform/linux-generic/include/odp/api/shared_memory.h      |  6 ++++++
>  platform/linux-generic/include/odp/api/spinlock.h           |  6 ++++++
>  platform/linux-generic/include/odp/api/spinlock_recursive.h |  6 ++++++
>  platform/linux-generic/include/odp/api/std_clib.h           |  6 ++++++
>  platform/linux-generic/include/odp/api/std_types.h          |  6 ++++++
>  platform/linux-generic/include/odp/api/sync.h               |  6 ++++++
>  platform/linux-generic/include/odp/api/system_info.h        |  6 ++++++
>  platform/linux-generic/include/odp/api/thread.h             |  6 ++++++
>  platform/linux-generic/include/odp/api/thrmask.h            |  6 ++++++
>  platform/linux-generic/include/odp/api/ticketlock.h         |  6 ++++++
>  platform/linux-generic/include/odp/api/time.h               |  6 ++++++
>  platform/linux-generic/include/odp/api/timer.h              |  6 ++++++
>  platform/linux-generic/include/odp/api/traffic_mngr.h       |  6 ++++++
>  platform/linux-generic/include/odp/api/version.h            |  6 ++++++
>  platform/linux-generic/m4/configure.m4                      | 12
> ++++++++++++
>  44 files changed, 265 insertions(+)
>
> 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/include/odp/api/align.h
> b/platform/linux-generic/include/odp/api/align.h
> index d8bc653..ef8fa0d 100644
> --- a/platform/linux-generic/include/odp/api/align.h
> +++ b/platform/linux-generic/include/odp/api/align.h
> @@ -51,7 +51,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/align.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>  #include <odp/api/cpu_arch.h>
>
>  #ifdef __cplusplus
> diff --git a/platform/linux-generic/include/odp/api/atomic.h
> b/platform/linux-generic/include/odp/api/atomic.h
> index b487383..8fb34c4 100644
> --- a/platform/linux-generic/include/odp/api/atomic.h
> +++ b/platform/linux-generic/include/odp/api/atomic.h
> @@ -411,7 +411,13 @@ static inline int
> odp_atomic_cas_acq_rel_u64(odp_atomic_u64_t *atom,
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/atomic.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/barrier.h
> b/platform/linux-generic/include/odp/api/barrier.h
> index ab1b775..554da7d 100644
> --- a/platform/linux-generic/include/odp/api/barrier.h
> +++ b/platform/linux-generic/include/odp/api/barrier.h
> @@ -22,7 +22,13 @@ extern "C" {
>  #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
>  }
> diff --git a/platform/linux-generic/include/odp/api/buffer.h
> b/platform/linux-generic/include/odp/api/buffer.h
> index 81dbf12..a2ee3a9 100644
> --- a/platform/linux-generic/include/odp/api/buffer.h
> +++ b/platform/linux-generic/include/odp/api/buffer.h
> @@ -30,7 +30,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/buffer.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/byteorder.h
> b/platform/linux-generic/include/odp/api/byteorder.h
> index c347be0..412bd87 100644
> --- a/platform/linux-generic/include/odp/api/byteorder.h
> +++ b/platform/linux-generic/include/odp/api/byteorder.h
> @@ -140,7 +140,13 @@ static inline odp_u64le_t odp_cpu_to_le_64(uint64_t
> cpu64)
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/byteorder.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/classification.h
> b/platform/linux-generic/include/odp/api/classification.h
> index 0bec38b..fbd9b4c 100644
> --- a/platform/linux-generic/include/odp/api/classification.h
> +++ b/platform/linux-generic/include/odp/api/classification.h
> @@ -32,7 +32,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/classification.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/compiler.h
> b/platform/linux-generic/include/odp/api/compiler.h
> index 5249d5d..f49b7e6 100644
> --- a/platform/linux-generic/include/odp/api/compiler.h
> +++ b/platform/linux-generic/include/odp/api/compiler.h
> @@ -25,7 +25,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/compiler.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/config.h
> b/platform/linux-generic/include/odp/api/config.h
> index e21b6f7..657dea1 100644
> --- a/platform/linux-generic/include/odp/api/config.h
> +++ b/platform/linux-generic/include/odp/api/config.h
> @@ -187,7 +187,13 @@ static inline int odp_config_shm_blocks(void)
>         return ODP_CONFIG_SHM_BLOCKS;
>  }
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/config.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  /**
>   * @}
> diff --git a/platform/linux-generic/include/odp/api/cpu.h
> b/platform/linux-generic/include/odp/api/cpu.h
> index d49c782..31c00f8 100644
> --- a/platform/linux-generic/include/odp/api/cpu.h
> +++ b/platform/linux-generic/include/odp/api/cpu.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/cpu_arch.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/cpu.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/cpumask.h
> b/platform/linux-generic/include/odp/api/cpumask.h
> index 15bf25e..8769996 100644
> --- a/platform/linux-generic/include/odp/api/cpumask.h
> +++ b/platform/linux-generic/include/odp/api/cpumask.h
> @@ -23,7 +23,13 @@ extern "C" {
>  #include <odp/api/std_types.h>
>  #include <odp/api/plat/cpumask_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/cpumask.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/crypto.h
> b/platform/linux-generic/include/odp/api/crypto.h
> index 4f65932..6dac5c7 100644
> --- a/platform/linux-generic/include/odp/api/crypto.h
> +++ b/platform/linux-generic/include/odp/api/crypto.h
> @@ -32,7 +32,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/crypto.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/debug.h
> b/platform/linux-generic/include/odp/api/debug.h
> index 7db1433..374eea1 100644
> --- a/platform/linux-generic/include/odp/api/debug.h
> +++ b/platform/linux-generic/include/odp/api/debug.h
> @@ -17,7 +17,13 @@
>  extern "C" {
>  #endif
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/debug.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #if defined(__GNUC__) && !defined(__clang__)
>
> diff --git a/platform/linux-generic/include/odp/api/errno.h
> b/platform/linux-generic/include/odp/api/errno.h
> index f70d84d..a7a605f 100644
> --- a/platform/linux-generic/include/odp/api/errno.h
> +++ b/platform/linux-generic/include/odp/api/errno.h
> @@ -18,7 +18,13 @@ extern "C" {
>  #endif
>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/errno.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/event.h
> b/platform/linux-generic/include/odp/api/event.h
> index 55931b6..b4d9a62 100644
> --- a/platform/linux-generic/include/odp/api/event.h
> +++ b/platform/linux-generic/include/odp/api/event.h
> @@ -27,7 +27,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/event.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/hash.h
> b/platform/linux-generic/include/odp/api/hash.h
> index 332029e..ed1a0bb 100644
> --- a/platform/linux-generic/include/odp/api/hash.h
> +++ b/platform/linux-generic/include/odp/api/hash.h
> @@ -25,7 +25,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/hash.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/hints.h
> b/platform/linux-generic/include/odp/api/hints.h
> index 3ba1ba9..16b6efc 100644
> --- a/platform/linux-generic/include/odp/api/hints.h
> +++ b/platform/linux-generic/include/odp/api/hints.h
> @@ -25,7 +25,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/hints.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/init.h
> b/platform/linux-generic/include/odp/api/init.h
> index 1d9f59a..1a5b315 100644
> --- a/platform/linux-generic/include/odp/api/init.h
> +++ b/platform/linux-generic/include/odp/api/init.h
> @@ -27,7 +27,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/init.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/packet.h
> b/platform/linux-generic/include/odp/api/packet.h
> index ebbeaf1..d283ea2 100644
> --- a/platform/linux-generic/include/odp/api/packet.h
> +++ b/platform/linux-generic/include/odp/api/packet.h
> @@ -32,7 +32,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/packet.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/packet_flags.h
> b/platform/linux-generic/include/odp/api/packet_flags.h
> index 467f5b1..2afcca6 100644
> --- a/platform/linux-generic/include/odp/api/packet_flags.h
> +++ b/platform/linux-generic/include/odp/api/packet_flags.h
> @@ -25,7 +25,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/packet_flags.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/packet_io.h
> b/platform/linux-generic/include/odp/api/packet_io.h
> index 76c7dfe..45f0f34 100644
> --- a/platform/linux-generic/include/odp/api/packet_io.h
> +++ b/platform/linux-generic/include/odp/api/packet_io.h
> @@ -32,7 +32,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/packet_io.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/packet_io_stats.h
> b/platform/linux-generic/include/odp/api/packet_io_stats.h
> index a9cd953..b4711b4 100644
> --- a/platform/linux-generic/include/odp/api/packet_io_stats.h
> +++ b/platform/linux-generic/include/odp/api/packet_io_stats.h
> @@ -17,7 +17,13 @@
>  extern "C" {
>  #endif
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/packet_io_stats.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/pool.h
> b/platform/linux-generic/include/odp/api/pool.h
> index d712b65..bd462f0 100644
> --- a/platform/linux-generic/include/odp/api/pool.h
> +++ b/platform/linux-generic/include/odp/api/pool.h
> @@ -28,7 +28,13 @@ extern "C" {
>  #include <odp/api/plat/pool_types.h>
>  #include <odp/api/plat/shared_memory_types.h>
>  #include <odp/api/plat/event_types.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/pool.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/queue.h
> b/platform/linux-generic/include/odp/api/queue.h
> index a5cf873..6f3ead5 100644
> --- a/platform/linux-generic/include/odp/api/queue.h
> +++ b/platform/linux-generic/include/odp/api/queue.h
> @@ -31,7 +31,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/queue.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/random.h
> b/platform/linux-generic/include/odp/api/random.h
> index c8529b3..6e3e53a 100644
> --- a/platform/linux-generic/include/odp/api/random.h
> +++ b/platform/linux-generic/include/odp/api/random.h
> @@ -25,7 +25,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/random.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/rwlock.h
> b/platform/linux-generic/include/odp/api/rwlock.h
> index 4a86173..5d888f8 100644
> --- a/platform/linux-generic/include/odp/api/rwlock.h
> +++ b/platform/linux-generic/include/odp/api/rwlock.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/plat/rwlock_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/rwlock.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/rwlock_recursive.h
> b/platform/linux-generic/include/odp/api/rwlock_recursive.h
> index 4a08153..8ade102 100644
> --- a/platform/linux-generic/include/odp/api/rwlock_recursive.h
> +++ b/platform/linux-generic/include/odp/api/rwlock_recursive.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/plat/rwlock_recursive_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/rwlock_recursive.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/schedule.h
> b/platform/linux-generic/include/odp/api/schedule.h
> index 0026485..635f063 100644
> --- a/platform/linux-generic/include/odp/api/schedule.h
> +++ b/platform/linux-generic/include/odp/api/schedule.h
> @@ -27,7 +27,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/schedule.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/schedule_types.h
> b/platform/linux-generic/include/odp/api/schedule_types.h
> index 536007d..f3280a0 100644
> --- a/platform/linux-generic/include/odp/api/schedule_types.h
> +++ b/platform/linux-generic/include/odp/api/schedule_types.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/plat/schedule_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/schedule_types.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/shared_memory.h
> b/platform/linux-generic/include/odp/api/shared_memory.h
> index affc290..4c8ea45 100644
> --- a/platform/linux-generic/include/odp/api/shared_memory.h
> +++ b/platform/linux-generic/include/odp/api/shared_memory.h
> @@ -27,7 +27,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/shared_memory.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/spinlock.h
> b/platform/linux-generic/include/odp/api/spinlock.h
> index 830f4ed..5cdf15d 100644
> --- a/platform/linux-generic/include/odp/api/spinlock.h
> +++ b/platform/linux-generic/include/odp/api/spinlock.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/plat/spinlock_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/spinlock.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/spinlock_recursive.h
> b/platform/linux-generic/include/odp/api/spinlock_recursive.h
> index d97b017..ca95f26 100644
> --- a/platform/linux-generic/include/odp/api/spinlock_recursive.h
> +++ b/platform/linux-generic/include/odp/api/spinlock_recursive.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/plat/spinlock_recursive_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/spinlock_recursive.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/std_clib.h
> b/platform/linux-generic/include/odp/api/std_clib.h
> index 1578d09..82d537f 100644
> --- a/platform/linux-generic/include/odp/api/std_clib.h
> +++ b/platform/linux-generic/include/odp/api/std_clib.h
> @@ -11,7 +11,13 @@
>  extern "C" {
>  #endif
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/std_types.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  static inline void *odp_memcpy(void *dst, const void *src, size_t num)
>  {
> diff --git a/platform/linux-generic/include/odp/api/std_types.h
> b/platform/linux-generic/include/odp/api/std_types.h
> index 5737e43..a72025e 100644
> --- a/platform/linux-generic/include/odp/api/std_types.h
> +++ b/platform/linux-generic/include/odp/api/std_types.h
> @@ -37,7 +37,13 @@ typedef int odp_bool_t;
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/std_types.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/sync.h
> b/platform/linux-generic/include/odp/api/sync.h
> index 45fe6bd..b1e9a29 100644
> --- a/platform/linux-generic/include/odp/api/sync.h
> +++ b/platform/linux-generic/include/odp/api/sync.h
> @@ -40,7 +40,13 @@ static inline void odp_mb_full(void)
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/sync.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/system_info.h
> b/platform/linux-generic/include/odp/api/system_info.h
> index 36ddc81..2b09cbf 100644
> --- a/platform/linux-generic/include/odp/api/system_info.h
> +++ b/platform/linux-generic/include/odp/api/system_info.h
> @@ -20,7 +20,13 @@ extern "C" {
>  #include <odp/api/std_types.h>
>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/system_info.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/thread.h
> b/platform/linux-generic/include/odp/api/thread.h
> index c54abc8..006f3d8 100644
> --- a/platform/linux-generic/include/odp/api/thread.h
> +++ b/platform/linux-generic/include/odp/api/thread.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/plat/thread_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/thread.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/thrmask.h
> b/platform/linux-generic/include/odp/api/thrmask.h
> index b1c2077..cadb9bd 100644
> --- a/platform/linux-generic/include/odp/api/thrmask.h
> +++ b/platform/linux-generic/include/odp/api/thrmask.h
> @@ -27,7 +27,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/thrmask.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/ticketlock.h
> b/platform/linux-generic/include/odp/api/ticketlock.h
> index 85be4bc..d1d30f8 100644
> --- a/platform/linux-generic/include/odp/api/ticketlock.h
> +++ b/platform/linux-generic/include/odp/api/ticketlock.h
> @@ -19,7 +19,13 @@ extern "C" {
>
>  #include <odp/api/plat/ticketlock_types.h>
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/ticketlock.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/time.h
> b/platform/linux-generic/include/odp/api/time.h
> index 8d1c33e..4d935b2 100644
> --- a/platform/linux-generic/include/odp/api/time.h
> +++ b/platform/linux-generic/include/odp/api/time.h
> @@ -22,7 +22,13 @@ extern "C" {
>
>
>  #include <odp/api/plat/time_types.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/time.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/timer.h
> b/platform/linux-generic/include/odp/api/timer.h
> index 1450727..5c6791a 100644
> --- a/platform/linux-generic/include/odp/api/timer.h
> +++ b/platform/linux-generic/include/odp/api/timer.h
> @@ -31,7 +31,13 @@ extern "C" {
>   * @}
>   */
>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/timer.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/traffic_mngr.h
> b/platform/linux-generic/include/odp/api/traffic_mngr.h
> index 3e6f5fb..a81d39b 100644
> --- a/platform/linux-generic/include/odp/api/traffic_mngr.h
> +++ b/platform/linux-generic/include/odp/api/traffic_mngr.h
> @@ -26,7 +26,13 @@ extern "C" {
>   */
>
>  #include <odp/api/plat/traffic_mngr_types.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/traffic_mngr.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/include/odp/api/version.h
> b/platform/linux-generic/include/odp/api/version.h
> index fc4ea58..adcd8c3 100644
> --- a/platform/linux-generic/include/odp/api/version.h
> +++ b/platform/linux-generic/include/odp/api/version.h
> @@ -18,7 +18,13 @@ extern "C" {
>  #endif
>
>  #include <odp/api/plat/version_types.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility push(default)
> +#endif
>  #include <odp/api/spec/version.h>
> +#if __GNUC__ >= 4
> +#pragma GCC visibility pop
> +#endif
>
>  #ifdef __cplusplus
>  }
> 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