{"id":24511072,"url":"https://github.com/libraries/rust_extern","last_synced_at":"2025-03-15T09:43:15.614Z","repository":{"id":91863328,"uuid":"219975896","full_name":"libraries/rust_extern","owner":"libraries","description":null,"archived":false,"fork":false,"pushed_at":"2019-11-14T06:23:39.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T00:38:26.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"LLVM","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libraries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-06T10:57:26.000Z","updated_at":"2019-11-14T06:23:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"e465f793-1c30-4e0b-94e6-ce6edd3d2f4a","html_url":"https://github.com/libraries/rust_extern","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libraries%2Frust_extern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libraries%2Frust_extern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libraries%2Frust_extern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libraries%2Frust_extern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libraries","download_url":"https://codeload.github.com/libraries/rust_extern/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713394,"owners_count":20335566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-22T00:36:14.111Z","updated_at":"2025-03-15T09:43:15.606Z","avatar_url":"https://github.com/libraries.png","language":"LLVM","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust 使用 C 函数/结构体\n\n```\n$ cd src\n$ clang draw.c -c -o libdraw.so\n$ clang main.c libdraw.so -o main\n$ ./main\n```\n\n```\n$ cd ..\n$ cargo clean\n$ RUSTFLAGS=\"-L /src/rust_extern/src\" cargo run\n\n# rustc main.rs -L . -o main\n```\n\n# Rust 使用 minits 函数/结构体\n\n```\n$ cd /src/minits\n$ ts-node src/index.ts build /src/rust_extern/src/draw.ts -o /src/rust_extern/src/draw.ll\n$ cd /src/rust_extern/src\n$ clang -c -shared -undefined dynamic_lookup draw.ll -o libdraw.so\n$ cd ..\n$ cargo clean\n$ RUSTFLAGS=\"-L /src/rust_extern/src\" cargo run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibraries%2Frust_extern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibraries%2Frust_extern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibraries%2Frust_extern/lists"}