Commit d66db33
committed
fix(mysql-connector-cpp): match the consumer's standard library, or say why not
CMake picks the system compiler here, so the static libs come out against
libstdc++ whatever the consumer uses. On the llvm leg, which links libc++,
the member fails at link with the libstdc++ half of its own dependency
undefined:
ld.lld: error: undefined symbol: std::_Rb_tree_increment(...)
ld.lld: error: undefined symbol:
std::__cxx11::basic_string<...>::_M_create(...)
`llamacpp` refuses a libc++ toolchain by name with `mcpp::cxx_stdlib()`,
and I said twice that the same lever was out of reach here because that is
a build-program API and this is an inline descriptor. That was half right.
The API is out of reach; the VARIABLE it reads is not necessarily —
MCPP_CXX_STDLIB is exported when mcpp runs a build program
(src/build/build_program.cppm), and whether it also reaches an xlings
install hook is documented nowhere.
So this asks instead of assuming, and records the answer either way:
* visible and `libc++` — build with `-stdlib=libc++`, on the compile and
both link flag sets. Compiling against libc++ headers while linking
libstdc++ produces the same undefined symbols one layer later, so the
flag has to reach all three.
* absent — nothing changes. The build is what it was, and the hook log
carries `MCPP_CXX_STDLIB=nil`, which is the missing half of the
diagnosis the next time that leg fails.
The failure has been read wrong once already in this area: `install()
result=nil` was taken for a cause when it was a successful install with no
return statement. A hook that reports what it saw is cheaper than a third
round of inference.1 parent 9ea3271 commit d66db33
1 file changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
267 | 302 | | |
268 | 303 | | |
269 | 304 | | |
| |||
0 commit comments