Skip to content

Commit 580b4d7

Browse files
committed
unix: deduplicate MODOBJS
We have duplicate objects courtesy of math.c being defined multiple times. This can result in duplicate symbols if attempting to link a shared library.
1 parent fef0d3b commit 580b4d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cpython-unix/build-cpython.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ patch -p1 << "EOF"
3636
diff --git a/Modules/makesetup b/Modules/makesetup
3737
--- a/Modules/makesetup
3838
+++ b/Modules/makesetup
39-
@@ -241,16 +241,6 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
39+
@@ -241,18 +241,11 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
4040
case $doconfig in
4141
yes) OBJS="$OBJS $objs";;
4242
esac
@@ -52,7 +52,12 @@ diff --git a/Modules/makesetup b/Modules/makesetup
5252
- done
5353
done
5454
55+
+ # Deduplicate OBJS.
56+
+ OBJS=$(echo $OBJS | tr ' ' '\n' | sort -u | xargs)
57+
+
5558
case $SHAREDMODS in
59+
'') ;;
60+
*) DEFS="SHAREDMODS=$SHAREDMODS$NL$DEFS";;
5661
EOF
5762

5863
# Code that runs at ctypes module import time does not work with

0 commit comments

Comments
 (0)