Skip to content

Commit

Permalink
Fix i686 Linux build failures.
Browse files Browse the repository at this point in the history
mbedtls fails to build on 32-bit Linux without passing some compiler
options. We pass them through an environment variable, which is not the
best way to do it, but here we are.

Hopefully this will be able to be removed whenever mbedtls pushes a new
release; seems that this has been fixed upstream in merge
Mbed-TLS/mbedtls#8406.
  • Loading branch information
Cody Piersall committed Jan 15, 2024
1 parent 11b2881 commit 543bb6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ skip = "cp36-*"
# https:/johnnoone/pytest-curio/pull/7
test-skip = "cp312*"

build-verbosity = 1

[tool.cibuildwheel.windows]
# Windows builds fail because they try to use the same directory for different
# architectures, and that's no good.
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import os
from subprocess import check_call
import platform
import shutil
import sys

if platform.machine() == "i686" and platform.system() == "Linux":
# mbedtls v3.5.1 will not build without these flags on 32-bit linux.
# https:/Mbed-TLS/mbedtls/issues/8334
# this is hopefully going to be fixed in another release.
# There is probably a better way to do this...
os.environ["CFLAGS"] = "-mpclmul -msse2 -maes"
from setuptools import Command, setup, find_packages
from setuptools.command.build_ext import build_ext
from distutils.command.build import build as dbuild
Expand Down

0 comments on commit 543bb6b

Please sign in to comment.