mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
Set RUSTFLAGS with project based config, fixed OPENSSL_STATIC
This commit is contained in:
9
.cargo/config.toml
Normal file
9
.cargo/config.toml
Normal file
@@ -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",
|
||||
]
|
||||
4
.github/workflows/build-release.yml
vendored
4
.github/workflows/build-release.yml
vendored
@@ -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
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM rustembedded/cross:aarch64-unknown-linux-gnu
|
||||
|
||||
ENV RUSTFLAGS="-Ctarget-feature=+aes,+neon"
|
||||
# ENV RUSTFLAGS="-Ctarget-feature=+aes,+neon"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM rustembedded/cross:arm-unknown-linux-gnueabihf
|
||||
|
||||
ENV RUSTFLAGS="-Ctarget-feature=+aes"
|
||||
# ENV RUSTFLAGS="-Ctarget-feature=+aes"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM rustembedded/cross:mips-unknown-linux-musl
|
||||
|
||||
ENV RUSTFLAGS=""
|
||||
# ENV RUSTFLAGS=""
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM rustembedded/cross:mipsel-unknown-linux-musl
|
||||
|
||||
ENV RUSTFLAGS=""
|
||||
# ENV RUSTFLAGS=""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM rustembedded/cross:x86_64-unknown-linux-gnu
|
||||
|
||||
ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3"
|
||||
# ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM rustembedded/cross:x86_64-unknown-linux-musl
|
||||
|
||||
ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3"
|
||||
# ENV RUSTFLAGS="-Ctarget-feature=+aes,+ssse3"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user