diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb b/meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb
index 6bcbb13501..c3804ec64d 100644
--- a/meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb
@@ -24,7 +24,7 @@ UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
 
 S = "${WORKDIR}/firefox-${PV}"
 
-inherit pkgconfig perlnative python3native rust
+inherit pkgconfig perlnative python3native rust cargo
 
 DEPENDS += "zlib cbindgen-native python3 icu"
 DEPENDS:remove:mipsarch = "icu"
@@ -83,6 +83,13 @@ do_configure() {
 }
 do_configure[cleandirs] += "${B}"
 
+# The main build system is a Makefile that call cargo downstream.
+# We inherit cargo to get the environnement but need to switch back to
+# base_do_compile to do the Makefile base compilation.
+do_compile() {
+    base_do_compile
+}
+
 do_install() {
     oe_runmake 'DESTDIR=${D}' install
 }
