https://github.com/toasterbirb/brb
[MIRROR] Toy C++ library with the goal of not touching libc or C++ standard libaries
https://github.com/toasterbirb/brb
Last synced: over 1 year ago
JSON representation
[MIRROR] Toy C++ library with the goal of not touching libc or C++ standard libaries
- Host: GitHub
- URL: https://github.com/toasterbirb/brb
- Owner: Toasterbirb
- License: gpl-3.0
- Created: 2024-09-07T13:42:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-20T17:52:14.000Z (over 1 year ago)
- Last Synced: 2025-02-20T18:44:18.420Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# brb
The goal of this project is to create a C++ standard library for Linux without using any libraries (not even the C or C++ standard libraries). If everything goes as planned, there should be zero includes in this repository that refer to files outside of this repository.
> [!WARNING]
> There are zero, absolutely none, nada, security guarantees with this library
brb is somewhat opionated and will not necessarily follow any existing standards. Some notable changes include:
- The main function signature is `u8 brb_main()`
- Fundamental types like int, float etc. are undefined
- As a replacement there are fixed width shortened type names that follow the following format: i8, u8, i16, u16 and so on
- As a side effect, including pretty much any header that isn't made with brb in mind will probably error out. Thus this part is subject to change if needed
## Building
Build the project with g++ by running `make`. To speed up the build, you can try using the -j flag.
```sh
make -j$(nproc)
```
## Building a project that uses brb
As of now, the following compiler flags are needed (on gcc) to disable the standard libraries and exceptions etc.
```
-fno-stack-protector -Wno-builtin-declaration-mismatch -nostdlib -nostdlib++ -fno-exceptions
```
Then simply build the library against a staticly linked build of the brb library
## Installation
To install brb to /usr/local/bin, run the following
```sh
make install
```
You can customize the installation prefix with the PREFIX variable like so
```sh
make PREFIX=/usr install
```
## Uninstall
```sh
make uninstall
```