Work around e2fsck issue for building sparse GSIs

When trying to support sparse format for GSIs, aosp/720949, a bug in
e2fsck was triggered, and hence failed the build for sparse GSI.

This workaround disables the detection of ASAN ODR so we can build
sparse GSIs successfully like we previously did for the vendors,
some of which can't handle unsparse images.

Bug: 112062612
Test: $ lunch aosp_x86_64-eng
      $ m SANITIZE_HOST=address ASAN_OPTIONS=detect_odr_violation=0 -j
      $ emulator

Change-Id: Ifafd27aa1e57d785b914f78a4d9bfef6a0c33fc9
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index fc3eb2c..ac30c7d 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -714,7 +714,9 @@
 
     # Run e2fsck on the inflated image file
     e2fsck_command = ["e2fsck", "-f", "-n", unsparse_image]
-    (e2fsck_output, exit_code) = RunCommand(e2fsck_command)
+    # TODO(b/112062612): work around e2fsck failure with SANITIZE_HOST=address
+    env4e2fsck = {"ASAN_OPTIONS": "detect_odr_violation=0"}
+    (e2fsck_output, exit_code) = RunCommand(e2fsck_command, env=env4e2fsck)
 
     os.remove(unsparse_image)