Skip to content

Commit f96bc89

Browse files
committed
fix build
1 parent a3be1f4 commit f96bc89

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

backends/qualcomm/scripts/download_qnn_sdk.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ def _extract_tar(archive_path: pathlib.Path, prefix: str, target_dir: pathlib.Pa
247247
# libc management
248248
####################
249249

250-
GLIBC_ROOT = pathlib.Path("/tmp/glibc-2.36")
250+
GLIBC_VERSION = "2.29"
251+
GLIBC_ROOT = pathlib.Path(f"/tmp/glibc-{GLIBC_VERSION}")
251252
GLIBC_LOADER = GLIBC_ROOT / "lib" / "ld-linux-x86-64.so.2"
252253
GLIBC_LIBDIR = GLIBC_ROOT / "lib"
253254
GLIBC_REEXEC_GUARD = "QNN_GLIBC_REEXEC"
@@ -274,17 +275,18 @@ def _detect_glibc_version() -> Optional[Tuple[int, int]]:
274275

275276

276277
def _install_glibc_234():
277-
"""Download and build glibc 2.36 into /tmp/glibc-2.36 if missing."""
278+
"""Download and build glibc GLIBC_VERSION into /tmp/glibc-{GLIBC_VERSION} if missing."""
278279
if GLIBC_LOADER.exists():
279280
logger.info("[glibc] Already installed at %s", GLIBC_ROOT)
280281
return
281282

282-
logger.info("[glibc] Installing glibc 2.36 into %s ...", GLIBC_ROOT)
283+
logger.info(f"[glibc] Installing glibc {GLIBC_VERSION} into %s ...", GLIBC_ROOT)
283284
# url = "https://ftp.gnu.org/gnu/libc/glibc-2.34.tar.xz"
284-
url = "https://ftp.gnu.org/gnu/libc/glibc-2.36.tar.xz"
285+
# url = "https://ftp.gnu.org/gnu/libc/glibc-2.36.tar.xz"
286+
url = f"https://ftp.gnu.org/gnu/libc/glibc-{GLIBC_VERSION}.tar.xz"
285287

286288
with tempfile.TemporaryDirectory() as tmpdir:
287-
tarball = pathlib.Path(tmpdir) / "glibc-2.36.tar.xz"
289+
tarball = pathlib.Path(tmpdir) / f"glibc-{GLIBC_VERSION}.tar.xz"
288290
logger.info("[glibc] Downloading %s", url)
289291
urllib.request.urlretrieve(url, tarball)
290292
logger.info("[glibc] Downloaded %s", tarball)
@@ -306,7 +308,7 @@ def _install_glibc_234():
306308
env["CC"] = "gcc" # explicit, avoids surprises
307309

308310
# Configure
309-
cmd = ["../glibc-2.36/configure", f"--prefix={GLIBC_ROOT}"]
311+
cmd = [f"../glibc-{GLIBC_VERSION}/configure", f"--prefix={GLIBC_ROOT}"]
310312
logger.info("[glibc] Running: %s", " ".join(cmd))
311313
subprocess.check_call(cmd, cwd=build_dir, env=env)
312314

@@ -321,7 +323,9 @@ def _install_glibc_234():
321323
subprocess.check_call(cmd, cwd=build_dir, env=env)
322324

323325
if GLIBC_LOADER.exists():
324-
logger.info("[glibc] Successfully installed glibc 2.36 at %s", GLIBC_ROOT)
326+
logger.info(
327+
f"[glibc] Successfully installed glibc {GLIBC_VERSION} at %s", GLIBC_ROOT
328+
)
325329
else:
326330
logger.error(
327331
"[glibc] Install finished but loader not found at %s", GLIBC_LOADER

0 commit comments

Comments
 (0)