denzp / rustc-llvm-proxy Goto Github PK
View Code? Open in Web Editor NEWProxy LLVM calls into Rust own shared library in runtime
License: MIT License
Proxy LLVM calls into Rust own shared library in runtime
License: MIT License
I used this with Lubuntu OS and I got an error.
Unable to find LLVM shared lib in possible locations:
- /home/elipmoc/Ruscall/target/debug/build/backtrace-sys-8182ca9299c7255f/lib/rustlib/sys-8182ca9299c7255f/codegen-backends
- /home/elipmoc/Ruscall/target/debug/build/libloading-0b292a9395ce7c46/lib/rustlib/0b292a9395ce7c46/codegen-backends
- /home/elipmoc/Ruscall/target/lib/rustlib/codegen-backends
- /home/elipmoc/Ruscall/target/debug/lib/rustlib/codegen-backends
- /usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/rustlib/unknown-linux-gnu/codegen-backends
- /usr/local/lib/rustlib/codegen-backends
The actual LLVM path:
/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
For reference, it shows my folder hierarchy
elipmoc@elipmoc-VirtualBox:/usr/local/lib/rustlib$ tree
.
├── channel-manifest.toml
├── components
├── etc
│ ├── debugger_pretty_printers_common.py
│ ├── gdb_load_rust_pretty_printers.py
│ ├── gdb_rust_pretty_printing.py
│ └── lldb_rust_formatters.py
├── install.log
├── manifest-cargo
├── manifest-clippy-preview
├── manifest-llvm-tools-preview
├── manifest-rls-preview
├── manifest-rust-analysis-x86_64-unknown-linux-gnu
├── manifest-rustc
├── manifest-rust-docs
├── manifest-rustfmt-preview
├── manifest-rust-std-x86_64-unknown-linux-gnu
├── rust-installer-version
├── uninstall.sh
└── x86_64-unknown-linux-gnu
├── analysis
│ ├── liballoc-df62bb65f06c3fce.json
│ ├── liballoc_jemalloc-176ad923b373d249.json
│ ├── liballoc_system-b60481cd37bb2f9c.json
│ ├── libcompiler_builtins-413f819da6fb7434.json
│ ├── libcore-fc975690cfdac0c6.json
│ ├── liblibc-f6720b49dfa826ad.json
│ ├── libpanic_abort-1eae0a727d3c5cb1.json
│ ├── libpanic_unwind-0a9df30e23fb9934.json
│ ├── libprofiler_builtins-1d16405aa91e302c.json
│ ├── librustc_asan-128db398baa86153.json
│ ├── librustc_lsan-27591ed3ec7fea5c.json
│ ├── librustc_msan-b956233ae5bfe7d8.json
│ ├── librustc_tsan-5b32846900bc0a22.json
│ ├── libstd-6d0691438ced7d3f.json
│ ├── libstd_unicode-56ee5bd41c935122.json
│ └── libunwind-d396f179f24659b4.json
├── bin
│ ├── llvm-nm
│ ├── llvm-objcopy
│ ├── llvm-objdump
│ ├── llvm-profdata
│ ├── llvm-size
│ ├── llvm-strip
│ └── rust-lld
├── codegen-backends
│ ├── librustc_codegen_llvm-emscripten.so
│ └── librustc_codegen_llvm-llvm.so
└── lib
├── liballoc-df62bb65f06c3fce.rlib
├── liballoc_jemalloc-176ad923b373d249.rlib
├── liballoc_system-b60481cd37bb2f9c.rlib
├── libarena-37e4513629a65816.so
├── libarrayvec-4aec608b9651c775.rlib
├── libatty-95997ae7d263951b.rlib
├── libbacktrace-f55c8e893ad42790.rlib
├── libbacktrace_sys-4f84d8a581d755f5.rlib
├── libbitflags-c5845c939d519dea.rlib
├── libbyteorder-26d855aacc1735ac.rlib
├── libcfg_if-69bd3cd6bd7ab6db.rlib
├── libchalk_engine-87641b4125279989.rlib
├── libchalk_macros-cf6fe206cce1b0cb.rlib
├── libcompiler_builtins-413f819da6fb7434.rlib
├── libcore-fc975690cfdac0c6.rlib
├── libcrossbeam_deque-5501106451c4f087.rlib
├── libcrossbeam_epoch-272e7ded227b24aa.rlib
├── libcrossbeam_utils-6a273381cf09c454.rlib
├── libdatafrog-0aa76e12c0f7d2d5.rlib
├── libeither-da6b3763110233dc.rlib
├── libena-c543cf5d7580ecb1.rlib
├── libenv_logger-49e6d9ecf1d6e875.rlib
├── libflate2-f88cb88a4ddbc667.rlib
├── libfmt_macros-1b05448ce826d081.so
├── libgetopts-6d314263cbc7d0e0.rlib
├── libgraphviz-4da12b0390123c7e.so
├── libhumantime-994dcc7f5f1bd5e3.rlib
├── libjobserver-6de29164b3d22782.rlib
├── liblazy_static-8e4b130cabf8f273.rlib
├── liblazy_static-e6fbb9782bd5ce3d.rlib
├── liblibc-316acc22f272038a.rlib
├── liblibc-f6720b49dfa826ad.rlib
├── liblog-ee903c92533839a3.rlib
├── liblog_settings-a97d63813549e3d7.rlib
├── libmemoffset-5256a5c5255f1d5d.rlib
├── libminiz_sys-e356c9b3031c1817.rlib
├── libnodrop-5babeac2841cd346.rlib
├── libnum_cpus-77e496f30407cacb.rlib
├── libowning_ref-a908249218833273.rlib
├── libpanic_abort-1eae0a727d3c5cb1.rlib
├── libpanic_unwind-0a9df30e23fb9934.rlib
├── libparking_lot-4a2c03932d0a6567.rlib
├── libparking_lot_core-6224054f1ee932fc.rlib
├── libpolonius_engine-0b460d04bbdff8bd.rlib
├── libproc_macro-fdfc8f12e4e783bf.so
├── libprofiler_builtins-1d16405aa91e302c.rlib
├── libquick_error-869939da50d782d0.rlib
├── librand-997ca42934a05923.rlib
├── libremove_dir_all-9dd784d1d34fda7d.rlib
├── librls_data-13d769c93cff44dd.rlib
├── librls_span-50d77854f7862d38.rlib
├── librustc_allocator-ce468f44dab60006.so
├── librustc_apfloat-8d0839e82948c1c3.rlib
├── librustc_asan-128db398baa86153.rlib
├── librustc_borrowck-77e618a6eee69614.so
├── librustc_codegen_utils-e6411a23eb0aed82.so
├── librustc_cratesio_shim-f0aac30220444341.so
├── librustc_data_structures-be4dd52612e8ff5a.so
├── librustc_demangle-4aa9353779238df0.rlib
├── librustc_driver-329ba9d6c8478143.so
├── librustc_errors-e54ecf9f7f8b9ba4.so
├── librustc-f15f2a7202b21f1a.so
├── librustc_hash-e9028aabd5a23ea7.rlib
├── librustc_incremental-ad0b3542cffb2dc7.so
├── librustc_lint-f7f22a66c650c305.so
├── librustc_lsan-27591ed3ec7fea5c.rlib
├── librustc_metadata-78443f5b734a9c44.so
├── librustc_mir-91731b3ff6f28035.so
├── librustc_msan-b956233ae5bfe7d8.rlib
├── librustc_passes-bbdf4d08e4d62eca.so
├── librustc_platform_intrinsics-ede7b71e1d00cedd.so
├── librustc_plugin-2615312bad6a88e0.so
├── librustc_privacy-6d744c3dd5879069.so
├── librustc_rayon-cccb3520e0778309.rlib
├── librustc_rayon_core-e2cfb5d90c5b3ee4.rlib
├── librustc_resolve-fd7a5b39432acc6c.so
├── librustc_save_analysis-564eacbc1bec4f1a.so
├── librustc_serialize-089c4b93b74ee632.rlib
├── librustc_target-b37b26d7bc7cdf0c.so
├── librustc_traits-c4c762409aa2caca.so
├── librustc_tsan-5b32846900bc0a22.rlib
├── librustc_typeck-81b8e9516bc1b37d.so
├── libscoped_tls-42fd0a4700ff0a89.rlib
├── libscopeguard-a4e544e422440af9.rlib
├── libserialize-68814a49f3a265d0.rlib
├── libserialize-68814a49f3a265d0.so
├── libsmallvec-5ccb1f7a8878c918.rlib
├── libstable_deref_trait-614a3830e1649fdf.rlib
├── libstd-6d0691438ced7d3f.rlib
├── libstd-6d0691438ced7d3f.so
├── libstd_unicode-56ee5bd41c935122.rlib
├── libsyntax_ext-4c5ca7fc08f26533.so
├── libsyntax-fe019242fcaa3e69.so
├── libsyntax_pos-23c841c63327c946.so
├── libtempfile-c3441aea3deb695b.rlib
├── libterm-96ac2692d7b73542.rlib
├── libterm-96ac2692d7b73542.so
├── libtermcolor-5e1ccf5abcd632d1.rlib
├── libtest-a5189685df267426.rlib
├── libtest-a5189685df267426.so
├── libunicode_width-b049a810a0e80b4a.rlib
├── libunreachable-cb46f3bf74d5a7b8.rlib
├── libunwind-d396f179f24659b4.rlib
└── libvoid-45a8d14566a1ff0b.rlib
6 directories, 147 files
Hi, this crate is great for me :)
I met a link issue while testing a simple code generation example of LLVM:
https://github.com/termoshtt/rustc-llvm-proxy-example/blob/master/src/main.rs
/home/travis/build/termoshtt/rustc-llvm-proxy-example/src/main.rs:87: undefined reference to `LLVMVerifyModule'
/home/travis/build/termoshtt/rustc-llvm-proxy-example/src/main.rs:110: undefined reference to `LLVMLinkInInterpreter'
/home/travis/build/termoshtt/rustc-llvm-proxy-example/src/main.rs:111: undefined reference to `LLVMCreateInterpreterForModule'
/home/travis/build/termoshtt/rustc-llvm-proxy-example/src/main.rs:123: undefined reference to `LLVMRunFunction'
/home/travis/build/termoshtt/rustc-llvm-proxy-example/src/main.rs:130: undefined reference to `LLVMGenericValueToInt'
collect2: error: ld returned 1 exit status
https://travis-ci.org/termoshtt/rustc-llvm-proxy-example/jobs/429177101
rustc-llvm-proxy does links basic APIs e.g. LLVMCreateBuilder
, LLVMModuleCreateWithName
, and so on, but some APIs are lacked as listed above. I guess it missing to link libLLVMExecutionEngine.a and libLLVMAnalysis.a.
Is this intended behavior or bug?
Shared LLVM lib exports a very limited amount of symbols for the targets.
tests fail with: Unable to find symbol 'LLVMModuleCreateWithName' in the LLVM shared lib
ptx-linker fails with: Unable to find symbol 'LLVMContextCreate' in the LLVM shared lib
If that can't be fixed, we should at least provide a meaningful error message and a hint to use *-pc-windows-gnu
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.