Merge pull request #13568 from danielnachun/fix_glibc_2_13
Add flags to superenv when building with glibc@2.13
This commit is contained in:
commit
8a2efb1df6
@ -37,6 +37,17 @@ module Superenv
|
|||||||
paths
|
paths
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def homebrew_extra_isystem_paths
|
||||||
|
paths = []
|
||||||
|
# Add paths for GCC headers when building against glibc@2.13 because we have to use -nostdinc.
|
||||||
|
if deps.any? { |d| d.name == "glibc@2.13" }
|
||||||
|
gcc_include_dir = Utils.safe_popen_read(cc, "--print-file-name=include").chomp
|
||||||
|
gcc_include_fixed_dir = Utils.safe_popen_read(cc, "--print-file-name=include-fixed").chomp
|
||||||
|
paths << gcc_include_dir << gcc_include_fixed_dir
|
||||||
|
end
|
||||||
|
paths
|
||||||
|
end
|
||||||
|
|
||||||
def determine_rpath_paths(formula)
|
def determine_rpath_paths(formula)
|
||||||
PATH.new(
|
PATH.new(
|
||||||
*formula&.lib,
|
*formula&.lib,
|
||||||
|
@ -292,6 +292,8 @@ class Cmd
|
|||||||
args.concat(optflags) unless runtime_cpu_detection?
|
args.concat(optflags) unless runtime_cpu_detection?
|
||||||
args.concat(archflags)
|
args.concat(archflags)
|
||||||
args << "-std=#{@arg0}" if /c[89]9/.match?(@arg0)
|
args << "-std=#{@arg0}" if /c[89]9/.match?(@arg0)
|
||||||
|
# Add -nostdinc when building against glibc@2.13 to avoid mixing system and brewed glibc headers.
|
||||||
|
args << "-nostdinc" if @deps.include?("glibc@2.13")
|
||||||
args
|
args
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -326,6 +328,9 @@ class Cmd
|
|||||||
end
|
end
|
||||||
args += rpath_flags("#{wl}-rpath=", rpath_paths)
|
args += rpath_flags("#{wl}-rpath=", rpath_paths)
|
||||||
args += ["#{wl}--dynamic-linker=#{dynamic_linker_path}"] if dynamic_linker_path
|
args += ["#{wl}--dynamic-linker=#{dynamic_linker_path}"] if dynamic_linker_path
|
||||||
|
# Use -rpath-link to make sure linker uses glibc@2.13 rather than the system glibc for indirect
|
||||||
|
# dependencies because -L will only handle direct dependencies.
|
||||||
|
args << "#{wl}-rpath-link=#{@opt}/glibc@2.13/lib" if @deps.include?("glibc@2.13")
|
||||||
args
|
args
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user