Skip to content

Commit 8d42802

Browse files
authored
Fix for older GCC < 8.1.0 (#520)
* Fix for older GCC * Fix CI cross test (x86_64-unknown-linux-gnu)
1 parent 5cb9cef commit 8d42802

File tree

4 files changed

+48
-6
lines changed

4 files changed

+48
-6
lines changed

.github/workflows/analysis.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ jobs:
241241
if: github.repository_owner == 'aws'
242242
name: Resolve the dependencies to the minimum SemVer version
243243
runs-on: ubuntu-latest
244+
strategy:
245+
matrix:
246+
crate: [ 'aws-lc-rs', 'aws-lc-sys', 'aws-lc-fips-sys' ]
244247
steps:
245248
- uses: actions/checkout@v3
246249
with:
@@ -253,10 +256,10 @@ jobs:
253256
- name: Set Rust toolchain override
254257
run: rustup override set ${{ steps.toolchain.outputs.name }}
255258
- name: Setup to use minimal versions
256-
working-directory: ./aws-lc-rs
259+
working-directory: ./${{ matrix.crate }}
257260
run: cargo update -Z minimal-versions
258261
- name: Build with minimal versions
259-
working-directory: ./aws-lc-rs
262+
working-directory: ./${{ matrix.crate }}
260263
run: cargo --locked check
261264

262265
copyright:

.github/workflows/cross.yml

+33
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,39 @@ jobs:
7070
- name: Cross-compilation (test release)
7171
run: cross test -p aws-lc-rs --release --features unstable --target ${{ matrix.target }}
7272

73+
74+
aws-lc-rs-cross-0_2_5-test:
75+
if: github.repository_owner == 'aws'
76+
name: cross tests ${{ matrix.target }}
77+
runs-on: ubuntu-latest
78+
env:
79+
CROSS_CONFIG: './Cross.toml.x86_64-unknown-linux-gnu'
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
target:
84+
- x86_64-unknown-linux-gnu
85+
steps:
86+
- uses: actions/checkout@v3
87+
with:
88+
submodules: 'recursive'
89+
- uses: dtolnay/rust-toolchain@master
90+
with:
91+
toolchain: 'stable'
92+
- name: Install cross
93+
run: cargo install cross --locked --version 0.2.5
94+
- uses: dtolnay/rust-toolchain@master
95+
id: toolchain
96+
with:
97+
toolchain: 'stable'
98+
target: ${{ matrix.target }}
99+
- name: Set Rust toolchain override
100+
run: rustup override set ${{ steps.toolchain.outputs.name }}
101+
- name: Cross-compilation (build debug)
102+
run: cross build -p aws-lc-rs --features unstable --target ${{ matrix.target }}
103+
- name: Cross-compilation (test release)
104+
run: cross test -p aws-lc-rs --release --features unstable --target ${{ matrix.target }}
105+
73106
aws-lc-rs-ios-aarch64:
74107
if: github.repository_owner == 'aws'
75108
name: iOS aarch64 cross-platform build

Cross.toml.x86_64-unknown-linux-gnu

Whitespace-only changes.

aws-lc-sys/builder/cc_builder.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,16 @@ impl CcBuilder {
125125
match opt_level.as_str() {
126126
"0" | "1" | "2" => {}
127127
_ => {
128-
cc_build.flag(format!(
129-
"-ffile-prefix-map={}=",
130-
self.manifest_dir.display()
131-
));
128+
let file_prefix_map_option =
129+
format!("-ffile-prefix-map={}=", self.manifest_dir.display());
130+
if let Ok(true) = cc_build.is_flag_supported(&file_prefix_map_option) {
131+
cc_build.flag(file_prefix_map_option);
132+
} else {
133+
cc_build.flag_if_supported(format!(
134+
"-fdebug-prefix-map={}=",
135+
self.manifest_dir.display()
136+
));
137+
}
132138
}
133139
}
134140

0 commit comments

Comments
 (0)