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>
Thu, 2 Dec 2021 20:45:55 +0000 (20:45 +0000)
commite93a04b638b838778b981141c02fd571f806b8ed
tree1c36e9764102bb5e0bb38f8108c60dd50c6c2d91
parent03b8cdf2e0d2e0ab0c0ffc6f99fe7eb32b040e23
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