From b7b5fb930da5116277152a11044c187414aecef7 Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Wed, 29 Aug 2018 13:40:39 +0200 Subject: [PATCH] superenv: Use 02 optimization flag for Linux builds `-Os` produces sometimes bigger binaries on Linux. Also, llvm built with `-Os` is really slow at runtime for Linux. Using `-02` aligns us with what Debian does, and as we are compiling most of our stuff with gcc (and not clang), it makes sense to use `-02` on Linux. `-Os` does probably slightly different things when used on mac with llvm, compared to when it is used with gcc on Linux. --- Library/Homebrew/extend/os/linux/extend/ENV/super.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb index 7f3a04b8ab..043a1d8065 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb @@ -7,6 +7,7 @@ module Superenv # @private def setup_build_environment(formula = nil) generic_setup_build_environment(formula) + self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(formula) end