Skip to content

Commit

Permalink
try dropping windows 32-bit 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Mar 11, 2024
1 parent 05046f3 commit 9fb20af
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 39 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SPDX-License-Identifier: CC-BY-SA-4.0
- Standalone `curl` tool and `libcurl` DLL. Static libraries included.
- Required: Windows Vista with
[Universal CRT](https://support.microsoft.com/topic/update-for-universal-c-runtime-in-windows-322bf30f-4735-bb94-3949-49f5c49f4732)
(x64, ARM64 or x86), macOS 10.9 Mavericks (Intel or ARM),
(x64 or ARM64), macOS 10.9 Mavericks (Intel or ARM),
any Linux (amd64, arm64 or experimental RISC-V) with
[MUSL](https://en.wikipedia.org/wiki/Musl) builds.
- [HTTP/3](https://en.wikipedia.org/wiki/HTTP/3),
Expand Down
36 changes: 5 additions & 31 deletions _build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ set -o xtrace -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o p
# r64 build riscv64 target only [EXPERIMENTAL]
# a64 build arm64 target only
# x64 build x86_64 target only
# x86 build i686 target only (for win target)
# nounity build without CMake UNITY mode (slower builds for slightly smaller binaries)
# nocurltool do not build the curl tool (requires cmake)
# curldocs include curl Markdown manual pages in the package
Expand Down Expand Up @@ -124,16 +123,6 @@ set -o xtrace -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o p
# https://github.com/curl/curl-for-win/actions/runs/6868572571
# One last escape hatch is making custom wrappers around build tools and
# make libtool use them, then pass any necessary options via those wrappers.
# - win: Drop x86 builds.
# https://data.firefox.com/dashboard/hardware
# https://gs.statcounter.com/windows-version-market-share
# A hidden aspect of x86: The Chocolatey package manager installs x86
# binaries on ARM systems to run them in emulated mode. Windows as of ~2021
# got the ability to run x64 in emulated mode, but tooling support is
# missing, just like support for native ARM binaries:
# https://github.com/chocolatey/choco/issues/1803
# https://github.com/chocolatey/choco/issues/2172
# winget and scoop both support native ARM64.

# Resources:
# - https://clang.llvm.org/docs/Toolchain.html
Expand Down Expand Up @@ -569,11 +558,9 @@ build_single_target() {
fi

# GCC-specific machine selection option
[ "${_CPU}" = 'x86' ] && _OPTM='-m32'
[ "${_CPU}" = 'x64' ] && _OPTM='-m64'
[ "${_CPU}" = 'a64' ] && _OPTM='-marm64pe'

[ "${_CPU}" = 'x86' ] && _machine='i686'
[ "${_CPU}" = 'x64' ] && _machine='x86_64'
[ "${_CPU}" = 'a64' ] && _machine='aarch64'
[ "${_CPU}" = 'r64' ] && _machine='riscv64'
Expand All @@ -600,7 +587,6 @@ build_single_target() {
fi

if [ "${_OS}" = 'win' ]; then
[ "${_CPU}" = 'x86' ] && pkgcpu='win32'
[ "${_CPU}" = 'x64' ] && pkgcpu='win64'
[ "${_CPU}" = 'a64' ] && pkgcpu='win64a'
else
Expand All @@ -623,7 +609,6 @@ build_single_target() {
if [ "${_TOOLCHAIN}" = 'llvm-mingw' ]; then
PATH="${CW_LLVM_MINGW_PATH}/bin:${_ori_path}"
else
[ "${_CPU}" = 'x86' ] && _MSYSROOT='/mingw32'
[ "${_CPU}" = 'x64' ] && _MSYSROOT='/mingw64'
[ "${_CPU}" = 'a64' ] && _MSYSROOT='/clangarm64'

Expand Down Expand Up @@ -811,7 +796,6 @@ build_single_target() {
_CMAKE_GLOBAL="-DCMAKE_SYSTEM_NAME=Windows ${_CMAKE_GLOBAL}"
fi

[ "${_CPU}" = 'x86' ] && _RCFLAGS_GLOBAL+=' --target=pe-i386'
[ "${_CPU}" = 'x64' ] && _RCFLAGS_GLOBAL+=' --target=pe-x86-64'
[ "${_CPU}" = 'a64' ] && _RCFLAGS_GLOBAL+=" --target=${_TRIPLET}" # llvm-windres supports triplets here. https://github.com/llvm/llvm-project/blob/main/llvm/tools/llvm-rc/llvm-rc.cpp

Expand Down Expand Up @@ -889,7 +873,6 @@ build_single_target() {
# _CPPFLAGS_GLOBAL+=' -D_FORTIFY_SOURCE=3'

if [ "${_CPU}" = 'x64' ] || \
[ "${_CPU}" = 'x86' ] || \
[ "${_CC}" = 'gcc' ]; then
_CFLAGS_GLOBAL+=' -fstack-clash-protection'
_CXXFLAGS_GLOBAL+=' -fstack-clash-protection'
Expand All @@ -914,8 +897,7 @@ build_single_target() {

# https://fedoraproject.org/wiki/Security_Features_Matrix
# RISC-V: https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html
if [ "${_CPU}" = 'x64' ] || \
[ "${_CPU}" = 'x86' ]; then
if [ "${_CPU}" = 'x64' ]; then
# https://maskray.me/blog/2022-12-18-control-flow-integrity
_CFLAGS_GLOBAL+=' -fcf-protection=full'
_CXXFLAGS_GLOBAL+=' -fcf-protection=full'
Expand Down Expand Up @@ -1154,11 +1136,7 @@ build_single_target() {
if [ "${_OS}" = 'win' ]; then
_LDFLAGS_GLOBAL="${_OPTM} ${_LDFLAGS_GLOBAL}"
# https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-September/179242.html
if [ "${_CPU}" = 'x86' ]; then
_LDFLAGS_BIN_GLOBAL+=' -Wl,--pic-executable,-e,_mainCRTStartup'
else
_LDFLAGS_BIN_GLOBAL+=' -Wl,--pic-executable,-e,mainCRTStartup'
fi
_LDFLAGS_BIN_GLOBAL+=' -Wl,--pic-executable,-e,mainCRTStartup'
_CFLAGS_GLOBAL="${_OPTM} ${_CFLAGS_GLOBAL}"
fi

Expand Down Expand Up @@ -1230,8 +1208,7 @@ build_single_target() {
# for boringssl
export _STRIP_BINUTILS=''
if [ "${_OS}" = 'win' ] && [ "${_CC}" = 'llvm' ]; then
if [ "${_CPU}" = 'x64' ] || \
[ "${_CPU}" = 'x86' ]; then
if [ "${_CPU}" = 'x64' ]; then
# Make sure to pick the prefixed binutils strip tool from an unmodified
# PATH. This avoids picking the llvm-mingw copy using the same name.
tmp="${_CCPREFIX}strip"
Expand Down Expand Up @@ -1700,15 +1677,12 @@ EOF

# Build binaries
if [ "${_OS}" = 'win' ]; then
if [[ "${_CONFIG}" = *'x64'* || ! "${_CONFIG}" =~ (a64|x86) ]]; then
if [[ "${_CONFIG}" = *'x64'* || "${_CONFIG}" != *'a64'* ]]; then
build_single_target x64
fi
if [[ "${_CONFIG}" = *'a64'* || ! "${_CONFIG}" =~ (x64|x86) ]]; then
if [[ "${_CONFIG}" = *'a64'* || "${_CONFIG}" != *'x64'* ]]; then
build_single_target a64
fi
if [[ "${_CONFIG}" = *'x86'* || ! "${_CONFIG}" =~ (x64|a64) ]]; then
build_single_target x86
fi
elif [ "${_OS}" = 'mac' ]; then
# TODO: This method is suboptimal. We might want to build pure C
# projects in dual mode and only manual-merge libs that have
Expand Down
4 changes: 2 additions & 2 deletions _ci-win-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ set -o xtrace -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o p
pacman --noconfirm --ask 20 --noprogressbar --sync --refresh --sysupgrade --sysupgrade
pacman --noconfirm --ask 20 --noprogressbar --sync --refresh --sysupgrade --sysupgrade
pacman --noconfirm --ask 20 --noprogressbar --sync --needed \
mingw-w64-{x86_64,i686}-{clang,cmake,jq,python-pefile,rsync,gettext,osslsigncode} \
mingw-w64-x86_64-{clang,cmake,jq,python-pefile,rsync,gettext,osslsigncode} \
zip

[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && \
pacman --noconfirm --ask 20 --noprogressbar --sync --needed \
mingw-w64-{x86_64,i686}-{go,nasm}
mingw-w64-x86_64-{go,nasm}

./_build.sh
5 changes: 2 additions & 3 deletions boringssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ _VER="$1"
LIBS='-lpthread' # for tests
options=''

[ "${_CPU}" = 'x86' ] && cpu='x86'
[ "${_CPU}" = 'x64' ] && cpu='x86_64'
[ "${_CPU}" = 'a64' ] && cpu='ARM64'
[ "${_CPU}" = 'r64' ] && exit 1 # No support as of 2023-10

if [ "${_OS}" = 'win' ] && [ "${_CPU}" != 'a64' ]; then
# nasm is used for Windows x64 and x86
# nasm is used for Windows x64
options+=' -DCMAKE_ASM_NASM_FLAGS=--reproducible'
fi

Expand Down Expand Up @@ -105,7 +104,7 @@ _VER="$1"
# - fails to clear timestamps in NASM objects.
# (fixed by --reproducible with nasm v2.15.05)
# Work around them by running it through binutils strip. This works for
# x64 and x86, but not for ARM64.
# x64, but not for ARM64.
#
# Most combinations/orders running binutils/llvm strip over the output results
# in different output, and except pure llvm-strip, all seem to be
Expand Down
3 changes: 1 addition & 2 deletions openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ _VER="$1"
options=''

if [ "${_OS}" = 'win' ]; then
[ "${_CPU}" = 'x86' ] && options+=' mingw'
[ "${_CPU}" = 'x64' ] && options+=' mingw64'
if [ "${_CPU}" = 'a64' ]; then
# Sources:
Expand Down Expand Up @@ -65,7 +64,7 @@ _VER="$1"
if [ "${_OS}" = 'win' ]; then
options+=' -DUSE_BCRYPTGENRANDOM -lbcrypt'
fi
[ "${_CPU}" = 'x86' ] || options+=' enable-ec_nistp_64_gcc_128'
options+=' enable-ec_nistp_64_gcc_128'

if false; then
if [ -n "${_ZLIB}" ] && [ -d "../${_ZLIB}/${_PP}" ]; then
Expand Down

0 comments on commit 9fb20af

Please sign in to comment.