From patchwork Mon Apr 18 13:40:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 66027 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1296015qge; Mon, 18 Apr 2016 06:48:15 -0700 (PDT) X-Received: by 10.55.76.134 with SMTP id z128mr44249920qka.90.1460987295152; Mon, 18 Apr 2016 06:48:15 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a13si27997486qkj.107.2016.04.18.06.48.14; Mon, 18 Apr 2016 06:48:15 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 790B768905; Mon, 18 Apr 2016 13:48:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 416F261D86; Mon, 18 Apr 2016 13:48:05 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 52E3561904; Mon, 18 Apr 2016 13:48:02 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id 9A09461828 for ; Mon, 18 Apr 2016 13:47:59 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id e190so217423566lfe.0 for ; Mon, 18 Apr 2016 06:47:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/fngOvytfLH7HokIPWrWiqGl8H6hbBsQ6NVFPm/6MyY=; b=TAgaa5r7IrImt5TfOhRYclbe5YVTPZqvwTW90eJnhS93vG+kU7iis0zOEyvYAR8wTE icPKKWVDtgoIdIoNthUhf5L6qdmOMqo3zCF/BRN9Mi/eVNQpCalp4bhZRVIcB+XWfvo+ O2L/32FHzr9L8v1MCsfWO1z3i6SjeVB95aZXl0AIQoASZk93ECeSM+KPymEFZ3qcfjI4 HG42FAOA/FVEKksMQeq0ebAJkNKIXc+S8lkLIuZVAifGIk2vHjK5GlSUpjwqoExDTKpa 0RMuHR5idb6Nn4WSco6+e+Z3xQgedUnwr/B5ecnsa4mvifi2TgP5NhGQd3Pn7ia4yIaj /yug== X-Gm-Message-State: AOPr4FWoxcrIVEQZcWJEI3hOEeBCmsiqHjXxWTPbkGHUcvZqjWmniDUSS/+3vM73NTe2VEC+h88= X-Received: by 10.25.21.231 with SMTP id 100mr14512438lfv.146.1460987278432; Mon, 18 Apr 2016 06:47:58 -0700 (PDT) Received: from localhost (c-c82171d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.113.33.200]) by smtp.gmail.com with ESMTPSA id zi6sm10008807lbb.5.2016.04.18.06.47.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Apr 2016 06:47:57 -0700 (PDT) From: Anders Roxell To: petri.savolinen@nokia.com Date: Mon, 18 Apr 2016 15:40:03 +0200 Message-Id: <1460986803-32113-1-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API-NEXT PATCHv5] api: make only the API visible X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" 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 Signed-off-by: Anders Roxell --- 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 +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif #include #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 +#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 #include +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#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 +#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 +#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 +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 #include +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#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 +#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 +#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 +#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 +#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 +#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 +#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 +#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 +#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 +#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 #include #include +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#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 +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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 +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif #include +#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(