Skip to content

Commit

Permalink
Merge pull request chef#692 from chef/ksubrama/damnyougcc
Browse files Browse the repository at this point in the history
Make chef builds green again on windows....  please...
  • Loading branch information
mwrock authored Jul 8, 2016
2 parents f593cd6 + 2b85304 commit 29d390e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
7 changes: 5 additions & 2 deletions lib/omnibus/software.rb
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def with_standard_compiler_flags(env = {}, opts = {})
arch_flag = windows_arch_i386? ? "-m32" : "-m64"
opt_flag = windows_arch_i386? ? "-march=i686" : "-march=x86-64"
{
"LDFLAGS" => "-L#{install_dir}/embedded/lib #{arch_flag}",
"LDFLAGS" => "-L#{install_dir}/embedded/lib #{arch_flag} -fno-lto",
# We do not wish to enable SSE even though we target i686 because
# of a stack alignment issue with some libraries. We have not
# exactly ascertained the cause but some compiled library/binary
Expand All @@ -666,7 +666,10 @@ def with_standard_compiler_flags(env = {}, opts = {})
#
# TODO: This was true of our old TDM gcc 4.7 compilers. Is it still
# true with mingw-w64?
"CFLAGS" => "-I#{install_dir}/embedded/include #{arch_flag} -O3 #{opt_flag}",
#
# XXX: Temporarily turning -O3 into -O2 -fno-lto to work around some
# weird linker issues.
"CFLAGS" => "-I#{install_dir}/embedded/include #{arch_flag} -O2 -fno-lto #{opt_flag}",
}
else
{
Expand Down
38 changes: 8 additions & 30 deletions spec/unit/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,21 +334,10 @@ module Omnibus
context "in 32-bit mode" do
it "sets the default" do
expect(subject.with_standard_compiler_flags).to eq(
"CFLAGS" => "-I/opt/project/embedded/include -m32 -O3 -march=i686",
"CXXFLAGS" => "-I/opt/project/embedded/include -m32 -O3 -march=i686",
"CPPFLAGS" => "-I/opt/project/embedded/include -m32 -O3 -march=i686",
"LDFLAGS" => "-L/opt/project/embedded/lib -m32",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig"
)
end

it "sets BFD flags if requested" do
expect(subject.with_standard_compiler_flags).to eq(
"CFLAGS" => "-I/opt/project/embedded/include -m32 -O3 -march=i686",
"CXXFLAGS" => "-I/opt/project/embedded/include -m32 -O3 -march=i686",
"CPPFLAGS" => "-I/opt/project/embedded/include -m32 -O3 -march=i686",
"LDFLAGS" => "-L/opt/project/embedded/lib -m32",
"CFLAGS" => "-I/opt/project/embedded/include -m32 -O2 -fno-lto -march=i686",
"CXXFLAGS" => "-I/opt/project/embedded/include -m32 -O2 -fno-lto -march=i686",
"CPPFLAGS" => "-I/opt/project/embedded/include -m32 -O2 -fno-lto -march=i686",
"LDFLAGS" => "-L/opt/project/embedded/lib -m32 -fno-lto",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig"
)
Expand All @@ -360,21 +349,10 @@ module Omnibus

it "sets the default" do
expect(subject.with_standard_compiler_flags).to eq(
"CFLAGS" => "-I/opt/project/embedded/include -m64 -O3 -march=x86-64",
"CXXFLAGS" => "-I/opt/project/embedded/include -m64 -O3 -march=x86-64",
"CPPFLAGS" => "-I/opt/project/embedded/include -m64 -O3 -march=x86-64",
"LDFLAGS" => "-L/opt/project/embedded/lib -m64",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig"
)
end

it "sets BFD flags if requested" do
expect(subject.with_standard_compiler_flags).to eq(
"CFLAGS" => "-I/opt/project/embedded/include -m64 -O3 -march=x86-64",
"CXXFLAGS" => "-I/opt/project/embedded/include -m64 -O3 -march=x86-64",
"CPPFLAGS" => "-I/opt/project/embedded/include -m64 -O3 -march=x86-64",
"LDFLAGS" => "-L/opt/project/embedded/lib -m64",
"CFLAGS" => "-I/opt/project/embedded/include -m64 -O2 -fno-lto -march=x86-64",
"CXXFLAGS" => "-I/opt/project/embedded/include -m64 -O2 -fno-lto -march=x86-64",
"CPPFLAGS" => "-I/opt/project/embedded/include -m64 -O2 -fno-lto -march=x86-64",
"LDFLAGS" => "-L/opt/project/embedded/lib -m64 -fno-lto",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig"
)
Expand Down

0 comments on commit 29d390e

Please sign in to comment.