Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,19 @@ jobs:
run: |
CC=musl-gcc scripts/build.sh musl

build-musl-minimal-static:
name: musl libc minimal static build on Debian
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh minimal_static

build-alpine:
name: musl libc build on Alpine
runs-on: ubuntu-latest
Expand Down
20 changes: 11 additions & 9 deletions libnvme/examples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ executable(
],
)

executable(
'discover-loop',
['discover-loop.c'],
dependencies: [
config_dep,
ccan_dep,
libnvme_dep,
],
)
if want_fabrics
executable(
'discover-loop',
['discover-loop.c'],
dependencies: [
config_dep,
ccan_dep,
libnvme_dep,
],
)
endif

executable(
'mi-mctp',
Expand Down
4 changes: 2 additions & 2 deletions libnvme/libnvme/nvme.i
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
Py_XDECREF(val); /* .. therefore decrement ref. count. */
}
PyObject *hostnqn_from_file() {
char * val = nvmf_hostnqn_from_file();
char * val = nvme_hostnqn_from_file();
PyObject * obj = PyUnicode_FromString(val);
free(val);
return obj;
}
PyObject *hostid_from_file() {
char * val = nvmf_hostid_from_file();
char * val = nvme_hostid_from_file();
PyObject * obj = PyUnicode_FromString(val);
free(val);
return obj;
Expand Down
3 changes: 1 addition & 2 deletions libnvme/src/libnvme.h → libnvme/src/libnvme.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ extern "C" {
#endif

#include <nvme/cmds.h>
#include <nvme/fabrics.h>
@FABRICS_INCLUDE@
#include <nvme/filters.h>
#include <nvme/ioctl.h>
#include <nvme/lib-types.h>
#include <nvme/lib.h>
#include <nvme/linux.h>
#include <nvme/nbft.h>
#include <nvme/tree.h>
#include <nvme/types.h>
#include <nvme/util.h>
Expand Down
78 changes: 6 additions & 72 deletions libnvme/src/libnvme.ld
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
LIBNVME_UNRELEASED {
};

LIBNVME_2_0 {
LIBNVME_3 {
global:
nvme_clear_etdas;
nvme_close;
Expand Down Expand Up @@ -108,6 +106,11 @@ LIBNVME_2_0 {
nvme_host_set_dhchap_key;
nvme_host_set_hostsymname;
nvme_host_set_pdc_enabled;
nvme_hostid_from_file;
nvme_hostid_generate;
nvme_hostnqn_from_file;
nvme_hostnqn_generate;
nvme_hostnqn_generate_from_hostid;
nvme_import_tls_key;
nvme_import_tls_key_versioned;
nvme_init_copy_range;
Expand Down Expand Up @@ -267,75 +270,6 @@ LIBNVME_2_0 {
nvme_uuid_from_string;
nvme_uuid_random;
nvme_uuid_to_string;
nvmf_add_ctrl;
nvmf_adrfam_str;
nvmf_cms_str;
nvmf_config_modify;
nvmf_connect;
nvmf_connect_config_json;
nvmf_connect_ctrl;
nvmf_context_create;
nvmf_context_set_connection;
nvmf_context_set_crypto;
nvmf_context_set_device;
nvmf_context_set_discovery_cbs;
nvmf_context_set_discovery_defaults;
nvmf_context_set_fabrics_config;
nvmf_context_set_hostnqn;
nvmf_context_set_persistent;
nvmf_default_config;
nvmf_discovery;
nvmf_discovery_config_file;
nvmf_discovery_config_json;
nvmf_discovery_ctx_already_connected_set;
nvmf_discovery_ctx_connected_set;
nvmf_discovery_ctx_create;
nvmf_discovery_ctx_ctrlkey_set;
nvmf_discovery_ctx_decide_retry_set;
nvmf_discovery_ctx_default_fabrics_config_set;
nvmf_discovery_ctx_device_set;
nvmf_discovery_ctx_discovery_log_set;
nvmf_discovery_ctx_host_iface_set;
nvmf_discovery_ctx_host_traddr_set;
nvmf_discovery_ctx_hostid_set;
nvmf_discovery_ctx_hostkey_set;
nvmf_discovery_ctx_hostnqn_set;
nvmf_discovery_ctx_keep_alive_timeout;
nvmf_discovery_ctx_keyring_set;
nvmf_discovery_ctx_max_retries;
nvmf_discovery_ctx_parser_cleanup_set;
nvmf_discovery_ctx_parser_init_set;
nvmf_discovery_ctx_parser_next_line_set;
nvmf_discovery_ctx_persistent_set;
nvmf_discovery_ctx_subsysnqn_set;
nvmf_discovery_ctx_tls_key_identity_set;
nvmf_discovery_ctx_tls_key_set;
nvmf_discovery_ctx_traddr_set;
nvmf_discovery_ctx_transport_set;
nvmf_discovery_ctx_trsvcid_set;
nvmf_discovery_nbft;
nvmf_eflags_str;
nvmf_exat_ptr_next;
nvmf_free_uri;
nvmf_get_default_trsvcid;
nvmf_get_discovery_log;
nvmf_get_discovery_wargs;
nvmf_hostid_from_file;
nvmf_hostid_generate;
nvmf_hostnqn_from_file;
nvmf_hostnqn_generate;
nvmf_hostnqn_generate_from_hostid;
nvmf_is_registration_supported;
nvmf_nbft_free;
nvmf_nbft_read_files;
nvmf_prtype_str;
nvmf_qptype_str;
nvmf_register_ctrl;
nvmf_sectype_str;
nvmf_subtype_str;
nvmf_treq_str;
nvmf_trtype_str;
nvmf_update_config;
local:
*;
};
71 changes: 71 additions & 0 deletions libnvme/src/libnvmf.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

LIBNVMF_3 {
global:
nvmf_add_ctrl;
nvmf_adrfam_str;
nvmf_cms_str;
nvmf_config_modify;
nvmf_connect;
nvmf_connect_config_json;
nvmf_connect_ctrl;
nvmf_context_create;
nvmf_context_set_connection;
nvmf_context_set_crypto;
nvmf_context_set_device;
nvmf_context_set_discovery_cbs;
nvmf_context_set_discovery_defaults;
nvmf_context_set_fabrics_config;
nvmf_context_set_hostnqn;
nvmf_context_set_persistent;
nvmf_default_config;
nvmf_discovery;
nvmf_discovery_config_file;
nvmf_discovery_config_json;
nvmf_discovery_ctx_already_connected_set;
nvmf_discovery_ctx_connected_set;
nvmf_discovery_ctx_create;
nvmf_discovery_ctx_ctrlkey_set;
nvmf_discovery_ctx_decide_retry_set;
nvmf_discovery_ctx_default_fabrics_config_set;
nvmf_discovery_ctx_device_set;
nvmf_discovery_ctx_discovery_log_set;
nvmf_discovery_ctx_host_iface_set;
nvmf_discovery_ctx_host_traddr_set;
nvmf_discovery_ctx_hostid_set;
nvmf_discovery_ctx_hostkey_set;
nvmf_discovery_ctx_hostnqn_set;
nvmf_discovery_ctx_keep_alive_timeout;
nvmf_discovery_ctx_keyring_set;
nvmf_discovery_ctx_max_retries;
nvmf_discovery_ctx_parser_cleanup_set;
nvmf_discovery_ctx_parser_init_set;
nvmf_discovery_ctx_parser_next_line_set;
nvmf_discovery_ctx_persistent_set;
nvmf_discovery_ctx_subsysnqn_set;
nvmf_discovery_ctx_tls_key_identity_set;
nvmf_discovery_ctx_tls_key_set;
nvmf_discovery_ctx_traddr_set;
nvmf_discovery_ctx_transport_set;
nvmf_discovery_ctx_trsvcid_set;
nvmf_discovery_nbft;
nvmf_eflags_str;
nvmf_exat_ptr_next;
nvmf_free_uri;
nvmf_get_default_trsvcid;
nvmf_get_discovery_log;
nvmf_get_discovery_wargs;
nvmf_is_registration_supported;
nvmf_nbft_free;
nvmf_nbft_read_files;
nvmf_prtype_str;
nvmf_qptype_str;
nvmf_register_ctrl;
nvmf_sectype_str;
nvmf_subtype_str;
nvmf_treq_str;
nvmf_trtype_str;
nvmf_update_config;
local:
*;
};
73 changes: 50 additions & 23 deletions libnvme/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,41 @@ sources = [
'nvme/base64.c',
'nvme/cmds.c',
'nvme/crc32.c',
'nvme/fabrics.c',
'nvme/filters.c',
'nvme/ioctl.c',
'nvme/lib.c',
'nvme/linux.c',
'nvme/log.c',
'nvme/mi-mctp.c',
'nvme/mi.c',
'nvme/nbft.c',
'nvme/sysfs.c',
'nvme/tree.c',
'nvme/util.c',
]
headers = [
'nvme/accessors.h',
'nvme/cmds.h',
'nvme/filters.h',
'nvme/ioctl.h',
'nvme/lib-types.h',
'nvme/lib.h',
'nvme/linux.h',
'nvme/mi.h',
'nvme/tree.h',
'nvme/types.h',
'nvme/util.h',
]

if want_fabrics
sources += [
'nvme/fabrics.c',
'nvme/nbft.c',
]
headers += [
'nvme/fabrics.h',
'nvme/nbft.h',
]
endif

if json_c_dep.found()
sources += 'nvme/json.c'
Expand All @@ -42,16 +64,36 @@ deps = [
openssl_dep,
]

ldfile = 'libnvme.ld'
nvme_ld = meson.current_source_dir() / 'libnvme.ld'
nvmf_ld = meson.current_source_dir() / 'libnvmf.ld'

link_args = [
'-Wl,--version-script=@0@'.format(nvme_ld),
'-Wl,--version-script=@0@'.format(accessors_ld_full_path),
]

libconf = configuration_data()
if want_fabrics
link_args += '-Wl,--version-script=@0@'.format(nvmf_ld)
libconf.set('FABRICS_INCLUDE',
'#include <nvme/fabrics.h>\n#include <nvme/nbft.h>')
else
libconf.set('FABRICS_INCLUDE', '')
endif

libnvme_header = configure_file(
input: 'libnvme.h.in',
output: 'libnvme.h',
configuration: libconf,
install: true,
install_dir: prefixdir / get_option('includedir')
)

libnvme = library(
'nvme', # produces libnvme.so
sources,
version: libnvme_so_version,
link_args: [
'-Wl,--version-script=@0@'.format(meson.current_source_dir() / ldfile),
'-Wl,--version-script=@0@'.format(accessors_ld_full_path),
],
link_args: link_args,
dependencies: deps,
install: true,
)
Expand Down Expand Up @@ -90,27 +132,12 @@ libnvme_test_dep = declare_dependency(
mode = 'rw-r--r--'
install_headers(
[
'libnvme.h',
'libnvme-mi.h',
],
install_mode: mode,
)
install_headers(
[
'nvme/accessors.h',
'nvme/cmds.h',
'nvme/fabrics.h',
'nvme/filters.h',
'nvme/ioctl.h',
'nvme/lib-types.h',
'nvme/lib.h',
'nvme/linux.h',
'nvme/mi.h',
'nvme/nbft.h',
'nvme/tree.h',
'nvme/types.h',
'nvme/util.h',
],
headers,
subdir: 'nvme',
install_mode: mode,
)
Loading