Linking issues within a conda environment

Hello

I am trying to create Rust bindings for a C++ library within a conda environment, however, it seems to result in a linking issue I can't understand:

cargo run -p mypkg --example myexample
   Compiling autocfg v1.0.1
   Compiling unicode-xid v0.2.1
    ......
    ......
   Compiling nalgebra v0.22.0
   Compiling ncollide2d v0.25.0

error: linking with `/home/user/miniconda3/envs/myenv/bin/x86_64-conda-linux-gnu-cc` failed: exit code: 1
  |
  = note: "/home/user/miniconda3/envs/myenv/bin/x86_64-conda-linux-gnu-cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.106thowe5pxng6bd.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.10osal61cv3urfnw.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.11alrm6vu6e0ycoq.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.128ukyfiwa5s180c.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.138b0acp1sa8yc5z.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.14z8r94qsxu7wm5z.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.15elveezhgakw90o.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.18k3vjvxg0au9pas.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.19dy3810pt0bf5jv.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1bylv578rrlw81hc.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1e6p1ucna64z43b6.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1f24g0wahpy3kaoj.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1gk01lvw46zgdz0o.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1k31jp0jup621trl.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1r8ku4lq4q1ohx8m.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1sa3eqtf39gtr43l.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1snbdc1311dv2jqp.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1tzsm144so5hxvv5.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1uc9er62vwv4k5sk.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1wkxrx0ybx0vwllo.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1x32wch5d5zqudyd.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1x7vxf84ioz19l2p.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1z50vn611srhwv4e.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.26v5a6vmrxybusfv.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.27e55b5w1p8q7nl6.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.2cv1ud47f9c6do4h.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.2iqir4j4zgws7fke.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.2r0jphz8ri4d3oys.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.2ry6euyrc1mho0e2.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.2si85pqblv0n58jw.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.323tib8lhkqr35h4.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.326ibh5leeuutph0.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3389kjylpd88wvu7.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.33pwcwk1fsucuy4t.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.33w0phl59i6aaqjt.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.35zwu48gpj2a50lu.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.391axzichcvoc0i5.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.39bmiu6zllfujw0c.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3cyvlreoaaxpiacl.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3e149uh7xfacnbxr.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3e4tub704i0eosdw.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3g6fimevuldas2m5.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3hoaq6bqpymgcb3.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3hrfologus6cz3ll.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3kq9rvywcsuk3xty.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3p78dndd5qutn64n.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3pabd0qwb2vht3cg.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3qd3wvdaacpy55ie.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3qdic4w05fnckasd.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3rq8iapget7zgww0.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3su9qffoxf1qsksi.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3tllklg09sryh6wv.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3tw261ntze2yldwi.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.3uoxgregcl47k0dm.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.40skqzca3wywryuu.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.45ljtdlv2h8lgiqk.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.45rhoj7pmuieb7fr.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.4ao64c3eshmgexye.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.4g2i9ybi3oghmrx5.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.4gsdzuafr4797thd.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.4nzueoqetb85ystn.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.4og2eueddy3pzzi9.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.4vf78vgdiidg1g1b.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.4zsfkc8phpw3kujo.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.51ax4lnww4tkk88h.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.52sqxfbqi9k3hzad.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.54b5t9to8nqfl1zp.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.564wsub3mabund5i.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.56hvw2jr3457gzx0.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.5906lgghng0ki0vm.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.5d4bqovmkucxfw7e.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.5dv4lla4i08z28i0.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.9ramdgq4b9cjhfo.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.9yk4b8uv3sjzztf.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.afcoqx08mi8vgqn.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.bdanny5iaxmxuut.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.d3jxbdfdrtj24tv.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.d3lms6q6y15dg13.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.dt55w67lqbfmu1h.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.fgwnfbhrbuqhydi.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.qzx4gai7xg1chsb.rcgu.o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.sn70z1c3jkv2q33.rcgu.o" "-o" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4" "/home/user/git/depot/target/debug/examples/ping-13b1aeb3475da7d4.1htgedsh0cyetpcf.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/user/git/depot/target/debug/deps" "-L" "vendor/linux-amd64/lib" "-L" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/user/git/depot/target/debug/deps/libctrlc-e229a367be458a67.rlib" "/home/user/git/depot/target/debug/deps/libnix-dffc8e30c1503c31.rlib" "/home/user/git/depot/target/debug/deps/libvoid-df8e80fc215bab86.rlib" "/home/user/git/depot/target/debug/deps/libkpns_msgs-8c8e155b8da95472.rlib" "/home/user/git/depot/target/debug/deps/libkpns_common-53cd6597c3cd8473.rlib" "/home/user/git/depot/target/debug/deps/librmp_serde-77b13fdd8c6f9a93.rlib" "/home/user/git/depot/target/debug/deps/librmp-8cf38d7f8a8c64cd.rlib" "/home/user/git/depot/target/debug/deps/libbyteorder-bfa58b45c454d4e3.rlib" "/home/user/git/depot/target/debug/deps/libarrayvec-4306b514cb2ea6d6.rlib" "/home/user/git/depot/target/debug/deps/libprost_types-5bf76813518cddb5.rlib" "/home/user/git/depot/target/debug/deps/libsome-42b9714baac31011.rlib" "/home/user/git/depot/target/debug/deps/libprost-6be8d945b7f9e142.rlib" "/home/user/git/depot/target/debug/deps/libbytes-8b16b5f89d8ca3fe.rlib" "/home/user/git/depot/target/debug/deps/libthiserror-2671f862c28960f2.rlib" "/home/user/git/depot/target/debug/deps/libkutils-683fe79152cbf545.rlib" "/home/user/git/depot/target/debug/deps/libserde_json-69aa9fd28cd0a60e.rlib" "/home/user/git/depot/target/debug/deps/libryu-3f150dffae0a8f73.rlib" "/home/user/git/depot/target/debug/deps/libitoa-96a23920df448c78.rlib" "/home/user/git/depot/target/debug/deps/libenv_logger-bb8547e87a0d9a59.rlib" "/home/user/git/depot/target/debug/deps/libtermcolor-eaf9abd1c28c5f16.rlib" "/home/user/git/depot/target/debug/deps/libhumantime-83a8d710eb619720.rlib" "/home/user/git/depot/target/debug/deps/libquick_error-027494ab656d6c6f.rlib" "/home/user/git/depot/target/debug/deps/liblog-edbacd394a40d340.rlib" "/home/user/git/depot/target/debug/deps/libregex-818c9001a7df9eb5.rlib" "/home/user/git/depot/target/debug/deps/libthread_local-329152e554aaca50.rlib" "/home/user/git/depot/target/debug/deps/liblazy_static-adcdbda25352d993.rlib" "/home/user/git/depot/target/debug/deps/libregex_syntax-d37ef5e024ea9658.rlib" "/home/user/git/depot/target/debug/deps/libaho_corasick-39d24709df92682f.rlib" "/home/user/git/depot/target/debug/deps/libmemchr-ffda2fba216fbc71.rlib" "/home/user/git/depot/target/debug/deps/libclap-00e4218f39c84fb9.rlib" "/home/user/git/depot/target/debug/deps/libvec_map-3fa8fb7ddbeae8ab.rlib" "/home/user/git/depot/target/debug/deps/libtextwrap-1a0030a681f6ac5d.rlib" "/home/user/git/depot/target/debug/deps/libunicode_width-062e6b6ad4527baf.rlib" "/home/user/git/depot/target/debug/deps/libstrsim-c37e1feb7d72bc60.rlib" "/home/user/git/depot/target/debug/deps/libatty-585dc3284b6c2565.rlib" "/home/user/git/depot/target/debug/deps/libansi_term-2163f008cac3efee.rlib" "/home/user/git/depot/target/debug/deps/libncollide2d-5bff0d9d25e28cb4.rlib" "/home/user/git/depot/target/debug/deps/libslotmap-584451c93ef72a86.rlib" "/home/user/git/depot/target/debug/deps/libpetgraph-0d008d9b8cb1d8d2.rlib" "/home/user/git/depot/target/debug/deps/libindexmap-d7c224c9c5b979bd.rlib" "/home/user/git/depot/target/debug/deps/libhashbrown-26f762c3241ae26f.rlib" "/home/user/git/depot/target/debug/deps/libfixedbitset-7ff199b7c7029fc3.rlib" "/home/user/git/depot/target/debug/deps/libslab-022545b1909bd46c.rlib" "/home/user/git/depot/target/debug/deps/libbitflags-0cd415034ee648ca.rlib" "/home/user/git/depot/target/debug/deps/libdowncast_rs-6a6296ee7fbfc21d.rlib" "/home/user/git/depot/target/debug/deps/libnalgebra-5643b7227b0e7d15.rlib" "/home/user/git/depot/target/debug/deps/libnum_rational-106d468b3f4c92ac.rlib" "/home/user/git/depot/target/debug/deps/libnum_integer-d93ff8f29c4895d6.rlib" "/home/user/git/depot/target/debug/deps/libgeneric_array-5439eb38522c0877.rlib" "/home/user/git/depot/target/debug/deps/libtypenum-50a5864b187f3226.rlib" "/home/user/git/depot/target/debug/deps/libsimba-2d47bea68394f480.rlib" "/home/user/git/depot/target/debug/deps/libpaste-30bc42d6083df14b.rlib" "/home/user/git/depot/target/debug/deps/libnum_complex-bfa94e6380e82f66.rlib" "/home/user/git/depot/target/debug/deps/librand_distr-1f04748089033a80.rlib" "/home/user/git/depot/target/debug/deps/librand-5091225db49e7030.rlib" "/home/user/git/depot/target/debug/deps/librand_chacha-7f1b69182d22f40b.rlib" "/home/user/git/depot/target/debug/deps/libppv_lite86-473f9f1d6369ffd4.rlib" "/home/user/git/depot/target/debug/deps/librand_core-ab238cf7350c5418.rlib" "/home/user/git/depot/target/debug/deps/libgetrandom-5eca79d089463a6b.rlib" "/home/user/git/depot/target/debug/deps/liblibc-f1004ec3e7fcbe4f.rlib" "/home/user/git/depot/target/debug/deps/libcfg_if-748f21f0c8637ed0.rlib" "/home/user/git/depot/target/debug/deps/libmatrixmultiply-226afd46f033126b.rlib" "/home/user/git/depot/target/debug/deps/librawpointer-81c18c8496d7f409.rlib" "/home/user/git/depot/target/debug/deps/libapprox-637fd5d21a005813.rlib" "/home/user/git/depot/target/debug/deps/libnum_traits-8b68808afc73958f.rlib" "/home/user/git/depot/target/debug/deps/libserde-6f5cbb12199cfbbc.rlib" "/home/user/git/depot/target/debug/deps/libanyhow-69b760f3d76a5ae9.rlib" "-Wl,--start-group" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cf0f33af3a901778.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-daf8c2d692e6eca4.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-24e8f97647425e48.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-85ed7d2b484c05a9.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-89de2c581262ec09.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-3b0db98e62ed7d75.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-c60847f9a163de82.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-0bb9b63424f4fc5d.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-3f74d829e37fa40e.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-0e9d83ff06f1a7ad.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-2c8c904efaf7c40b.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-cbfb51de52131460.rlib" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-97497c26fddb7882.rlib" "-Wl,--end-group" "/home/user/miniconda3/envs/myenv/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f1a9d8c443e20b5e.rlib" "-Wl,-Bdynamic" "-lrt" "-ldl" "-lstdc++" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-lutil" "-Wl,-rpath,$ORIGIN/../lib" "-Wl,-rpath,$ORIGIN"
  = note: /home/user/miniconda3/envs/myenv/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/user/git/depot/target/debug/deps/libsome-42b9714baac31011.rlib(process.cpp.o): in function `Process::StartProcess(char const*, char const*, char const*, bool, Process_eStartMode, bool)':
          process.cpp:(.text+0x5a10): undefined reference to `__fdelt_chk'
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `mypkg`.

The error seems to indicate a missing function __fdelt_chk which was first introduced in glibc v2.4 (ancient) whereas I have glibc v2.35 in conda. The conda environment itself was just created with conda install -c conda-forge rust which also automatically sets the conda linker to be used by Rust with

CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/home/user/miniconda3/envs/myenv/bin/x86_64-conda-linux-gnu-cc

I am running Ubuntu 18.04 and can run the example in the package just fine outside of the conda environment, although that is done with glibc v2.27 (latest available in OS).

All of this leads me to believe that it is some issue with the linking of the bindings within the conda environment but I am not sure what exactly?