Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b6bcc3

Browse files
committed
- Issue #18096: Fix library order returned by python-config.
2 parents c383ad8 + d486c43 commit 6b6bcc3

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,8 @@ Build
10581058
- Issue #21166: Prevent possible segfaults and other random failures of
10591059
python --generate-posix-vars in pybuilddir.txt build target.
10601060

1061+
- Issue #18096: Fix library order returned by python-config.
1062+
10611063
C API
10621064
-----
10631065

Misc/python-config.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ for opt in opt_flags:
4747
print(' '.join(flags))
4848

4949
elif opt in ('--libs', '--ldflags'):
50-
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
51-
libs.append('-lpython' + pyver + sys.abiflags)
50+
libs = ['-lpython' + pyver + sys.abiflags]
51+
libs += getvar('LIBS').split()
52+
libs += getvar('SYSLIBS').split()
5253
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
5354
# shared library in prefix/lib/.
5455
if opt == '--ldflags':

Misc/python-config.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ LIBM="@LIBM@"
4040
LIBC="@LIBC@"
4141
SYSLIBS="$LIBM $LIBC"
4242
ABIFLAGS="@ABIFLAGS@"
43-
LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"
43+
LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
4444
BASECFLAGS="@BASECFLAGS@"
4545
LDLIBRARY="@LDLIBRARY@"
4646
LINKFORSHARED="@LINKFORSHARED@"

0 commit comments

Comments
 (0)