Skip to content

Commit cab8076

Browse files
committed
fix build
1 parent e6ed4bd commit cab8076

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

backends/qualcomm/scripts/download_qnn_sdk.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,17 @@ def _install_glibc_234():
300300

301301
logger.info("[glibc] Configuring build...")
302302
env = os.environ.copy()
303+
303304
# Remove LD_LIBRARY_PATH to satisfy configure checks
304305
env.pop("LD_LIBRARY_PATH", None)
305-
# allow warnings
306-
# env["CFLAGS"] = "-O2 -Wno-error"
307-
# env["CFLAGS"] = "-O2 -Wno-error" # prevent warnings-as-errors
308-
# env["CC"] = "gcc" # explicit, avoids surprises
306+
307+
# Allow warnings (disable -Werror promoted by newer GCC)
308+
# Add -fcommon to avoid "multiple definition" issues on some glibc versions
309309
env["CFLAGS"] = (
310-
"-O2 -Wno-error=array-parameter -Wno-error=stringop-overflow -Wno-error"
310+
"-O2 -fPIC -fcommon "
311+
"-Wno-error=array-parameter "
312+
"-Wno-error=stringop-overflow "
313+
"-Wno-error"
311314
)
312315
env["CC"] = "gcc"
313316

@@ -317,7 +320,7 @@ def _install_glibc_234():
317320
subprocess.check_call(cmd, cwd=build_dir, env=env)
318321

319322
# Build
320-
cmd = ["make", "-j", str(os.cpu_count())]
323+
cmd = ["make", "-j", str(os.cpu_count()), "CFLAGS=" + env["CFLAGS"]]
321324
logger.info("[glibc] Running: %s", " ".join(cmd))
322325
subprocess.check_call(cmd, cwd=build_dir, env=env)
323326

0 commit comments

Comments
 (0)