forked from bottlerocket-os/bottlerocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrust
More file actions
28 lines (22 loc) · 1.06 KB
/
rust
File metadata and controls
28 lines (22 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT
#
# Originally derived from https://github.com/amazonlinux/rust-bundled-packaging
# which is in turn derived from https://pagure.io/fedora-rust/rust2rpm
# Copyright (c) 2017 Igor Gnatenko
%__rustc %{_bindir}/rustc
%__rustdoc %{_bindir}/rustdoc
# Enable optimization, debuginfo, and link hardening.
%__global_rustflags -Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Clink-arg=-Wl,-z,relro,-z,now
# Enable dynamic linking.
%__global_rustflags_shared -Cprefer-dynamic %__global_rustflags
# Enable LTO and static C runtime.
%__global_rustflags_static -Clto=thin -Cembed-bitcode=yes -Ctarget-feature=+crt-static -Clink-arg=-lgcc %__global_rustflags
%__global_rustflags_shared_toml [%{lua:
for arg in string.gmatch(rpm.expand("%{__global_rustflags_shared}"), "%S+") do
print('"' .. arg .. '", ')
end}]
%__global_rustflags_static_toml [%{lua:
for arg in string.gmatch(rpm.expand("%{__global_rustflags_static}"), "%S+") do
print('"' .. arg .. '", ')
end}]