The Devil Is in the Command Line: Associating the Compiler Flags With the Binary and Build Metadata
Abstract: Engineers build large software systems for multiple architectures, operating systems, and configurations. A set of inconsistent or missing compiler flags generates code that catastrophically impacts the system's behavior. In the authors' industry experience, defects caused by an undesired combination of compiler flags are common in nontrivial software projects. We are unaware of any build and CI/CD systems that track how the compiler produces a specific binary in a structured manner. We postulate that a queryable database of how the compiler compiled and linked the software system will help to detect defects earlier and reduce the debugging time.
- Compilers: Principles, Techniques, and Tools (2nd ed.). Addison Wesley, Boston, MA, USA.
- John Calcote. 2020. Autotools: A Practitioner’s Guide to GNU Autoconf, Automake, and Libtool (2nd ed.). No Starch Press, San Francisco, CA, USA.
- Microsoft Corporation. 2021. NMAKE Reference. Retrieved October 5, 2023 from https://docs.microsoft.com/en-us/cpp/build/reference/nmake-reference
- Stephanie Dick and Daniel Volmar. 2018. DLL Hell: Software Dependencies, Failure, and the Maintenance of Microsoft Windows. IEEE Annals of the History of Computing 40, 4 (Oct. 2018), 28–51. https://doi.org/10.1109/MAHC.2018.2877913
- Free Software Foundation, Inc. 2009. Ld(1): GNU linker—Linux man page. Retrieved October 5, 2023 from https://linux.die.net/man/1/ld
- Free Software Foundation, Inc. 2023. Make—GNU Project—Free Software Foundation. Retrieved October 5, 2023 from https://www.gnu.org/software/make/
- Google. 2023a. Bazel—A Fast, Scalable, Multi-Language and Extensible Build System. Retrieved October 5, 2023 from https://bazel.build/
- Google. 2023b. Hermeticity. Retrieved October 5, 2023 from https://bazel.build/basics/hermeticity
- Mandeep Singh Grang. 2017. Non-determinism in LLVM Code Generation. Talk presented at the 11th meeting of LLVM developers and users. San Jose, CA, USA. Retrieved October 5, 2023 from https://github.com/mgrang/non-determinism/blob/master/poster__nondeterminism_in_llvm_code_generation__llvmdevmeet_2017.pdf
- Mandeep Singh Grang. 2018. Fighting Non-determinism in C++ Compilers. Talk presented at the CppCon 2018. Bellevue, WA, USA. Retrieved October 5, 2023 from https://github.com/CppCon/CppCon2018/blob/master/Posters/fighting_nondeterminism_in_cpp_compilers/fighting_nondeterminism_in_cpp_compilers__mandeep_singh_grang__cppcon_2018.pdf
- Michael Howard and David Leblanc. 2002. Writing Secure Code (2nd ed.). Microsoft Press, Redmond, WA, USA.
- Michael Howard and Steve Lipner. 2006. The Security Development Lifecycle. Microsoft Press, Redmond, WA, USA.
- Kitware, Inc. 2023. CMake. Retrieved October 5, 2023 from https://cmake.org/
- Chris Lamb and Stefano Zacchiroli. 2022. Reproducible Builds: Increasing the Integrity of Software Supply Chains. IEEE Software 39, 2 (2022), 62–70. https://doi.org/10.1109/MS.2021.3073045
- Vincent Maraia. 2005. The Build Master: Microsoft’s Software Configuration Management Best Practices. Addison-Wesley Professional, Reading, MA, USA.
- Evan Martin. 2022. Ninja, a Small Build System With a Focus on Speed. Retrieved October 5, 2023 from https://ninja-build.org/
- Meta Platforms, Inc. 2023. Buck2. Retrieved October 5, 2023 from https://buck2.build/
- Build Systems à La Carte. Proceedings of the ACM on Programming Languages 2, ICFP, Article 79 (July 2018), 29 pages. https://doi.org/10.1145/3236774
- Statistical selection of compiler options. In The IEEE Computer Society’s 12th Annual International Symposium on Modeling, Analysis, and Simulation of Computer and Telecommunications Systems, 2004. (MASCOTS 2004). Proceedings. 494–501. https://doi.org/10.1109/MASCOT.2004.1348305
- Wolfram Schulte. 2016. Changing Microsoft’s Build: Revolution or Evolution. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering (Singapore) (ASE ’16). Association for Computing Machinery, New York, NY, USA, 2. https://doi.org/10.1145/2970276.2985779
- Peter Smith. 2011. Software Build Systems: Principles and Experience (1st ed.). Addison-Wesley Professional, Upper Saddle River, NJ, USA.
- The Apache Software Foundation. 2022. Apache Ant. Retrieved October 5, 2023 from https://ant.apache.org/
- TIS Committee. 1995. Tool Interface Standard (TIS) Executable and Linking Format (ELF) Specification. Retrieved October 5, 2023 from https://refspecs.linuxfoundation.org/elf/elf.pdf
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.