{"id":16842883,"url":"https://github.com/teverett/arm_clang_cpp_example","last_synced_at":"2025-03-18T05:42:34.296Z","repository":{"id":144925502,"uuid":"85431169","full_name":"teverett/arm_clang_cpp_example","owner":"teverett","description":"An example of booting an ARM processor to C++, compiled with Clang","archived":false,"fork":false,"pushed_at":"2020-06-08T03:49:48.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-24T12:26:54.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/teverett.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":"2017-03-18T20:49:56.000Z","updated_at":"2020-06-08T03:49:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"c4b9f317-fbe7-42d2-8c0c-ef3347052c66","html_url":"https://github.com/teverett/arm_clang_cpp_example","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/teverett%2Farm_clang_cpp_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2Farm_clang_cpp_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2Farm_clang_cpp_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2Farm_clang_cpp_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teverett","download_url":"https://codeload.github.com/teverett/arm_clang_cpp_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166639,"owners_count":20409177,"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-10-13T12:48:52.856Z","updated_at":"2025-03-18T05:42:34.272Z","avatar_url":"https://github.com/teverett.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/teverett/arm_clang_cpp_example/workflows/CI/badge.svg)\n\n# arm_clang_cpp_example\n\nAn example of creating a custom ARM toolchain based on Clang and booting an ARM processor to C++.  This example shows:\n\n* Building a ARM cross-compile toolchain using GNU BinUtils and Clang\n* Booting the ARM chip, and running C++ code\n* Custom crt0 which initializes and de-initializes static data\n* C++ class instances allocated on the heap \n* C++ global class instances\n* Zero-ing the .bss and heap\n* GNU LD link script\n\n## Toolchain\n\nThis example uses the toolchain built by \n\n* [GNU Binutils](https://www.gnu.org/software/binutils/) - 2.34\n* [GNU Make](https://www.gnu.org/software/make/) - 3.82\n* [CMake](https://cmake.org/) - 3.17.2\n* [Clang](https://clang.llvm.org/) - 10.0.0\n\nTo build the toolchain\n\n\u003cpre\u003e\ncd toolchain\nsh build_toolchain.sh\n\u003c/pre\u003e\n\n### The toolchain supports these targets:\n\n* arm-none-eabi \n* arm-none-elf \n* mips-none-elf \n* mipsel-none-elf \n* mips64-none-elf \n* mips64el-none-elf \n* sparc-none-elf \n* avr-none-elf\n\n## Building the example\n\nThe provided MakeFile supports assembler, C, C++ and ObjectiveC source and targets the arm-none-elf platform\n\n\u003cpre\u003e\nmake\n\u003c/pre\u003e\n\n## Running the example\n\n\u003cpre\u003e\nmake run\n\u003c/pre\u003e\n\nThis requires that your system have `qemu-system-arm` installed\n\n### Example Output\n\n\u003cpre\u003e\nqemu-system-arm  -M versatilepb -m 128M -nographic -kernel kernel.bin\ncrt.c _init\nObj1 int ctor with value: 12\nHello from Clang\nnew: 74168 size: 1\nKernel::ctor\nKernel::run\n__startup_begin: 65536\n__text_begin: 65552\n__bss_begin: 68656\n__data_begin: 69688\n__rodata_begin: 69692\n__init_array_begin: 70060\n__fini_array_begin: 70064\n__stack_top: 74168\n__stack_size: 4096\n__heap_bottom: 74168\n__heap_size: 65536\nnew: 74268 size: 4\nObj1 int ctor with value: 77\n77\nObj1 dtor with value: 77\ndelete: 74268\n12\nKernel::dtor\ndelete: 74168\nObj1 dtor with value: 12\ncrt.c _fini\nQEMU: Terminated\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteverett%2Farm_clang_cpp_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteverett%2Farm_clang_cpp_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteverett%2Farm_clang_cpp_example/lists"}