version = "2.41" revision = 1 metadata = meta( description = "GNU C library", license = "LGPL-2.1-or-later", website = "https://www.gnu.org/software/libc/", ) source = tarball_source( url = f"https://ftp.gnu.org/gnu/glibc/glibc-{version}.tar.xz", sha256 = "a5a26b22f545d6b7d7b3dd828e11e428f24f4fac43c934fb071b6a7d0828e901", strip_components = 1, ) host_deps = ["binutils", "gcc-bootstrap"] deps = ["linux-headers"] build_if = options.libc == "glibc" def configure(ctx): ctx.run([ ctx.source_dir / "configure", "--host=" + options.target_triple, "--build=" + options.target_triple, "--prefix=/usr", "--with-headers=" + ctx.sysroot / "usr/include", "--enable-kernel=5.4", "--enable-bind-now", "--enable-stack-protector=strong", "--enable-cet", "--disable-werror", "--disable-profile", "--disable-nscd", "--without-selinux", "--without-gd", "libc_cv_forced_unwind=yes", "libc_cv_ssp=no", "libc_cv_ssp_strong=yes", ], env = { "CC": options.target_triple + "-gcc", "CXX": options.target_triple + "-g++", "CFLAGS": options.cflags, }) def build(ctx): ctx.run(["make", "-j" + str(ctx.jobs)]) def install(ctx, pkg): ctx.run(["make", "install", "DESTDIR=" + pkg.dest_dir])