diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 1c1f3adcec..cd77caf0bf 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -185,7 +185,7 @@ class Cmd args << '-march=native' if tool =~ /clang/ end - ENV['HOMEBREW_ARCHS'].split(',').each { |a| args << "-arch" << a } if cccfg? 'u' + args.concat(archflags) args << "-std=#{@arg0}" if @arg0 =~ /c[89]9/ args end @@ -196,6 +196,11 @@ class Cmd args << '-stdlib=libstdc++' if cccfg? 'h' args end + def archflags + args = [] + ENV['HOMEBREW_ARCHS'].split(',').each { |a| args << "-arch" << a } if cccfg? 'u' + args + end def syslibpath # We reject brew's lib as we explicitly add this as a -L flag, thus it # is given higher priority by cc, so it surpasses the system libpath.