Meson doesn't link to Boost correctly on NetBSD
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
On NetBSD 8.0, Meson doesn't link executables to Boost correctly because it's not possible to execute them without a custom `LD_LIBRARY_PATH`:
```
$ echo $BOOST_ROOT
/usr/pkg
$ meson --version
0.48.1
$ ninja --version
1.8.2
$ g++ --version
g++ (nb2 20180327) 5.5.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ ld --version
GNU ld (NetBSD Binutils nb1) 2.27
Copyright (C) 2016 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ git clone https://github.com/nomis/dtee
$ cd dtee
$ meson --buildtype=release build/release/
$ ninja -C build/release/
$ ldd build/release/dtee
build/release/dtee:
-lboost_filesystem.1.67.0 => not found
-lboost_program_options.1.67.0 => not found
-lboost_system.1.67.0 => not found
-lstdc++.8 => /usr/lib/libstdc++.so.8
-lm.0 => /usr/lib/libm.so.0
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/lib/libgcc_s.so.1
$ LD_LIBRARY_PATH=/usr/pkg/lib ldd build/release/dtee
build/release/dtee:
-lboost_filesystem.1.67.0 => /usr/pkg/lib/libboost_filesystem.so.1.67.0
-lboost_system.1.67.0 => /usr/pkg/lib/libboost_system.so.1.67.0
-lstdc++.8 => /usr/lib/libstdc++.so.8
-lm.0 => /usr/lib/libm.so.0
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/lib/libgcc_s.so.1
-lpthread.1 => /usr/lib/libpthread.so.1
-lboost_program_options.1.67.0 => /usr/pkg/lib/libboost_program_options.so.1.67.0
```
Contributor guide
Research direction
Reproduce the reported build with Meson and Ninja on NetBSD 8.0 using the dtee example and the shown Boost environment. Start from Meson's Boost dependency and linker handling, then verify that the built executable resolves Boost libraries with ldd and runs without a custom LD_LIBRARY_PATH.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100