]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/v8/build.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / v8 / build.patch
CommitLineData
1e59de90
TL
1diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
2index 0c8743726..e6a5ae0b4 100644
3--- a/config/compiler/BUILD.gn
4+++ b/config/compiler/BUILD.gn
5@@ -1545,6 +1545,7 @@ config("default_warnings") {
6 # Disables.
7 "-Wno-missing-field-initializers", # "struct foo f = {0};"
8 "-Wno-unused-parameter", # Unused function parameters.
9+ "-Wno-invalid-offsetof", # Use of "conditionally-supported" offsetof in c++17
10 ]
11 }
12
13@@ -1969,8 +1970,17 @@ config("no_incompatible_pointer_warnings") {
14 # Shared settings for both "optimize" and "optimize_max" configs.
15 # IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags.
16 if (is_win) {
17- common_optimize_on_cflags = [
18- "/Ob2", # Both explicit and auto inlining.
19+ common_optimize_on_cflags = []
20+ if(is_clang) {
21+ common_optimize_on_cflags += [
22+ "/Ob2", # Both explicit and auto inlining.
23+ ]
24+ } else {
25+ common_optimize_on_cflags += [
26+ "/Ob3", # Both explicit and auto inlining.
27+ ]
28+ }
29+ common_optimize_on_cflags += [
30 "/Oy-", # Disable omitting frame pointers, must be after /O2.
31 "/Zc:inline", # Remove unreferenced COMDAT (faster links).
32 ]
33diff --git a/config/linux/pkg-config.py b/config/linux/pkg-config.py
34index 5adf70cc3..dab159f98 100644
35--- a/config/linux/pkg-config.py
36+++ b/config/linux/pkg-config.py
37@@ -41,6 +41,11 @@ from optparse import OptionParser
38 # Additionally, you can specify the option --atleast-version. This will skip
39 # the normal outputting of a dictionary and instead print true or false,
40 # depending on the return value of pkg-config for the given package.
41+#
42+# --pkg_config_libdir=<path> allows direct override
43+# of the PKG_CONFIG_LIBDIR environment library.
44+#
45+# --full-path-libs causes lib names to include their full path.
46
47
48 def SetConfigPath(options):
49@@ -105,11 +110,32 @@ def RewritePath(path, strip_prefix, sysroot):
50 return path
51
52
53+flag_regex = re.compile("(-.)(.+)")
54+
55+
56+def FlagReplace(matchobj):
57+ if matchobj.group(1) == '-I':
58+ return matchobj.group(1) + subprocess.check_output([u'cygpath',u'-w',matchobj.group(2)]).strip().decode("utf-8")
59+ if matchobj.group(1) == '-L':
60+ return matchobj.group(1) + subprocess.check_output([u'cygpath',u'-w',matchobj.group(2)]).strip().decode("utf-8")
61+ if matchobj.group(1) == '-l':
62+ return matchobj.group(1) + matchobj.group(2) + '.lib'
63+ return matchobj.group(0)
64+
65+
66+def ConvertGCCToMSVC(flags):
67+ """Rewrites GCC flags into MSVC flags."""
68+ # need a better way to determine mingw vs msvc build
69+ if 'win32' not in sys.platform or "GCC" in sys.version:
70+ return flags
71+ return [ flag_regex.sub(FlagReplace,flag) for flag in flags]
72+
73+
74 def main():
75 # If this is run on non-Linux platforms, just return nothing and indicate
76 # success. This allows us to "kind of emulate" a Linux build from other
77 # platforms.
78- if "linux" not in sys.platform:
79+ if "linux" not in sys.platform and 'win32' not in sys.platform:
80 print("[[],[],[],[],[]]")
81 return 0
82
83@@ -128,6 +154,9 @@ def main():
84 parser.add_option('--dridriverdir', action='store_true', dest='dridriverdir')
85 parser.add_option('--version-as-components', action='store_true',
86 dest='version_as_components')
87+ parser.add_option('--pkg_config_libdir', action='store', dest='pkg_config_libdir',
88+ type='string')
89+ parser.add_option('--full-path-libs', action='store_true', dest='full_path_libs')
90 (options, args) = parser.parse_args()
91
92 # Make a list of regular expressions to strip out.
93@@ -144,6 +173,10 @@ def main():
94 else:
95 prefix = ''
96
97+ # Override PKG_CONFIG_LIBDIR
98+ if options.pkg_config_libdir:
99+ os.environ['PKG_CONFIG_LIBDIR'] = options.pkg_config_libdir
100+
101 if options.atleast_version:
102 # When asking for the return value, just run pkg-config and print the return
103 # value, no need to do other work.
104@@ -203,7 +236,7 @@ def main():
105 # For now just split on spaces to get the args out. This will break if
106 # pkgconfig returns quoted things with spaces in them, but that doesn't seem
107 # to happen in practice.
108- all_flags = flag_string.strip().split(' ')
109+ all_flags = ConvertGCCToMSVC(flag_string.strip().split(' '))
110
111
112 sysroot = options.sysroot
113@@ -220,7 +253,10 @@ def main():
114 continue;
115
116 if flag[:2] == '-l':
117- libs.append(RewritePath(flag[2:], prefix, sysroot))
118+ library = RewritePath(flag[2:], prefix, sysroot)
119+ # Skip math library on MSVC
120+ if library != 'm.lib':
121+ libs.append(library)
122 elif flag[:2] == '-L':
123 lib_dirs.append(RewritePath(flag[2:], prefix, sysroot))
124 elif flag[:2] == '-I':
125@@ -237,6 +273,14 @@ def main():
126 else:
127 cflags.append(flag)
128
129+ if options.full_path_libs:
130+ full_path_libs = []
131+ for lib_dir in lib_dirs:
132+ for lib in libs:
133+ if os.path.isfile(lib_dir+"/"+lib):
134+ full_path_libs.append(lib_dir+"/"+lib)
135+ libs = full_path_libs
136+
137 # Output a GN array, the first one is the cflags, the second are the libs. The
138 # JSON formatter prints GN compatible lists when everything is a list of
139 # strings.
140diff --git a/config/linux/pkg_config.gni b/config/linux/pkg_config.gni
141index 428e44ac0..a0d2175ee 100644
142--- a/config/linux/pkg_config.gni
143+++ b/config/linux/pkg_config.gni
144@@ -45,6 +45,9 @@ declare_args() {
145 # in similar fashion by setting the `system_libdir` variable in the build's
146 # args.gn file to 'lib' or 'lib64' as appropriate for the target architecture.
147 system_libdir = "lib"
148+
149+ # Allow directly overriding the PKG_CONFIG_LIBDIR enviroment variable
150+ pkg_config_libdir = ""
151 }
152
153 pkg_config_script = "//build/config/linux/pkg-config.py"
154@@ -87,6 +90,17 @@ if (host_pkg_config != "") {
155 host_pkg_config_args = pkg_config_args
156 }
157
158+if (pkg_config_libdir != "") {
159+ pkg_config_args += [
160+ "--pkg_config_libdir",
161+ pkg_config_libdir,
162+ ]
163+ host_pkg_config_args += [
164+ "--pkg_config_libdir",
165+ pkg_config_libdir,
166+ ]
167+}
168+
169 template("pkg_config") {
170 assert(defined(invoker.packages),
171 "Variable |packages| must be defined to be a list in pkg_config.")
172diff --git a/util/lastchange.py b/util/lastchange.py
173index 874870ad5..a4fc0be8d 100644
174--- a/util/lastchange.py
175+++ b/util/lastchange.py
176@@ -191,7 +191,10 @@ def GetGitTopDirectory(source_dir):
177 Returns:
178 The output of "git rev-parse --show-toplevel" as a string
179 """
180- return _RunGitCommand(source_dir, ['rev-parse', '--show-toplevel'])
181+ directory = _RunGitCommand(source_dir, ['rev-parse', '--show-toplevel'])
182+ if "GCC" in sys.version and sys.platform=='win32':
183+ return subprocess.check_output(["cygpath", "-w", directory]).strip(b"\n").decode()
184+ return directory
185
186
187 def WriteIfChanged(file_name, contents):