{"id":20102503,"url":"https://github.com/clickhouse/sysroot","last_synced_at":"2025-08-21T23:32:44.389Z","repository":{"id":37978757,"uuid":"415741642","full_name":"ClickHouse/sysroot","owner":"ClickHouse","description":"Files for cross-compilation","archived":false,"fork":false,"pushed_at":"2024-09-19T10:26:46.000Z","size":125250,"stargazers_count":29,"open_issues_count":2,"forks_count":21,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-12-07T02:12:06.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClickHouse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-11T01:24:01.000Z","updated_at":"2024-09-28T06:25:51.000Z","dependencies_parsed_at":"2024-08-20T21:06:02.080Z","dependency_job_id":"a33ee60d-016c-48c1-941e-92e0a5cab4d4","html_url":"https://github.com/ClickHouse/sysroot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fsysroot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fsysroot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fsysroot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fsysroot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClickHouse","download_url":"https://codeload.github.com/ClickHouse/sysroot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230542287,"owners_count":18242332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:31:26.616Z","updated_at":"2024-12-20T06:06:02.708Z","avatar_url":"https://github.com/ClickHouse.png","language":"C","readme":"# Files For Cross-Compilation\n\nTo do cross-compiling, \"toolchain\" has to be used.\n\nTypical toolchain contains:\n- header files for the target platform for \"default\" libraries like libc, c++ standard library, etc;\n- header files for the libraries related to compiler builtins (known as `compiler-rt` or `libgcc`, sometimes including a library for exception handling support);\n- binaries `.a`, `.so` and similar for \"default\" libraries;\n- binaries for \"startfiles\" like `crt1.o` that contain entry point, initialization and deinitialization routines relevant to the libc;\n- the binaries of cross-compiler, cross-linker, cross-assembler, `ar` and `ranlib` and possibly other `binutils` - the binaries that run on host platform but generates artifacts for the target platform;\n\nToolchain is usually distributed as a tarball and is quite large, in order of hundreds MB.\nIt contains an amalgamation of tools, libraries and binaries for all the needs: C, C++, Fortran, CUDA...\n\nWe don't really need all of this amalgamation for the following reason:\n- we don't need cross-compiler and other tools, because we use LLVM infrastructure (clang, lld, llvm-ar, ...) and it supports cross-compilation by default;\n- we don't need C++ headers and libraries because we include libc++, libc++abi, LLVM's libunwind as a source code and compile it from sources during build process;\n- we definitely don't need Fortran headers;\n\nThe idea is to strip down the \"toolchain\" as much as possible and provide it as a submodule instead of tarball.\nActually it's not longer a \"toolchain\", it's just a collection of libc-related libraries and a few files for compiler builtins.\n\nThis gives us the following advantages:\n- more easy to add new platforms (no need to search for complete toolchain, just copy the relevant files from the OS image);\n- better understanding what's going on - only the relevant files included;\n- avoid risks of supply-chain attacks;\n- allow to use custom sysroot even for default (non-cross) build to get reproducible, hermetic builds;\n- opens up for experiment of building the libc from sources;\n- simplify using musl-libc instead of glibc.\n\nThis repository contains some blobs like `libc.so`.\nThe source:\n- for `x86_64` they are from Ubuntu 20.04 image;\n- for `aarch64` they are from [developer.arm.com](https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz?revision=2e88a73f-d233-4f96-b1f4-d8b36e9bb0b9\u0026la=en)\n\n- for `s390x` it is extracted from Docker image:\n```\ndocker run -it s390x/ubuntu:18.04\napt update\napt install gcc\n\ndocker export b38a367a8a05 \u003e s390x.tar\n```\n\n- for `powerpc64le` it is extracted from Docker image:\n\n```\ndocker run -it ppc64le/ubuntu:14.04\napt update\napt install gcc\n\ndocker export b38a367a8a05 \u003e ppc64.tar\n```\n\nThe ubuntu version 14.04 is selected for better compatibility.\n\n- for `x86_64-musl` some headers and libraries come from the ubuntu image, others are built from our musl fork: github.com/ClickHouse/musl (see https://github.com/ClickHouse/sysroot/pull/28)\n- for `riscv` they are from Debian Unstable [libc6-dev package](`https://packages.debian.org/sid/riscv64/libc6-dev`).\n- for `loongarch64` they are from Debian Unstable image\n\nFreeBSD:\n\n```\nhttps://clickhouse-datasets.s3.yandex.net/toolchains/toolchains/freebsd-11.3-toolchain.tar.xz\nhttp://distcache.FreeBSD.org/local-distfiles/mikael/freebsd-12.2-aarch64-toolchain.tar.xz\n```\n\nTODO:\n- build `compiler-rt` from sources and remove `libgcc.a` from here;\n- simplify directory structure even more.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickhouse%2Fsysroot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclickhouse%2Fsysroot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickhouse%2Fsysroot/lists"}