You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AWS Lambda fails with `Runtime.InvalidEntrypoint` exception if the target does not match the selected platform, e.g. if deploying _x86_64_ to _arm64_ architecture.
105
+
106
+
See [Building a Custom Runtime Guide](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html) for more detailed explanations of the build and initialization process.
107
+
108
+
#### Cross-compilation
109
+
110
+
Cross-compilation for the target architecture requires the target toolchain to be installed. You may need additional configuration depending on your setup.
111
+
112
+
For example, to build for _arm64_ on _Ubuntu x86_64_ you need to install the target via _rustup_:
113
+
114
+
```bash
115
+
rustup target add aarch64-unknown-linux-gnu
116
+
rustup target add aarch64-unknown-linux-musl
117
+
```
118
+
119
+
and add linkers to _/.cargo/config.toml_ file:
120
+
121
+
```toml
122
+
[target.aarch64-unknown-linux-gnu]
123
+
linker = "aarch64-linux-gnu-gcc"
124
+
125
+
[target.aarch64-unknown-linux-musl]
126
+
linker = "aarch64-linux-gnu-gcc"
127
+
```
128
+
129
+
See [Cross-compilation](https://rust-lang.github.io/rustup/cross-compilation.html) and [Cargo target](https://doc.rust-lang.org/cargo/reference/config.html#target) documentation for more info.
130
+
131
+
132
+
### Using `cargo lambda` command
133
+
134
+
If you already have [Cargo Lambda](https://www.cargo-lambda.info) installed on your machine, run the next command to build your function:
For [a custom runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html), AWS Lambda looks for an executable called `bootstrap` in the deployment package zip. Rename the generated executable to `bootstrap` and add it to a zip archive.
101
-
158
+
Rename the generated executable to `bootstrap` and add it to a zip archive.
102
159
You can find the `bootstrap` binary for your function under the `target/lambda` directory.
0 commit comments