uwsampa / accept

an approximate compiler
http://accept.rocks
MIT License
37 stars 14 forks source link

Fixing Clang using the incorrect GCC toolchain to generate LLVM bitcode #56

Closed lucasreis1 closed 4 years ago

lucasreis1 commented 4 years ago

This is a workarround to deal with Clang's bug that includes the incorrect GCC toolchain at compile time. The increments create a new toolchain directory on ACCEPTs root folder and point the system root to this folder on CLang. Should solve issues on systems with newer GCC versions installed (GCC 5.*+)

sampsyo commented 4 years ago

Wow; that's fascinating! Thanks for looking into this.

Because this fix is Linux-specific, we of course want this to be a no-op when /usr/include/*-linux-gnu/c++/4.* does not exist. By my reading, that's already the case, right? Just wanted to make sure I wasn't missing anything.

lucasreis1 commented 4 years ago

My fix follows the same logic as the original workarround inside the accept.mk file, meaning the fix is applied only when the /usr/include/ folder is found. I pushed another commit to allow the correct folder to be formed, independent of the system architecture

I hope these are enough, but it seems to work here!

sampsyo commented 4 years ago

Seems good to me; thanks!!