{"id":20726639,"url":"https://github.com/embeddedartistry/compiler-rt","last_synced_at":"2025-03-11T09:19:58.473Z","repository":{"id":45121938,"uuid":"177296950","full_name":"embeddedartistry/compiler-rt","owner":"embeddedartistry","description":"Wrapper project for llvm compiler-rt, using meson to build and use with the embedded framework","archived":false,"fork":false,"pushed_at":"2024-05-21T17:17:31.000Z","size":50,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T23:41:55.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Meson","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/embeddedartistry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","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":"2019-03-23T14:11:29.000Z","updated_at":"2024-06-12T22:35:01.000Z","dependencies_parsed_at":"2024-05-21T18:45:08.219Z","dependency_job_id":null,"html_url":"https://github.com/embeddedartistry/compiler-rt","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embeddedartistry%2Fcompiler-rt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embeddedartistry%2Fcompiler-rt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embeddedartistry%2Fcompiler-rt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embeddedartistry%2Fcompiler-rt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embeddedartistry","download_url":"https://codeload.github.com/embeddedartistry/compiler-rt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243004328,"owners_count":20220282,"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-17T04:26:27.288Z","updated_at":"2025-03-11T09:19:58.448Z","avatar_url":"https://github.com/embeddedartistry.png","language":"Meson","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compiler-rt (meson port)\n\nThis project wraps the llvm compiler-rt repository and enables users to use it in meson-based projects.\n\nCurrently, this project is used to supply built-in functions for x86, x86_64, arm, and arm64 platforms.\n\nIf you are interested in contributing to this project, please read the [`CONTRIBUTING` guide](docs/CONTRIBUTING.md).\n\n## Table of Contents\n\n1. [About the Project](#about-the-project)\n1. [Project Status](#project-status)\n1. [Getting Started](#getting-started)\n    1. [Requirements](#Requirements)\n    1. [Getting the Source](#getting-the-source)\n    1. [Building](#building)\n    1. [Usage](#installation)\n1. [Configuration Options](#configuration-options)\n1. [Versioning](#versioning)\n1. [How to Get Help](#how-to-get-help)\n1. [Contributing](#contributing)\n1. [License](#license)\n1. [Authors](#authors)\n\n## About the Project\n\nThis project wraps the llvm compiler-rt repository and enables users to use it in meson-based projects.\n\nModifications to the compiler-rt implementations are not anticipated, but if needed alternative implementations can be supplied by this project.\n\n**[Back to top](#table-of-contents)**\n\n## Project Status\n\nThis project builds the full suite of compiler-rt functions for x86, x86_64, arm, and arm64 processors.\n\n**[Back to top](#table-of-contents)**\n\n## Getting Started\n\n### Requirements\n\n* [Meson](#meson-build-system) is the build system\n* [`git-lfs`][7] is used to store binary files in this repository\n* `make` is needed if you want to use the Makefile shims\n* You'll need some kind of compiler for your target system.\n    - This repository has been tested with:\n        - gcc\n        - arm-none-eabi-gcc\n        - Apple clang\n        - Mainline clang\n\n#### git-lfs\n\nThis project stores some files using [`git-lfs`](https://git-lfs.github.com).\n\nTo install `git-lfs` on Linux:\n\n```\nsudo apt install git-lfs\n```\n\nTo install `git-lfs` on OS X:\n\n```\nbrew install git-lfs\n```\n\nAdditional installation instructions can be found on the [`git-lfs` website](https://git-lfs.github.com).\n\n#### Meson Build System\n\nThe [Meson][meson] build system depends on `python3` and `ninja-build`.\n\nTo install on Linux:\n\n```\nsudo apt-get install python3 python3-pip ninja-build\n```\n\nTo install on OSX:\n\n```\nbrew install python3 ninja\n```\n\nMeson can be installed through `pip3`:\n\n```\npip3 install meson\n```\n\nIf you want to install Meson globally on Linux, use:\n\n```\nsudo -H pip3 install meson\n```\n\n### Getting the Source\n\nThis project uses [`git-lfs`](https://git-lfs.github.com), so please install it before cloning. If you cloned prior to installing `git-lfs`, simply run `git lfs pull` after installation.\n\nThis project is [hosted on GitHub](https://github.com/embeddedartistry/compiler-rt). You can clone the project directly using this command:\n\n```\ngit clone --recursive git@github.com:embeddedartistry/compiler-rt.git\n```\n\nIf you don't clone recursively, be sure to run the following command in the repository or your build will fail:\n\n```\ngit submodule update --init\n```\n\n### Building\n\nThe library can be built by issuing the following command:\n\n```\nmake\n```\n\nThis will build all targets for your current architecture.\n\nYou can clean builds using:\n\n```\nmake clean\n```\n\nYou can eliminate the generated `buildresults` folder using:\n\n```\nmake purify\n```\n\nYou can also use the `meson` method for compiling.\n\nCreate a build output folder:\n\n```\nmeson buildresults\n```\n\nThen change into that folder and build targets by running:\n\n```\nninja\n```\n\nAt this point, `make` would still work.\n\n#### Cross-compiling\n\nCross-compilation is handled using `meson` cross files. Example files are included in the [`build/cross`](build/cross/) folder. You can write your own cross files for your specific platform (or open an issue and we can help you).\n\nCross-compilation must be configured using the meson command when creating the build output folder. For example:\n\n```\nmeson buildresults --cross-file build/cross/gcc/arm/gcc_arm_cortex-m4.txt\n```\n\nFollowing that, you can run `make` (at the project root) or `ninja` (within the build output directory) to build the project.\n\nTests will not be cross-compiled. They will be built for the native platform.\n\n### Usage\n\nIf you don't use `meson` for your project, the best method to use this project is to build it separately and copy the headers and library contents into your source tree.\n\n* Copy the `include/` directory contents into your source tree.\n* Library artifacts are stored in the `buildresults/` folder\n* Copy the desired library to your project and add the library to your link step.\n\nExample linker flags:\n\n```\n-Lpath/to/libcompiler_rt.a -lcompiler_rt\n```\n\nIf you're using `meson`, you can use `compiler-rt` as a subproject. Place it into your subproject directory of choice and add a `subproject` statement:\n\n```\ncompiler_rt = subproject('compiler-rt')\n```\n\nYou will need to promote the subproject dependencies to your project:\n\n```\ncompiler_rt_builtins_dep = compiler_rt.get_variable('compiler_rt_builtins_dep')\ncompiler_rt_builtins_native_dep = compiler_rt.get_variable('compiler_rt_builtins_native_dep')\n```\n\nYou can use the dependency for your target library configuration in your `executable` declarations(s) or other dependencies. For example:\n\n```\nblinky_nrf52dk_platform_dep = declare_dependency(\n    include_directories: blinky_nrf52dk_platform_inc,\n    dependencies: [\n        nf52dk_blinky_hw_platform_dep,\n        blinky_demo_platform_dep,\n        libmemory_freelist_dep,\n        libc_dep,\n        libcxxabi_dep,\n        libcxx_full_dep,\n        compiler_rt_builtins_dep, # \u003c------- compiler-rt dependency added\n    ],\n    link_args: [\n        '-L' + meson.current_source_dir(),\n        '-Tblinky_gcc_nrf52.ld',\n    ],\n    sources: files('platform.cpp'),\n)\n```\n\n## Configuration Options\n\nThe following meson project options can be set for this library when creating the build results directory with `meson`, or by using `meson configure`:\n\n* `enable-werror`: Cause the build to fail if warnings are present\n* `enable-pedantic-error`: Turn on `pedantic` warnings and errors\n* `force-32-bit`: forces 32-bit compilation instead of 64-bit\n* `compiler-rt-exclude-atomic-builtins`: Excludes atomic builtin functions from the build\n\nOptions can be specified using `-D` and the option name:\n\n```\nmeson buildresults -Denable-werror=true\n```\n\nThe same style works with `meson configure`:\n\n```\ncd buildresults\nmeson configure -Denable-werror=true\n```\n\n## Versioning\n\nThis project itself is unversioned and simply pulls in the latest compiler-rt commits periodically.\n\n## How to Get Help\n\nProvide any instructions or contact information for users who need to get further help with your project.\n\n## Contributing\n\nProvide details about how people can contribute to your project. If you have a contributing guide, mention it here. e.g.:\n\nWe encourage public contributions! Please review [CONTRIBUTING.md](docs/CONTRIBUTING.md) for details on our code of conduct and development process.\n\n**[Back to top](#table-of-contents)**\n\n## License\n\nThis build project is licensed under the MIT license.\n\nCompiler-rt (and the llvm project in general) are released under [a modified Apache 2.0 license](compiler-rt/LICENSE.txt).\n\n## Authors\n\n* **[Phillip Johnston](https://github.com/phillipjohnston)** - *Initial work* - [Embedded Artistry](https://github.com/embeddedartistry)\n\n**[Back to top](#table-of-contents)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembeddedartistry%2Fcompiler-rt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembeddedartistry%2Fcompiler-rt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembeddedartistry%2Fcompiler-rt/lists"}