Skip to content

Commit 5c36a5f

Browse files
authored
Merge pull request #129 from martin-belanger/document-sanitize-address
Document meson build options
2 parents 1a995b2 + 0a3d6d8 commit 5c36a5f

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ rm -rf .build
140140

141141
A few build options can be specified on the command line when invoking meson.
142142

143-
| Option | Values [default] | Description |
144-
| ------- | ------------------- | ------------------------------------------------------------ |
143+
| Option | Values [default] | Description |
144+
| ------ | ------------------- | ------------------------------------------------------------ |
145+
| man | true, [false] | Instruct meson to configure the project to build the `libnvme` documentation. <br />Example: `meson .build -Dman=true` |
146+
| python | [auto], true, false | Whether to build the Python bindings. When set to `auto`, the default, meson will check for the presence of the tools and libraries (e.g. `swig`) required to build the Python bindings. If found, meson will configure the project to build the Python bindings. If a tool or library is missing, then the Python bindings won't be built. Setting this to `true`, forces the Python bindings to be built. When set to `false`, meson will configure the project to not build the Python bindings.<br />Example: `meson .build -Dpython=false` |
145147

146148
### Changing the build options from the command-line (i.e. w/o modifying any files)
147149

@@ -158,8 +160,15 @@ To enable address sanitizer (advanced debugging of memory issues):
158160
meson .build -Db_sanitize=address
159161
```
160162

163+
This option adds `-fsanitize=address` to the gcc options. Note that when using the sanitize feature, the library `libasan.so` must be available and must be the very first library loaded when running an executable. Ensuring that `libasan.so` gets loaded first can be achieved with the `LD_PRELOAD` environment variable as follows:
164+
165+
```
166+
meson .build -Db_sanitize=address && LD_PRELOAD=/lib64/libasan.so.6 ninja -C .build test
167+
```
168+
161169
To list configuration options that are available and possible values:
162170

163171
```bash
164172
meson configure .build
165173
```
174+

0 commit comments

Comments
 (0)