Bug 1610986 - invoke lucetc with custom LD and LDFLAGS; r=firefox-build-system-reviewers,rstewart

`lucetc` by default will invoke `ld` directly, which is usually not what
we want, particularly when cross-compiling.  Instead, let's invoke the
compiler, which will do the hard work of determining the correct linker
to use, and we'll also explicitly specify `LDFLAGS`, since the default
`LDFLAGS` from `lucetc` assume you're invoking the linker directly.

Depends on D62797

Differential Revision: https://phabricator.services.mozilla.com/D62798

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nathan Froyd 2020-02-13 21:19:56 +00:00
parent 3f2d9684cb
commit b5ec5b84be

View File

@ -577,7 +577,7 @@ lucet_options := \
$(WASM_LIBRARY): $(WASM_LIBRARY).$(WASM_OBJ_SUFFIX)
$(REPORT_BUILD)
$(RM) $(WASM_LIBRARY)
$(LUCETC) $(lucet_options) $(WASM_LIBRARY).$(WASM_OBJ_SUFFIX) -o $(WASM_LIBRARY)
env LD="$(CC)" LDFLAGS="$(LUCETC_LDFLAGS)" $(LUCETC) $(lucet_options) $(WASM_LIBRARY).$(WASM_OBJ_SUFFIX) -o $(WASM_LIBRARY)
ifeq ($(OS_ARCH),WINNT)
# Import libraries are created by the rules creating shared libraries.