{"id":20971504,"url":"https://github.com/amanoteam/glibc_preload","last_synced_at":"2025-05-14T11:33:48.782Z","repository":{"id":175189946,"uuid":"647973145","full_name":"AmanoTeam/glibc_preload","owner":"AmanoTeam","description":"An execve() wrapper that allows executing binaries using a glibc installed in a non-standard location.","archived":true,"fork":false,"pushed_at":"2023-06-14T06:26:35.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T11:45:58.540Z","etag":null,"topics":["c","cpp","execve","glibc","ldpreload"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmanoTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-05-31T23:47:17.000Z","updated_at":"2024-06-22T13:48:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"c99194bb-bcac-4152-abfc-659889f86665","html_url":"https://github.com/AmanoTeam/glibc_preload","commit_stats":null,"previous_names":["amanoteam/glibc_preload"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmanoTeam%2Fglibc_preload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmanoTeam%2Fglibc_preload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmanoTeam%2Fglibc_preload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmanoTeam%2Fglibc_preload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmanoTeam","download_url":"https://codeload.github.com/AmanoTeam/glibc_preload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254131907,"owners_count":22020041,"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":["c","cpp","execve","glibc","ldpreload"],"created_at":"2024-11-19T04:02:52.015Z","updated_at":"2025-05-14T11:33:48.768Z","avatar_url":"https://github.com/AmanoTeam.png","language":"C","readme":"# GLibc preload\n\nAn `execve()` wrapper that allows executing binaries using a glibc installed in a non-standard location.\n\n## How does it work?\n\nSometimes you may want to run a binary using a different version of glibc instead of using the one installed on your machine, either to test a new implementation of a newer version or simply to use binaries that were linked on a system with a newer glibc than yours.\n\nThe `libglibc_preload.so` library uses the [LD_PRELOAD](https://stackoverflow.com/a/426260) trick to replace calls to the `execve()` function with an alternative version that replaces the default interpreter with one installed in a non-standard location.\n\n## Install\n\n### Build glibc and install on a non-standard location.\n\n```bash\n$ git clone --depth='1' 'https://sourceware.org/git/glibc.git'\n$ cd glibc\n$ mkdir build; cd build\n$ ../configure \\\n    --prefix=\"${HOME}/.local\" \\\n    --with-headers=/usr/include \\\n    --enable-bind-now \\\n    --enable-cet \\\n    --enable-multi-arch \\\n    --enable-stack-protector=strong \\\n    --enable-systemtap \\\n    --disable-crypt \\\n    --disable-profile \\\n    --disable-werror \\\n    CFLAGS='-Os' \\\n    LDFLAGS='-s'\n$ make all\n$ make install\n```\n\n### Build glibc_preload and install\n\n```bash\n$ git clone --depth='1' 'https://github.com/AmanoTeam/glibc_preload.git'\n$ cd glibc_preload\n$ mkdir build; cd build\n$ cmake \\\n    -DCMAKE_INSTALL_PREFIX=\"${HOME}/.local\" \\\n    -DCMAKE_BUILD_TYPE='MinSizeRel' \\\n    ./\n$ cmake --install ./\n```\n\n## Usage\n\n```bash\nLD_PRELOAD=\"${HOME}/.local/lib/libglibc_preload.so\" command ...\n```\n\n## Limitations\n\n* This won't work with statically linked binaries.\n* This won't work with binaries that call `execve()` using syscalls instead of relying on the glibc implementation.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famanoteam%2Fglibc_preload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famanoteam%2Fglibc_preload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famanoteam%2Fglibc_preload/lists"}