{"id":18564475,"url":"https://github.com/guardsquare/libebc","last_synced_at":"2025-04-10T04:31:50.372Z","repository":{"id":50480397,"uuid":"63262623","full_name":"Guardsquare/LibEBC","owner":"Guardsquare","description":"C++ Library and Tool for Extracting Embedded Bitcode","archived":false,"fork":false,"pushed_at":"2021-02-20T22:49:03.000Z","size":10489,"stargazers_count":163,"open_issues_count":7,"forks_count":40,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-24T16:11:08.629Z","etag":null,"topics":["bitcode","elf","llvm","macho","tool"],"latest_commit_sha":null,"homepage":"https://www.guardsquare.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Guardsquare.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}},"created_at":"2016-07-13T16:33:55.000Z","updated_at":"2025-03-05T13:12:38.000Z","dependencies_parsed_at":"2022-08-24T13:00:24.808Z","dependency_job_id":null,"html_url":"https://github.com/Guardsquare/LibEBC","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guardsquare%2FLibEBC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guardsquare%2FLibEBC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guardsquare%2FLibEBC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guardsquare%2FLibEBC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guardsquare","download_url":"https://codeload.github.com/Guardsquare/LibEBC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248157474,"owners_count":21057020,"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":["bitcode","elf","llvm","macho","tool"],"created_at":"2024-11-06T22:15:20.292Z","updated_at":"2025-04-10T04:31:49.830Z","avatar_url":"https://github.com/Guardsquare.png","language":"C++","readme":"# LibEBC\n\n[![Build Status](https://api.travis-ci.org/Guardsquare/LibEBC.svg?branch=master)](https://travis-ci.org/Guardsquare/LibEBC)\n\nLibrary and tool for retrieving embedded bitcode from binaries end libraries.\nIt supports all types of objects files (Mach-O, ELF, COFF, ...) as well as Mach-O\nuniversal binaries, and static and dynamic libraries.\n\n## EBC Util\n\n`ebcutil` is a stand-alone command line tool for extracting embedded bitcode.\n\nInformation about the binary is printed as well as  metadata that is stored\ntogether with the bitcode files. For universal Mach-O binaries this includes\nlinker flags and used dylibs. Objects not created by Apple LLVM contain only\nthe command line options passed to the clang frontend.\n\nThe bitcode files are created in the current working directory. They can be\nprocessed by any tool accepting bitcode or you can use `llvm-dis` to convert\nthem into human-readable [LLVM assembly language](http://llvm.org/docs/LangRef.html).\n\nExample of a **Mach-O universal binary** (fat binary):\n\n```shell\n$ file fat.o\nfat.o: Mach-O universal binary with 2 architectures\nfat.o (for architecture i386):    Mach-O executable i386\nfat.o (for architecture x86_64):  Mach-O 64-bit executable x86_64\n\n$ ebcutil fat.o\nMach-O 32-bit i386\n  File name: fat.o\n       Arch: x86\n       UUID: 16B4EDD1-4B58-35FB-849F-0CA0647D6C1C\n     Dylibs: {SDKPATH}/usr/lib/libSystem.B.dylib\n  Link opts: -execute -macosx_version_min 10.11.0 -e _main -executable_path build/i386.o\n    Bitcode: 2399E7B1-F4B6-4D55-916B-2EDAA799816E\n    Bitcode: B3DEAEF5-4F4C-4FF1-95F0-7B5FDD2575F8\nMach-O 64-bit x86-64\n  File name: fat.o\n       Arch: x86_64\n       UUID: F6323CD5-E0DD-3E99-9D4A-B36B5A8E3E36\n     Dylibs: {SDKPATH}/usr/lib/libSystem.B.dylib\n  Link opts: -execute -macosx_version_min 10.11.0 -e _main -executable_path build/x86_64.o\n    Bitcode: DC97B259-9C3C-40D9-803C-8A841FB11DE3\n    Bitcode: 7CC7D4AF-8750-4370-9D65-07CEBD720286\n```\n\n\nExample of an **ELF shared library**:\n\n```shell\n$ file lib.so\nlib.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped\n\n$ ebcutil lib.so\nELF32-arm-little\n  File name: lib.so\n       Arch: arm\n       UUID: 00000000-0000-0000-0000-000000000000\n    Bitcode: 565E3FBE-5B28-4428-B31B-3B3420CDA43A\n        Clang: -triple thumbv7-none-linux-android -S -fembed-bitcode=all -disable-llvm-optzns ...\n    Bitcode: C4C34416-D5A2-40BB-A85A-88380E4A1375\n        Clang: -triple thumbv7-none-linux-android -S -fembed-bitcode=all -disable-llvm-optzns ...\n```\n\nApple embeds more than just bitcode in the LLVM section. Example of a **Mach-O\nwith an embedded Mach-O and embedded Xar**:\n\n```shell\n$ file macho\nmacho: Mach-O 64-bit executable x86_64\n\n$ ebcutil macho\nMach-O 64-bit x86-64\n  File name: ASMExample\n       Arch: x86_64\n       UUID: 0A046594-A616-3CE3-9622-FF6D031BCA93\n     Dylibs: {SDKPATH}/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation ...\n  Link opts: -execute -macosx_version_min 10.12.0 -e _main -executable_path ...\n    Bitcode: 663A7A0C-1D29-4469-A68E-391BB16DD21A\n      MachO: BC282643-364A-46A5-9690-F8226DB9F7DC\n        Xar: C10CA2C2-EA04-4C71-AA17-9272DE85E0FD\n```\n\nYou can also use `ebcutil` to check whether a given binary or library contains\nbitcode. It prints the first object encountered without bitcode and exits with\na non-zero exit status.\n\n```shell\n$ ebcutil nobitcode.o\nError: No bitcode section in nobitcode.o\n```\n\n## Build\n\nThis project uses CMake as its build system. It has the following dependencies:\n\n - CMake 3.0 or later.\n - LibXML2\n - LibXar (optional, but required for Apple's embedded bitcode)\n - LLVM 3.9 or LLVM 4.0\n\n```shell\n$ git clone https://github.com/JDevlieghere/LibEBC.git \u0026\u0026 cd LibEBC\n$ mkdir build \u0026\u0026 cd build\n$ cmake ..\n$ cmake --build .\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardsquare%2Flibebc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguardsquare%2Flibebc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardsquare%2Flibebc/lists"}