get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/60632/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 60632,
    "url": "http://patchwork.dpdk.org/api/patches/60632/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20191007154550.46655-3-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20191007154550.46655-3-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191007154550.46655-3-bruce.richardson@intel.com",
    "date": "2019-10-07T15:45:50",
    "name": "[v3,2/2] build: support building ABI versioned files twice",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a1d4dd9c084482da3d8480a1478845c3e279f163",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20191007154550.46655-3-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 6726,
            "url": "http://patchwork.dpdk.org/api/series/6726/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=6726",
            "date": "2019-10-07T15:45:48",
            "name": "Improve function versioning meson support",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/6726/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/60632/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/60632/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A677E1C027;\n\tMon,  7 Oct 2019 17:46:18 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 8EFAE1C1C3\n\tfor <dev@dpdk.org>; Mon,  7 Oct 2019 17:46:14 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Oct 2019 08:46:14 -0700",
            "from silpixa00399126.ir.intel.com (HELO\n\tsilpixa00399126.ger.corp.intel.com) ([10.237.223.2])\n\tby orsmga005.jf.intel.com with ESMTP; 07 Oct 2019 08:46:12 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.67,268,1566889200\"; d=\"scan'208\";a=\"368152574\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Andrzej Ostruszka <amo@semihalf.com>, Neil Horman <nhorman@tuxdriver.com>,\n\tbluca@debian.org, thomas@monjalon.net,\n\tBruce Richardson <bruce.richardson@intel.com>",
        "Date": "Mon,  7 Oct 2019 16:45:50 +0100",
        "Message-Id": "<20191007154550.46655-3-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20191007154550.46655-1-bruce.richardson@intel.com>",
        "References": "<20190927194932.22197-1-bruce.richardson@intel.com>\n\t<20191007154550.46655-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/2] build: support building ABI versioned\n\tfiles twice",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Any file with ABI versioned functions needs different macros for shared and\nstatic builds, so we need to accomodate that. Rather than building\neverything twice, we just flag to the build system which libraries need\nthat handling, by setting use_function_versioning in the meson.build files.\n\nTo ensure we don't get silent errors at build time due to this meson flag\nbeing missed, we add an explicit error to the function versioning header\nfile if a known C macro is not defined. Since \"make\" builds always only\nbuild one of shared or static libraries, this define can be always set, and\nso is added to the global CFLAGS. For meson, the build flag - and therefore\nthe C define - is set for the three libraries that need the function\nversioning: \"distributor\", \"lpm\" and \"timer\".\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nTested-by: Andrzej Ostruszka <amo@semihalf.com>\n\n---\nv3: move define from common_base to generic/rte.vars.mk\n---\n config/rte_config.h                              |  3 ---\n doc/guides/contributing/coding_style.rst         |  7 +++++++\n lib/librte_distributor/meson.build               |  1 +\n .../common/include/rte_function_versioning.h     |  4 ++++\n lib/librte_lpm/meson.build                       |  1 +\n lib/librte_timer/meson.build                     |  1 +\n lib/meson.build                                  | 16 +++++++++++++---\n mk/target/generic/rte.vars.mk                    |  8 ++++++++\n 8 files changed, 35 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/config/rte_config.h b/config/rte_config.h\nindex 0bbbe274f..b63a2fdea 100644\n--- a/config/rte_config.h\n+++ b/config/rte_config.h\n@@ -31,9 +31,6 @@\n \n /****** library defines ********/\n \n-/* compat defines */\n-#define RTE_BUILD_SHARED_LIB\n-\n /* EAL defines */\n #define RTE_MAX_HEAPS 32\n #define RTE_MAX_MEMSEG_LISTS 128\ndiff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst\nindex 449b33494..e95a1a2be 100644\n--- a/doc/guides/contributing/coding_style.rst\n+++ b/doc/guides/contributing/coding_style.rst\n@@ -948,6 +948,13 @@ reason\n \tbuilt. For missing dependencies this should be of the form\n \t``'missing dependency, \"libname\"'``.\n \n+use_function_versioning\n+\t**Default Value = false**.\n+\tSpecifies if the library in question has ABI versioned functions. If it\n+\thas, this value should be set to ensure that the C files are compiled\n+\ttwice with suitable parameters for each of shared or static library\n+\tbuilds.\n+\n version\n \t**Default Value = 1**.\n \tSpecifies the ABI version of the library, and is used as the major\ndiff --git a/lib/librte_distributor/meson.build b/lib/librte_distributor/meson.build\nindex dba7e3b2a..5149f9bf5 100644\n--- a/lib/librte_distributor/meson.build\n+++ b/lib/librte_distributor/meson.build\n@@ -9,3 +9,4 @@ else\n endif\n headers = files('rte_distributor.h')\n deps += ['mbuf']\n+use_function_versioning = true\ndiff --git a/lib/librte_eal/common/include/rte_function_versioning.h b/lib/librte_eal/common/include/rte_function_versioning.h\nindex ce963d4b1..55e88ffae 100644\n--- a/lib/librte_eal/common/include/rte_function_versioning.h\n+++ b/lib/librte_eal/common/include/rte_function_versioning.h\n@@ -7,6 +7,10 @@\n #define _RTE_FUNCTION_VERSIONING_H_\n #include <rte_common.h>\n \n+#ifndef RTE_USE_FUNCTION_VERSIONING\n+#error Use of function versioning disabled, is \"use_function_versioning=true\" in meson.build?\n+#endif\n+\n #ifdef RTE_BUILD_SHARED_LIB\n \n /*\ndiff --git a/lib/librte_lpm/meson.build b/lib/librte_lpm/meson.build\nindex a5176d8ae..4e3920660 100644\n--- a/lib/librte_lpm/meson.build\n+++ b/lib/librte_lpm/meson.build\n@@ -8,3 +8,4 @@ headers = files('rte_lpm.h', 'rte_lpm6.h')\n # without worrying about which architecture we actually need\n headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h')\n deps += ['hash']\n+use_function_versioning = true\ndiff --git a/lib/librte_timer/meson.build b/lib/librte_timer/meson.build\nindex d3b828ce9..b7edfe2e7 100644\n--- a/lib/librte_timer/meson.build\n+++ b/lib/librte_timer/meson.build\n@@ -4,3 +4,4 @@\n sources = files('rte_timer.c')\n headers = files('rte_timer.h')\n allow_experimental_apis = true\n+use_function_versioning = true\ndiff --git a/lib/meson.build b/lib/meson.build\nindex e5ff83893..1b0ed767c 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -47,6 +47,7 @@ foreach l:libraries\n \tname = l\n \tversion = 1\n \tallow_experimental_apis = false\n+\tuse_function_versioning = false\n \tsources = []\n \theaders = []\n \tincludes = []\n@@ -96,6 +97,9 @@ foreach l:libraries\n \t\t\tif allow_experimental_apis\n \t\t\t\tcflags += '-DALLOW_EXPERIMENTAL_API'\n \t\t\tendif\n+\t\t\tif use_function_versioning\n+\t\t\t\tcflags += '-DRTE_USE_FUNCTION_VERSIONING'\n+\t\t\tendif\n \n \t\t\tif get_option('per_library_versions')\n \t\t\t\tlib_version = '@0@.1'.format(version)\n@@ -117,9 +121,15 @@ foreach l:libraries\n \t\t\t\t\tinclude_directories: includes,\n \t\t\t\t\tdependencies: static_deps)\n \n-\t\t\t# then use pre-build objects to build shared lib\n-\t\t\tsources = []\n-\t\t\tobjs += static_lib.extract_all_objects(recursive: false)\n+\t\t\tif not use_function_versioning\n+\t\t\t\t# use pre-build objects to build shared lib\n+\t\t\t\tsources = []\n+\t\t\t\tobjs += static_lib.extract_all_objects(recursive: false)\n+\t\t\telse\n+\t\t\t\t# for compat we need to rebuild with\n+\t\t\t\t# RTE_BUILD_SHARED_LIB defined\n+\t\t\t\tcflags += '-DRTE_BUILD_SHARED_LIB'\n+\t\t\tendif\n \t\t\tversion_map = '@0@/@1@/rte_@2@_version.map'.format(\n \t\t\t\t\tmeson.current_source_dir(), dir_name, name)\n \t\t\timplib = dir_name + '.dll.a'\ndiff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk\nindex 5f00a0bfa..374722173 100644\n--- a/mk/target/generic/rte.vars.mk\n+++ b/mk/target/generic/rte.vars.mk\n@@ -90,6 +90,14 @@ ASFLAGS += $(TARGET_ASFLAGS)\n CFLAGS += -I$(RTE_OUTPUT)/include\n LDFLAGS += -L$(RTE_OUTPUT)/lib\n \n+# add in flag for supporting function versioning. The define is used in meson\n+# builds to ensure that the user has properly flagged the unit in question as\n+# using function versioning so it can be built twice - once for static lib and\n+# then a second time for the shared lib. Since make only builds one library\n+# type at a time, such precautions aren't necessary, so we can globally define\n+# the flag\n+CFLAGS += -DRTE_USE_FUNCTION_VERSIONING\n+\n # always include rte_config.h: the one in $(RTE_OUTPUT)/include is\n # the configuration of SDK when $(BUILDING_RTE_SDK) is true, or the\n # configuration of the application if $(BUILDING_RTE_SDK) is not\n",
    "prefixes": [
        "v3",
        "2/2"
    ]
}