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>
Mon, 13 Sep 2021 09:51:21 +0000 (11:51 +0200)
commitfb3de7ea64b45e8b22548a5b49a24c0dc623b2ea
tree9f7d50b7d77f954de721302ff71b86b3f1fb68b4
parent58abf1f223cb8e0c33d402ad507c33b19f8759f3
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.
tools/pygrub/Makefile
tools/python/Makefile