27 মার্চ, 2025 থেকে, আমরা AOSP তৈরি করতে এবং অবদান রাখতে aosp-main
এর পরিবর্তে android-latest-release
ব্যবহার করার পরামর্শ দিচ্ছি। আরও তথ্যের জন্য, AOSP-তে পরিবর্তনগুলি দেখুন।
বাইনারি মডিউল
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
rust_binary
মডিউল টাইপ ব্যবহার করে মরিচা বাইনারি তৈরি করা যেতে পারে; উদাহরণস্বরূপ:
rust_binary {
name: "hello_rust",
srcs: ["src/hello_rust.rs"],
}
একইভাবে, আপনি শুধুমাত্র হোস্ট মডিউল প্রদান করতে rust_binary_host
ব্যবহার করতে পারেন।
উল্লেখযোগ্য মরিচা_বাইনারি বৈশিষ্ট্য
গুরুত্বপূর্ণ সাধারণ বৈশিষ্ট্যগুলি ছাড়াও, নিম্নলিখিত বৈশিষ্ট্যগুলিও গুরুত্বপূর্ণ, অথবা rust_binary
মডিউল প্রকারের জন্য নির্দিষ্ট অনন্য আচরণ প্রদর্শন করে:
- static_executable : এই বাইনারিটিকে স্ট্যাটিক বাইনারি হিসাবে তৈরি করে এবং বোঝায়
prefer_rlib
true
। সম্পূর্ণরূপে স্ট্যাটিক এক্সিকিউটেবলগুলি শুধুমাত্র বায়োনিক লক্ষ্যগুলির জন্য উত্পাদিত হতে পারে। নন-বায়োনিক লক্ষ্যগুলির জন্য, এটি শুধুমাত্র prefer_rlib
true
বোঝায়, কিন্তু এটি এখনও libc
এবং libdl
গতিশীলভাবে লিঙ্ক করে। - prefer_rlib : ডিভাইস টার্গেটের জন্য ডিফল্টরূপে
rlib
লিঙ্কেজ নির্বাচন করতে rustlibs
লিঙ্কেজ পরিবর্তন করে এবং ডিভাইস টার্গেটে rlib
হিসাবে libstd
লিঙ্ক করে। মনে রাখবেন যে হোস্ট টার্গেটের জন্য এটি ডিফল্ট আচরণ, এবং তাদের উপর কোন প্রভাব নেই।
সংযোগ
ডিফল্টরূপে, rust_binary
মডিউলগুলি যেগুলিকে লক্ষ্য করে ডিভাইসগুলি সর্বদা libstd
সাথে গতিশীলভাবে লিঙ্ক করা হয় এবং prefer_rlib
true
না হলে ডিফল্টরূপে rustlibs
এ তালিকাভুক্ত নির্ভরতার জন্য dylib
লাইব্রেরি পছন্দ করবে। সম্পূর্ণরূপে স্ট্যাটিক বাইনারি প্রয়োজন হলে, static_executable
সম্পত্তি দেখুন।
হোস্ট মডিউলগুলি সর্বদা libstd
সাথে স্থিরভাবে সংযুক্ত থাকে এবং ডিফল্টরূপে rustlibs
এ তালিকাভুক্ত নির্ভরতার জন্য rlib
লাইব্রেরি পছন্দ করে।
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Binary modules\n\nRust binaries can be produced using the `rust_binary` module type; for example: \n\n rust_binary {\n name: \"hello_rust\",\n srcs: [\"src/hello_rust.rs\"],\n }\n\nSimilarly, you can use `rust_binary_host` to provide a host-only\nmodule.\n\nNotable rust_binary properties\n------------------------------\n\nIn addition to the [Important common properties](/docs/setup/build/rust/building-rust-modules/android-rust-modules#important-common-properties),\nthe following properties are also either important, or exhibit unique behavior\nspecific to the `rust_binary` module type:\n\n- **static_executable** : Builds this binary as a static binary, and implies `prefer_rlib` is `true`. Fully static executables can only be produced for bionic targets. For non-bionic targets, this implies only that `prefer_rlib` is `true`, but it still links `libc` and `libdl` dynamically.\n- **prefer_rlib** : Changes the `rustlibs` linkage to select the `rlib` linkage by default for device targets, and links `libstd` as an `rlib` on device targets. Note that this is the default behavior for host targets, and has no impact on them.\n\nLinkage\n-------\n\nBy default, `rust_binary` modules that are targeting devices are always linked\ndynamically against `libstd` and by default will prefer `dylib` libraries for\ndependencies listed in `rustlibs` unless `prefer_rlib` is `true`. If fully\nstatic binaries are required, see the `static_executable` property.\n\nHost modules are always linked statically against `libstd` and\nby default prefer `rlib` libraries for dependencies that are listed in\n`rustlibs`."]]