One of the challenges of any software development teams is maintaining legacy software code. Significant time is invested for writing and bugfixing a software system. Yet, the working system is now ‘old’ and it only compiles with an old version of GCC toolset. Teams in general want to move to a newer version of GCC but want to be able to compile code with the legacy compiler. In situations like this, cross-compiler can be used. Setting up proper environment variables and setting up binary/library path (LIBRARY_PATH) allows code to be compiled with older compiler.

Few advantages are

  • A single host can be used to compile with many different GCC versions
  • No need to keep old-old virtual machines (maintenance nightmares)
  • Code standard improves, system specific bugs are apparent
  • System library dependencies can be removed or consolidated