Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/138071/?format=api
http://patches.dpdk.org/api/patches/138071/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240306221709.166722-2-paul.szczepanek@arm.com/", "project": { "id": 1, "url": "http://patches.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": "<20240306221709.166722-2-paul.szczepanek@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240306221709.166722-2-paul.szczepanek@arm.com", "date": "2024-03-06T22:17:09", "name": "[v1,1/1] lib: allow libraries with no sources", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d29cf605f392abcee56eb6c9ed615a7a02234bfd", "submitter": { "id": 3199, "url": "http://patches.dpdk.org/api/people/3199/?format=api", "name": "Paul Szczepanek", "email": "paul.szczepanek@arm.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240306221709.166722-2-paul.szczepanek@arm.com/mbox/", "series": [ { "id": 31408, "url": "http://patches.dpdk.org/api/series/31408/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31408", "date": "2024-03-06T22:17:08", "name": "allow libraries with no sources", "version": 1, "mbox": "http://patches.dpdk.org/series/31408/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/138071/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/138071/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5312743B6F;\n\tWed, 6 Mar 2024 23:17:23 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0C7E842ED4;\n\tWed, 6 Mar 2024 23:17:20 +0100 (CET)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id ADCF8402C0\n for <dev@dpdk.org>; Wed, 6 Mar 2024 23:17:17 +0100 (CET)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 91743C15;\n Wed, 6 Mar 2024 14:17:54 -0800 (PST)", "from ampere-altra-2-1.usa.Arm.com (ampere-altra-2-1.usa.arm.com\n [10.118.91.158])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1A8273F73F;\n Wed, 6 Mar 2024 14:17:17 -0800 (PST)" ], "From": "Paul Szczepanek <paul.szczepanek@arm.com>", "To": "thomas@monjalon.net", "Cc": "dev@dpdk.org, Paul Szczepanek <paul.szczepanek@arm.com>,\n Dhruv Tripathi <Dhruv.Tripathi@arm.com>", "Subject": "[PATCH v1 1/1] lib: allow libraries with no sources", "Date": "Wed, 6 Mar 2024 22:17:09 +0000", "Message-Id": "<20240306221709.166722-2-paul.szczepanek@arm.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20240306221709.166722-1-paul.szczepanek@arm.com>", "References": "<20240306221709.166722-1-paul.szczepanek@arm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Allow header only libraries.\n\nSigned-off-by: Paul Szczepanek <paul.szczepanek@arm.com>\nReviewed-by: Dhruv Tripathi <Dhruv.Tripathi@arm.com>\n\n---\n lib/meson.build | 176 +++++++++++++++++++++++++-----------------------\n 1 file changed, 91 insertions(+), 85 deletions(-)\n\n--\n2.25.1", "diff": "diff --git a/lib/meson.build b/lib/meson.build\nindex 4fb01f059b..0fcf3336d1 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -220,105 +220,111 @@ foreach l:libraries\n includes += include_directories(l)\n dpdk_includes += include_directories(l)\n\n- if developer_mode and is_windows and use_function_versioning\n- message('@0@: Function versioning is not supported by Windows.'.format(name))\n- endif\n+ if sources.length() != 0\n+ if developer_mode and is_windows and use_function_versioning\n+ message('@0@: Function versioning is not supported by Windows.'.format(name))\n+ endif\n\n- if use_function_versioning\n- cflags += '-DRTE_USE_FUNCTION_VERSIONING'\n- endif\n- cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=lib.' + l\n- if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')\n- cflags += '-DRTE_ANNOTATE_LOCKS'\n- cflags += '-Wthread-safety'\n- endif\n+ if use_function_versioning\n+ cflags += '-DRTE_USE_FUNCTION_VERSIONING'\n+ endif\n+ cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=lib.' + l\n+ if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')\n+ cflags += '-DRTE_ANNOTATE_LOCKS'\n+ cflags += '-Wthread-safety'\n+ endif\n\n- # first build static lib\n- static_lib = static_library(libname,\n- sources,\n- objects: objs,\n- c_args: cflags,\n- dependencies: static_deps,\n- include_directories: includes,\n- install: true)\n- static_dep = declare_dependency(\n- include_directories: includes,\n- dependencies: static_deps)\n+ # first build static lib\n+ static_lib = static_library(libname,\n+ sources,\n+ objects: objs,\n+ c_args: cflags,\n+ dependencies: static_deps,\n+ include_directories: includes,\n+ install: true)\n+ static_dep = declare_dependency(\n+ include_directories: includes,\n+ dependencies: static_deps)\n\n- if not use_function_versioning or is_windows\n- # use pre-build objects to build shared lib\n- sources = []\n- objs += static_lib.extract_all_objects(recursive: false)\n- else\n- # for compat we need to rebuild with\n- # RTE_BUILD_SHARED_LIB defined\n- cflags += '-DRTE_BUILD_SHARED_LIB'\n- endif\n+ if not use_function_versioning or is_windows\n+ # use pre-build objects to build shared lib\n+ sources = []\n+ objs += static_lib.extract_all_objects(recursive: false)\n+ else\n+ # for compat we need to rebuild with\n+ # RTE_BUILD_SHARED_LIB defined\n+ cflags += '-DRTE_BUILD_SHARED_LIB'\n+ endif\n\n- version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), l)\n- lk_deps = [version_map]\n+ version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), l)\n+ lk_deps = [version_map]\n\n- if is_ms_linker\n- def_file = custom_target(libname + '_def',\n- command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n- input: version_map,\n- output: '@0@_exports.def'.format(libname))\n- lk_deps += [def_file]\n+ if is_ms_linker\n+ def_file = custom_target(libname + '_def',\n+ command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n+ input: version_map,\n+ output: '@0@_exports.def'.format(libname))\n+ lk_deps += [def_file]\n\n- if is_ms_compiler\n- lk_args = ['/def:' + def_file.full_path()]\n- if meson.version().version_compare('<0.54.0')\n- lk_args += ['/implib:lib\\\\librte_' + l + '.dll.a']\n+ if is_ms_compiler\n+ lk_args = ['/def:' + def_file.full_path()]\n+ if meson.version().version_compare('<0.54.0')\n+ lk_args += ['/implib:lib\\\\librte_' + l + '.dll.a']\n+ endif\n+ else\n+ lk_args = ['-Wl,/def:' + def_file.full_path()]\n+ if meson.version().version_compare('<0.54.0')\n+ lk_args += ['-Wl,/implib:lib\\\\librte_' + l + '.dll.a']\n+ endif\n endif\n else\n- lk_args = ['-Wl,/def:' + def_file.full_path()]\n- if meson.version().version_compare('<0.54.0')\n- lk_args += ['-Wl,/implib:lib\\\\librte_' + l + '.dll.a']\n+ if is_windows\n+ mingw_map = custom_target(libname + '_mingw',\n+ command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n+ input: version_map,\n+ output: '@0@_mingw.map'.format(libname))\n+ lk_deps += [mingw_map]\n+\n+ lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]\n+ else\n+ lk_args = ['-Wl,--version-script=' + version_map]\n endif\n endif\n- else\n- if is_windows\n- mingw_map = custom_target(libname + '_mingw',\n- command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n- input: version_map,\n- output: '@0@_mingw.map'.format(libname))\n- lk_deps += [mingw_map]\n\n- lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]\n- else\n- lk_args = ['-Wl,--version-script=' + version_map]\n+ if developer_mode and not is_windows\n+ # on unix systems check the output of the\n+ # check-symbols.sh script, using it as a\n+ # dependency of the .so build\n+ lk_deps += custom_target(name + '.sym_chk',\n+ command: [check_symbols,\n+ version_map, '@INPUT@'],\n+ capture: true,\n+ input: static_lib,\n+ output: name + '.sym_chk')\n endif\n- endif\n-\n- if developer_mode and not is_windows\n- # on unix systems check the output of the\n- # check-symbols.sh script, using it as a\n- # dependency of the .so build\n- lk_deps += custom_target(name + '.sym_chk',\n- command: [check_symbols,\n- version_map, '@INPUT@'],\n- capture: true,\n- input: static_lib,\n- output: name + '.sym_chk')\n- endif\n\n- shared_lib = shared_library(libname,\n- sources,\n- objects: objs,\n- c_args: cflags,\n- dependencies: shared_deps,\n- include_directories: includes,\n- link_args: lk_args,\n- link_depends: lk_deps,\n- version: abi_version,\n- soversion: so_version,\n- install: true)\n- shared_dep = declare_dependency(link_with: shared_lib,\n- include_directories: includes,\n- dependencies: shared_deps)\n+ shared_lib = shared_library(libname,\n+ sources,\n+ objects: objs,\n+ c_args: cflags,\n+ dependencies: shared_deps,\n+ include_directories: includes,\n+ link_args: lk_args,\n+ link_depends: lk_deps,\n+ version: abi_version,\n+ soversion: so_version,\n+ install: true)\n+ shared_dep = declare_dependency(link_with: shared_lib,\n+ include_directories: includes,\n+ dependencies: shared_deps)\n\n- dpdk_libraries = [shared_lib] + dpdk_libraries\n- dpdk_static_libraries = [static_lib] + dpdk_static_libraries\n+ dpdk_libraries = [shared_lib] + dpdk_libraries\n+ dpdk_static_libraries = [static_lib] + dpdk_static_libraries\n+ else # sources.length() == 0\n+ # if no C files, just set a dependency on header path\n+ shared_dep = declare_dependency(include_directories: includes)\n+ static_dep = shared_dep\n+ endif\n\n set_variable('shared_rte_' + name, shared_dep)\n set_variable('static_rte_' + name, static_dep)\n", "prefixes": [ "v1", "1/1" ] }{ "id": 138071, "url": "