зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1486905 - add a HOST_LINKER variable for cross windows builds; r=dmajor
This setup seems to work well enough to enable me to link HOST_SIMPLE_PROGRAMS with an AArch64-cross setup. Necessary library paths are passed to the linker via -LIBPATH and HOST_LDFLAGS rather than letting MSVC fish them out of the environment. The change to HOST_SIMPLE_PROGRAMS to pass HOST_LDFLAGS was necessary for this to work, in addition to the HOST_LINKER changes.
This commit is contained in:
Родитель
d2583e1176
Коммит
684e72b2ab
|
@ -462,6 +462,9 @@ set_config('MSMANIFEST_TOOL', depends(valid_mt)(lambda x: bool(x)))
|
|||
link = check_prog('LINKER', ('lld-link.exe', 'link.exe'),
|
||||
paths=toolchain_search_path)
|
||||
|
||||
host_link = check_prog('HOST_LINKER', ('lld-link.exe', 'link.exe'),
|
||||
paths=toolchain_search_path)
|
||||
|
||||
add_old_configure_assignment('LINKER', link)
|
||||
|
||||
|
||||
|
|
|
@ -592,7 +592,7 @@ endif
|
|||
$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS) $(call mkdir_deps,$(DEPTH)/dist/host/bin)
|
||||
$(REPORT_BUILD)
|
||||
ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
|
||||
$(LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
$(HOST_LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
ifdef MSMANIFEST_TOOL
|
||||
@if test -f $@.manifest; then \
|
||||
if test -f '$(srcdir)/$(notdir $@).manifest'; then \
|
||||
|
@ -653,7 +653,7 @@ endif
|
|||
$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
|
||||
$(REPORT_BUILD)
|
||||
ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
|
||||
$(LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
$(HOST_LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
else
|
||||
ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
|
||||
$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXX_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
|
@ -690,8 +690,7 @@ $(HOST_SHARED_LIBRARY): $(HOST_OBJS) Makefile
|
|||
$(REPORT_BUILD)
|
||||
$(RM) $@
|
||||
ifdef _MSC_VER
|
||||
# /!\ We assume host and target are using the same compiler
|
||||
$(LINKER) -NOLOGO -DLL -OUT:$@ $(HOST_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
$(HOST_LINKER) -NOLOGO -DLL -OUT:$@ $(HOST_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
else
|
||||
$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче