]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36508: python-config don't export LINKFORSHARED (GH-12661) (GH-12748)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 16 Apr 2019 13:01:33 +0000 (06:01 -0700)
committerVictor Stinner <vstinner@redhat.com>
Tue, 16 Apr 2019 13:01:33 +0000 (15:01 +0200)
python-config --ldflags no longer includes flags of the LINKFORSHARED
variable. The LINKFORSHARED variable must only be used to build
executables.
(cherry picked from commit e65f01f78d7bda3013fc5be485afa87ff56511d9)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Makefile.pre.in
Misc/NEWS.d/next/Build/2019-04-02-17-01-23.bpo-36508.SN5Y6N.rst [new file with mode: 0644]
Misc/python-config.in
Misc/python-config.sh.in

index 2d2e11f172096ecbf76bee7741d7fad1b3633c63..babe4e0416818b23923bb87110dd446afb1d6a8e 100644 (file)
@@ -106,6 +106,8 @@ NO_AS_NEEDED=       @NO_AS_NEEDED@
 LDLAST=                @LDLAST@
 SGI_ABI=       @SGI_ABI@
 CCSHARED=      @CCSHARED@
+# LINKFORSHARED are the flags passed to the $(CC) command that links
+# the python executable -- this is only needed for a few systems
 LINKFORSHARED= @LINKFORSHARED@
 ARFLAGS=       @ARFLAGS@
 # Extra C flags added for building the interpreter object files.
diff --git a/Misc/NEWS.d/next/Build/2019-04-02-17-01-23.bpo-36508.SN5Y6N.rst b/Misc/NEWS.d/next/Build/2019-04-02-17-01-23.bpo-36508.SN5Y6N.rst
new file mode 100644 (file)
index 0000000..62f8084
--- /dev/null
@@ -0,0 +1,3 @@
+``python-config --ldflags`` no longer includes flags of the
+``LINKFORSHARED`` variable. The ``LINKFORSHARED`` variable must only be used
+to build executables.
index e13da7543c9ffb9c8fba9c60610e3e365e5c480a..714415222798d65e925134c628d6013344557cb5 100644 (file)
@@ -55,8 +55,6 @@ for opt in opt_flags:
         if opt == '--ldflags':
             if not getvar('Py_ENABLE_SHARED'):
                 libs.insert(0, '-L' + getvar('LIBPL'))
-            if not getvar('PYTHONFRAMEWORK'):
-                libs.extend(getvar('LINKFORSHARED').split())
         print(' '.join(libs))
 
     elif opt == '--extension-suffix':
index d1d3275fa2758d90963c4c85c9dd5ab95f7a16bc..a3c479ce571f87b1307b58b34bf1b99b465304ef 100644 (file)
@@ -44,7 +44,6 @@ ABIFLAGS="@ABIFLAGS@"
 LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
 BASECFLAGS="@BASECFLAGS@"
 LDLIBRARY="@LDLIBRARY@"
-LINKFORSHARED="@LINKFORSHARED@"
 OPT="@OPT@"
 PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
 LDVERSION="@LDVERSION@"
@@ -89,15 +88,11 @@ do
             echo "$LIBS"
         ;;
         --ldflags)
-            LINKFORSHAREDUSED=
-            if [ -z "$PYTHONFRAMEWORK" ] ; then
-                LINKFORSHAREDUSED=$LINKFORSHARED
-            fi
             LIBPLUSED=
             if [ "$PY_ENABLE_SHARED" = "0" ] ; then
                 LIBPLUSED="-L$LIBPL"
             fi
-            echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
+            echo "$LIBPLUSED -L$libdir $LIBS"
         ;;
         --extension-suffix)
             echo "$SO"