From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id B321CC8EA for ; Fri, 26 Jun 2015 14:53:56 +0200 (CEST) Received: by wicgi11 with SMTP id gi11so17126517wic.0 for ; Fri, 26 Jun 2015 05:53:56 -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:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=v51THwRRrfNvREvZeCG9qou52Ka/HMJZRJydeIbQCKY=; b=N+KnRbe6RhH3S5zaT1bUA9kyd2/mw1hDvTHMLRb/buZSD2AJfSjZBXakv5OYpA91F+ kPZnTJ50ewd9fNWokZDukA3yusL/J8wKB6DDSlU7rT7oGb+w/XxQU2WIcukLHdpjBit1 z/JjYjEXYJ6V4vZkiZvLDydplqvpJluJMsL1H/9J/GqDnk06HkOV1TNqR3SkdJXDPMmZ mZ1rVQNHV8kMXtUuyFqUiSottS6qCNgfMJwS2vnLsqYLjYQMijPGMjIj41eGh6ivuO6W 2PF5t+4fs/LlIo67cBtjh6Jl6F2q/5do0xwfNGXz0GgVtPRUjoqMMw6bgtLUVNnMGXPR /w1A== X-Gm-Message-State: ALoCoQmqk/liSVI4rTuRf4Xi48PrWb1/8BI4YrTXWxTdqsHzFPn5AJxmyjaR5FgPzNLOpj0xpPMK X-Received: by 10.180.84.194 with SMTP id b2mr4525882wiz.36.1435323236564; Fri, 26 Jun 2015 05:53:56 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id xa9sm45709804wjc.43.2015.06.26.05.53.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 05:53:55 -0700 (PDT) From: Thomas Monjalon To: Neil Horman Date: Fri, 26 Jun 2015 14:52:50 +0200 Message-ID: <3172025.YLFsvjgh6J@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1435242949-31520-2-git-send-email-nhorman@tuxdriver.com> References: <1435088014-18973-1-git-send-email-nhorman@tuxdriver.com> <1435242949-31520-1-git-send-email-nhorman@tuxdriver.com> <1435242949-31520-2-git-send-email-nhorman@tuxdriver.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCHv3 2/3] rte_compat: Add MAP_STATIC_SYMBOL macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2015 12:53:56 -0000 2015-06-25 10:35, Neil Horman: > +/* > + * MAP_STATIC_SYMBOL > + * If a function has been bifurcated into multiple versions, none of which > + * are defined as the exported symbol name in the map file, this macro can be > + * used to alias a specific version of the symbol to its exported name. For > + * example, if you have 2 versions of a function foo_v1 and foo_v2, where the > + * former is mapped to foo@DPDK_1 and the latter is mapped to foo@DPDK_2 when > + * building a shared library, this macro can be used to map either foo_v1 or > + * foo_v2 to the symbol foo when building a static library, e.g.: > + * MAP_STATIC_SYMBOL(void foo(), foo_v2); > + */ > +#define MAP_STATIC_SYMBOL(f, p) > + > #else > /* > * No symbol versioning in use > @@ -104,7 +105,7 @@ > #define __vsym > #define BASE_SYMBOL(b, n) > #define BIND_DEFAULT_SYMBOL(b, e, n) > - > +#define MAP_STATIC_SYMBOL(f, p) f __attribute__((alias( RTE_STR(p)))) Is it working with clang and icc? Why not just define foo as foo_v2? As this is the equivalent of BIND_DEFAULT_SYMBOL for the static case, it would be easier to mix them in only one macro.