mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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>
This commit is contained in:
1 parent
40fe714ca4
commit
17d192e023
2 files changed
+10
-8
No files matched your search
@@ -5,19 +5,20 @@ include $(XEN_ROOT)/tools/Rules.mk
|
||||
all: build
|
||||
|
||||
PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS)
|
||||
PY_LDFLAGS = $(LDFLAGS) $(APPEND_LDFLAGS)
|
||||
PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
|
||||
INSTALL_LOG = build/installed_files.txt
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
|
||||
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
|
||||
|
||||
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
|
||||
setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
|
||||
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" \
|
||||
LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py install \
|
||||
--record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
|
||||
--root="$(DESTDIR)" --force
|
||||
|
||||
$(INSTALL_PYTHON_PROG) scripts/convert-legacy-stream $(DESTDIR)$(LIBEXEC_BIN)
|
||||
|
||||