travitch / build-bom

Dynamically discover the commands used to create a piece of software
Apache License 2.0
45 stars 8 forks source link

Add -E to use native (original) compiler preprocessing before clang bitcode generation #70

Closed kquick closed 3 months ago

kquick commented 4 months ago

When using customized compilers (e.g. RTEMS gcc), the target compiler may have various include files and associated definitions that are not compatible with clang (e.g. the modifications are behind an #ifdef __gcc__ barrier for no apparent reason). This modification provides a -E flag which tells build-bom to use the "native" compiler to pre-process the input into a .c or .cc file before invoking clang on that result to obtain LLVM bitcode.

travitch commented 4 months ago

Oh yeah I had this on my long-term TODO list. Very nice.