简体   繁体   中英

Cross compilation: more difficult than it should be?

I am wondering one thing that is quite time-consuming when coding with C/C++ for different architectures and OSes, such as Android and Iphone.

I see that every gcc based compiler must be compiled with:

  1. target
  2. build
  3. host

I wonder if it would be technically possible and technically feasible to have a single compiler binary that can generate code for all the targets, as long as the cross compiled libraries exist. It would be configurable with a flag or set of flags.

I think it is possible but not supported by most compilers. There is a project called ELLCC that is trying to build a multi-target cross compilation environment for embedded systems which makes use of Clang and the LLVM compiler infrastructure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM