diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..646db827 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,9 @@ +[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'] +rustflags = [ + "-C", "target-feature=+aes,+sse,+sse4.1,+sse4.2,+avx,+avx2,+prefetchwt1,+pclmul,+fma4,+fma,+bmi2,+bmi,+adx,+prefer-256-bit,+prefer-128-bit" +] + +[target.'cfg(target_arch = "aarch64")'] +rustflags = [ + "-C", "target-feature=+aes,+crypto,+neon", +] diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 892775bb..fe734548 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -46,7 +46,6 @@ jobs: runs-on: ${{ matrix.os }} env: BUILD_EXTRA_FEATURES: "openssl-vendored local-redir" - RUSTFLAGS: "-Ctarget-feature=+aes,+ssse3" strategy: matrix: # os: [ubuntu-latest, macos-latest] @@ -71,9 +70,8 @@ jobs: build-windows: runs-on: windows-latest env: - OPENSSL_STATIC: 1 + OPENSSL_STATIC: "1" OPENSSL_DIR: "C:\\Program Files\\OpenSSL-Win64\\" - RUSTFLAGS: "-Ctarget-feature=+aes,+ssse3" steps: - uses: actions/checkout@v2 diff --git a/build/Dockerfile.aarch64-unknown-linux-gnu b/build/Dockerfile.aarch64-unknown-linux-gnu index 24c52ca7..3f768ba6 100644 --- a/build/Dockerfile.aarch64-unknown-linux-gnu +++ b/build/Dockerfile.aarch64-unknown-linux-gnu @@ -1,3 +1,3 @@ FROM rustembedded/cross:aarch64-unknown-linux-gnu -ENV RUSTFLAGS="-Ctarget-feature=+aes,+neon" +# ENV RUSTFLAGS="-Ctarget-feature=+aes,+neon" diff --git a/build/Dockerfile.arm-unknown-linux-gnueabihf b/build/Dockerfile.arm-unknown-linux-gnueabihf index ceaf039d..3f582f10 100644 --- a/build/Dockerfile.arm-unknown-linux-gnueabihf +++ b/build/Dockerfile.arm-unknown-linux-gnueabihf @@ -1,3 +1,3 @@ FROM rustembedded/cross:arm-unknown-linux-gnueabihf -ENV RUSTFLAGS="-Ctarget-feature=+aes" +# ENV RUSTFLAGS="-Ctarget-feature=+aes" diff --git a/build/Dockerfile.mips-unknown-linux-musl b/build/Dockerfile.mips-unknown-linux-musl index 7de75250..4820574c 100644 --- a/build/Dockerfile.mips-unknown-linux-musl +++ b/build/Dockerfile.mips-unknown-linux-musl @@ -1,3 +1,3 @@ FROM rustembedded/cross:mips-unknown-linux-musl -ENV RUSTFLAGS="" +# ENV RUSTFLAGS="" diff --git a/build/Dockerfile.mipsel-unknown-linux-musl b/build/Dockerfile.mipsel-unknown-linux-musl index ab512ba1..2b712406 100644 --- a/build/Dockerfile.mipsel-unknown-linux-musl +++ b/build/Dockerfile.mipsel-unknown-linux-musl @@ -1,3 +1,3 @@ FROM rustembedded/cross:mipsel-unknown-linux-musl -ENV RUSTFLAGS="" +# ENV RUSTFLAGS="" diff --git a/build/Dockerfile.x86_64-pc-windows-gnu b/build/Dockerfile.x86_64-pc-windows-gnu index 502e7b08..8cbbfb68 100644 --- a/build/Dockerfile.x86_64-pc-windows-gnu +++ b/build/Dockerfile.x86_64-pc-windows-gnu @@ -19,5 +19,7 @@ RUN curl -LO https://download.libsodium.org/libsodium/releases/libsodium-$SODIUM V=1 make -j${nprocs} && make install && \ cd .. && rm -rf libsodium-$SODIUM_VERS.tar.gz libsodium-$SODIUM_VERS -ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3" \ - SODIUM_LIB_DIR=/usr/x86_64-w64-mingw32/lib +# ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3" \ +# SODIUM_LIB_DIR=/usr/x86_64-w64-mingw32/lib + +ENV SODIUM_LIB_DIR=/usr/x86_64-w64-mingw32/lib diff --git a/build/Dockerfile.x86_64-unknown-linux-gnu b/build/Dockerfile.x86_64-unknown-linux-gnu index a1bca71e..1c9cf41a 100644 --- a/build/Dockerfile.x86_64-unknown-linux-gnu +++ b/build/Dockerfile.x86_64-unknown-linux-gnu @@ -1,3 +1,3 @@ FROM rustembedded/cross:x86_64-unknown-linux-gnu -ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3" +# ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3" diff --git a/build/Dockerfile.x86_64-unknown-linux-musl b/build/Dockerfile.x86_64-unknown-linux-musl index e5f9768c..8e9b48dc 100644 --- a/build/Dockerfile.x86_64-unknown-linux-musl +++ b/build/Dockerfile.x86_64-unknown-linux-musl @@ -1,3 +1,3 @@ FROM rustembedded/cross:x86_64-unknown-linux-musl -ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3" +# ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3" diff --git a/build/build-host-release.ps1 b/build/build-host-release.ps1 index 61a20d60..4a3cd933 100644 --- a/build/build-host-release.ps1 +++ b/build/build-host-release.ps1 @@ -6,13 +6,13 @@ #> $ErrorActionPreference = "Stop" -$TargetTriple = (rustc -Vv | Select-String -Pattern "host: (.*)" | foreach {$_.Matches.Value}).split()[-1] +$TargetTriple = (rustc -Vv | Select-String -Pattern "host: (.*)" | ForEach-Object { $_.Matches.Value }).split()[-1] Write-Host "Started building release for ${TargetTriple} ..." cargo build --release --features "aes-pmac-siv openssl-vendored" -$Version = (Select-String -Pattern '^version *= *"([^"]*)"$' -Path "${PSScriptRoot}\..\Cargo.toml" | foreach {$_.Matches.Value}).split()[-1] +$Version = (Select-String -Pattern '^version *= *"([^"]*)"$' -Path "${PSScriptRoot}\..\Cargo.toml" | ForEach-Object { $_.Matches.Value }).split()[-1] $Version = $Version -replace '"' $PackageReleasePath = "${PSScriptRoot}\release" @@ -24,12 +24,12 @@ Write-Host $PackageReleasePath Write-Host $PackageName Write-Host $PackagePath -Pushd "${PSScriptRoot}\..\target\release" +Push-Location "${PSScriptRoot}\..\target\release" $ProgressPreference = "SilentlyContinue" New-Item "${PackageReleasePath}" -ItemType Directory -ErrorAction SilentlyContinue $CompressParam = @{ - LiteralPath = "sslocal.exe", "ssserver.exe", "ssurl.exe", "ssmanager.exe" + LiteralPath = "sslocal.exe", "ssserver.exe", "ssurl.exe", "ssmanager.exe" DestinationPath = "${PackagePath}" } Compress-Archive @CompressParam