Skip to content

Commit 241b96c

Browse files
Merge pull request #61 from mideind/fix/cpp-linkage-gxx-personality
Fix undefined symbol __gxx_personality_v0 on Linux CPython builds
2 parents 812c014 + 7725052 commit 241b96c

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "reynir"
7-
version = "3.6.1"
7+
version = "3.6.2"
88
description = "A natural language parser for Icelandic"
99
authors = [{ name = "Miðeind ehf.", email = "mideind@mideind.is" }]
1010
maintainers = [{ name = "Miðeind ehf.", email = "mideind@mideind.is" }]
@@ -40,7 +40,7 @@ requires-python = ">=3.9"
4040
dependencies = [
4141
"cffi>=1.17.1",
4242
"tokenizer>=3.6.0",
43-
"islenska>=1.0.4",
43+
"islenska>=1.3.2",
4444
"typing_extensions",
4545
]
4646

src/reynir/eparser_build.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,14 @@
135135
extra_compile_args = ["-std=c++11"]
136136

137137
# On some systems, the linker needs to be told to use the C++ compiler
138-
# under PyPy due to changes in the default behaviour of distutils.
138+
# due to changes in the default behaviour of distutils/setuptools, which
139+
# otherwise link the C++ extension with the C driver and omit libstdc++,
140+
# causing an "undefined symbol: __gxx_personality_v0" ImportError at runtime.
139141
if IMPLEMENTATION == "PyPy":
140142
os.environ["LDCXXSHARED"] = "c++ -shared"
143+
elif not WINDOWS and not MACOS:
144+
os.environ.setdefault("LDSHARED", "c++ -shared")
145+
os.environ.setdefault("LDCXXSHARED", "c++ -shared")
141146

142147
# Use the Python stable ABI (abi3) for CPython, allowing a single wheel
143148
# to work across multiple Python versions (3.9+). PyPy doesn't support abi3.

0 commit comments

Comments
 (0)