ivmai / bdwgc

The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)
https://www.hboehm.info/gc/
Other
3.01k stars 407 forks source link

CMake building for bare metal #393

Open niansa opened 3 years ago

niansa commented 3 years ago

Hey, which cmake options do I need to pass to build for bare metal?

(So only C standard lib functions are used but nothing else at all)

ivmai commented 3 years ago

I've not heard someone tried to build for bare metal using CMake. Is there any issue if no specific option is passed?

ivmai commented 3 years ago

Are you using Musl?

niansa commented 3 years ago

Nope, just some super-minimal C and C++ standard library without any posix stuff. Just malloc and free for memory management as well as some mmap/munmap-like functions.

ivmai commented 3 years ago

It would be interesting to know the results of your experiments. Patches are welcomed too!

ivmai commented 3 years ago

Just malloc and free for memory management as well as some mmap/munmap-like functions.

The minimum you need is malloc (i.e. a way to get memory from the underlying subsystem).

A porting guide might be helpful for you - porting.md