Description
This relates to #15460. On 1.47 stable and 1.48 nightly, when using cc/cbindgen, if a symbol in the C file is not used by the .rs file, then it is not in the resulting cdylib. It is possible to force the symbol to be included by "calling" it as show in #19321 .
The linked repository is able to reproduce this. Testing on OpenSUSE tumbleweed (fully patched with gcc10). After cargo build
then the resulting libdemo.so does not contain the symbol wrapper_add
.
This appears to be a regression since #15460 which was intended to resolve this behaviour. I appreciate your advice on this, thanks,
https://github.com/Firstyear/demo_r_link
EDIT: Worth noting in wrapper.c that it does not need to link to any R libs, and that SEXP is a typdef to typedef struct SEXPREC *SEXP;