mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1726474 - Always use clang-type flags when targeting wasm. r=firefox-build-system-reviewers,mhentges
The build system assumes the target compiler is of the same type as the wasm compiler, but that's not true for wasm32-wasi, which we compile with clang, while targeting windows, which we compile with clang-cl. We handle the duality for host/target in a compiler-specific way, but here, the wasm compiler is always going to be clang. Differential Revision: https://phabricator.services.mozilla.com/D123041
This commit is contained in:
parent
7e072d6610
commit
b7bcda87f0
@ -501,7 +501,7 @@ $(LIBRARY): $(OBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
|
||||
$(WASM_ARCHIVE): $(CWASMOBJS) $(CPPWASMOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
|
||||
$(REPORT_BUILD_VERBOSE)
|
||||
$(RM) $(WASM_ARCHIVE)
|
||||
$(WASM_CXX) $(OUTOPTION)$@ -Wl,--export-all -Wl,--stack-first -Wl,-z,stack-size=$(if $(MOZ_OPTIMIZE),262144,1048576) -Wl,--no-entry -Wl,--growable-table $(CWASMOBJS) $(CPPWASMOBJS)
|
||||
$(WASM_CXX) -o $@ -Wl,--export-all -Wl,--stack-first -Wl,-z,stack-size=$(if $(MOZ_OPTIMIZE),262144,1048576) -Wl,--no-entry -Wl,--growable-table $(CWASMOBJS) $(CPPWASMOBJS)
|
||||
|
||||
$(addsuffix .c,$(WASM_ARCHIVE)): $(WASM_ARCHIVE)
|
||||
$(DIST)/host/bin/wasm2c -o $@ $<
|
||||
@ -597,7 +597,7 @@ $(COBJS):
|
||||
|
||||
$(CWASMOBJS):
|
||||
$(REPORT_BUILD_VERBOSE)
|
||||
$(WASM_CC) $(OUTOPTION)$@ -c $(WASM_CFLAGS) $($(notdir $<)_FLAGS) $<
|
||||
$(WASM_CC) -o $@ -c $(WASM_CFLAGS) $($(notdir $<)_FLAGS) $<
|
||||
|
||||
WINEWRAP = $(if $(and $(filter %.exe,$1),$(WINE)),$(WINE) $1,$1)
|
||||
|
||||
@ -677,7 +677,7 @@ $(CPPOBJS):
|
||||
$(CPPWASMOBJS):
|
||||
$(REPORT_BUILD_VERBOSE)
|
||||
$(call BUILDSTATUS,OBJECT_FILE $@)
|
||||
$(WASM_CXX) $(OUTOPTION)$@ -c $(WASM_CXXFLAGS) $($(notdir $<)_FLAGS) $<
|
||||
$(WASM_CXX) -o $@ -c $(WASM_CXXFLAGS) $($(notdir $<)_FLAGS) $<
|
||||
|
||||
$(CMMOBJS):
|
||||
$(REPORT_BUILD_VERBOSE)
|
||||
|
@ -757,6 +757,12 @@ class WasmFlags(TargetCompileFlags):
|
||||
|
||||
TargetCompileFlags.__init__(self, context)
|
||||
|
||||
def _debug_flags(self):
|
||||
substs = self._context.config.substs
|
||||
if substs.get("MOZ_DEBUG") or substs.get("MOZ_DEBUG_SYMBOLS"):
|
||||
return ["-g"]
|
||||
return []
|
||||
|
||||
def _optimize_flags(self):
|
||||
if not self._context.config.substs.get("MOZ_OPTIMIZE"):
|
||||
return []
|
||||
|
Loading…
Reference in New Issue
Block a user