tools/python: Pass linker to Python build process
authorElliott Mitchell <ehem+xen@m5p.com>
Mon, 12 Oct 2020 01:11:39 +0000 (18:11 -0700)
committerHans van Kranenburg <hans@knorrie.org>
Wed, 13 Jul 2022 14:28:39 +0000 (15:28 +0100)
commit4bbf434262e95da8e751841ffffb59fec8d15a96
tree72b9bf8e5e6ddd8a59f2e4ddad6d751bdb1656ec
parentd6d1de07169b534f1e663bd4dc42eb165162fece
tools/python: Pass linker to Python build process

Unexpectedly the environment variable which needs to be passed is
$LDSHARED and not $LD.  Otherwise Python may find the build `ld` instead
of the host `ld`.

Replace $(LDFLAGS) with $(SHLIB_LDFLAGS) as Python needs shared objects
it can load at runtime, not executables.

This uses $(CC) instead of $(LD) since Python distutils appends $CFLAGS
to $LDFLAGS which breaks many linkers.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
(cherry picked from commit 17d192e0238d6c714e9f04593b59597b7090be38)

[ Hans van Kranenburg ]
Fixed cherry-pick conflict because we have LIBEXEC_LIB=$(LIBEXEC_LIB) in
between in the same lines. The line wrap mess makes it a bit hard to
follow.

Gbp-Pq: Name 0028-tools-python-Pass-linker-to-Python-build-process.patch
tools/pygrub/Makefile
tools/python/Makefile