Add patch to fix order of CFLAGS and drop dropped patch
[deb_dpdk.git] / debian / patches / mk-order-CFLAGS-so-that-ISCDIR-comes-before-IRTE_OUT.patch
1 Description: mk: set -ISCDIR before -IRTE_OUT/include in CFLAGS
2
3 A race condition can happen during parallel builds, where a header
4 might be installed in RTE_OUT/include before CFLAGS is recursively
5 expanded. This causes GCC to sometimes pick the header path as
6 SRCDIR/... and sometimes as RTE_OUT/include/... making the build
7 unreproducible, as the full path is used for the expansion of
8 __FILE__ and in the DWARF directory listing.
9 Always pass -ISRCDIR first to CFLAGS so that it's deterministic.
10
11 Origin: http://dpdk.org/dev/patchwork/patch/25866/
12 Forwarded: yes
13 Author: Luca Boccassi <luca.boccassi@gmail.com>
14 Last-Update: 2017-06-28
15 ---
16  lib/librte_acl/Makefile          | 10 ++++++++--
17  lib/librte_bitratestats/Makefile |  9 ++++++++-
18  lib/librte_cmdline/Makefile      |  9 ++++++++-
19  lib/librte_distributor/Makefile  | 10 ++++++++--
20  lib/librte_efd/Makefile          | 10 ++++++++--
21  lib/librte_hash/Makefile         | 10 ++++++++--
22  lib/librte_ip_frag/Makefile      | 10 ++++++++--
23  lib/librte_jobstats/Makefile     | 10 ++++++++--
24  lib/librte_kni/Makefile          |  9 ++++++++-
25  lib/librte_kvargs/Makefile       |  9 ++++++++-
26  lib/librte_latencystats/Makefile |  9 ++++++++-
27  lib/librte_lpm/Makefile          | 10 ++++++++--
28  lib/librte_mbuf/Makefile         |  9 ++++++++-
29  lib/librte_mempool/Makefile      |  9 ++++++++-
30  lib/librte_metrics/Makefile      |  9 ++++++++-
31  lib/librte_net/Makefile          |  9 ++++++++-
32  lib/librte_pdump/Makefile        | 10 ++++++++--
33  lib/librte_power/Makefile        |  9 ++++++++-
34  lib/librte_reorder/Makefile      | 10 ++++++++--
35  lib/librte_ring/Makefile         |  9 ++++++++-
36  lib/librte_timer/Makefile        |  9 ++++++++-
37  lib/librte_vhost/Makefile        |  9 ++++++++-
38  22 files changed, 176 insertions(+), 31 deletions(-)
39
40 diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
41 index e2dacd606..470ef6d21 100644
42 --- a/lib/librte_acl/Makefile
43 +++ b/lib/librte_acl/Makefile
44 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
45  # library name
46  LIB = librte_acl.a
47  
48 -CFLAGS += -O3
49 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
50 +# Include the source dir first, so that headers paths are always picked
51 +# from there. By including it last race conditions might happen during paralle
52 +# builds, and headers might be already installed in RTE_OUT/include when the
53 +# variable is recursively expanded, thus causing GCC to sometimes use the
54 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
55 +# reproducible.
56 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
57 +CFLAGS += $(WERROR_FLAGS) -O3
58  
59  EXPORT_MAP := rte_acl_version.map
60  
61 diff --git a/lib/librte_bitratestats/Makefile b/lib/librte_bitratestats/Makefile
62 index 58a20ea09..26a3f4908 100644
63 --- a/lib/librte_bitratestats/Makefile
64 +++ b/lib/librte_bitratestats/Makefile
65 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
66  # library name
67  LIB = librte_bitratestats.a
68  
69 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
70 +# Include the source dir first, so that headers paths are always picked
71 +# from there. By including it last race conditions might happen during paralle
72 +# builds, and headers might be already installed in RTE_OUT/include when the
73 +# variable is recursively expanded, thus causing GCC to sometimes use the
74 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
75 +# reproducible.
76 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
77 +CFLAGS += $(WERROR_FLAGS) -O3
78  
79  EXPORT_MAP := rte_bitratestats_version.map
80  
81 diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
82 index 644f68e47..9dd75f2d2 100644
83 --- a/lib/librte_cmdline/Makefile
84 +++ b/lib/librte_cmdline/Makefile
85 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
86  # library name
87  LIB = librte_cmdline.a
88  
89 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
90 +# Include the source dir first, so that headers paths are always picked
91 +# from there. By including it last race conditions might happen during paralle
92 +# builds, and headers might be already installed in RTE_OUT/include when the
93 +# variable is recursively expanded, thus causing GCC to sometimes use the
94 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
95 +# reproducible.
96 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
97 +CFLAGS += $(WERROR_FLAGS) -O3
98  
99  EXPORT_MAP := rte_cmdline_version.map
100  
101 diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
102 index 3ffb911ce..87418f254 100644
103 --- a/lib/librte_distributor/Makefile
104 +++ b/lib/librte_distributor/Makefile
105 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
106  # library name
107  LIB = librte_distributor.a
108  
109 -CFLAGS += -O3
110 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
111 +# Include the source dir first, so that headers paths are always picked
112 +# from there. By including it last race conditions might happen during paralle
113 +# builds, and headers might be already installed in RTE_OUT/include when the
114 +# variable is recursively expanded, thus causing GCC to sometimes use the
115 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
116 +# reproducible.
117 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
118 +CFLAGS += $(WERROR_FLAGS) -O3
119  
120  EXPORT_MAP := rte_distributor_version.map
121  
122 diff --git a/lib/librte_efd/Makefile b/lib/librte_efd/Makefile
123 index b9277bc5d..b169e3240 100644
124 --- a/lib/librte_efd/Makefile
125 +++ b/lib/librte_efd/Makefile
126 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
127  # library name
128  LIB = librte_efd.a
129  
130 -CFLAGS += -O3
131 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
132 +# Include the source dir first, so that headers paths are always picked
133 +# from there. By including it last race conditions might happen during paralle
134 +# builds, and headers might be already installed in RTE_OUT/include when the
135 +# variable is recursively expanded, thus causing GCC to sometimes use the
136 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
137 +# reproducible.
138 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
139 +CFLAGS += $(WERROR_FLAGS) -O3
140  
141  EXPORT_MAP := rte_efd_version.map
142  
143 diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
144 index d856aa26d..e408dcc46 100644
145 --- a/lib/librte_hash/Makefile
146 +++ b/lib/librte_hash/Makefile
147 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
148  # library name
149  LIB = librte_hash.a
150  
151 -CFLAGS += -O3
152 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
153 +# Include the source dir first, so that headers paths are always picked
154 +# from there. By including it last race conditions might happen during paralle
155 +# builds, and headers might be already installed in RTE_OUT/include when the
156 +# variable is recursively expanded, thus causing GCC to sometimes use the
157 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
158 +# reproducible.
159 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
160 +CFLAGS += $(WERROR_FLAGS) -O3
161  
162  EXPORT_MAP := rte_hash_version.map
163  
164 diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
165 index 4e693bf8f..de45ec2d3 100644
166 --- a/lib/librte_ip_frag/Makefile
167 +++ b/lib/librte_ip_frag/Makefile
168 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
169  # library name
170  LIB = librte_ip_frag.a
171  
172 -CFLAGS += -O3
173 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
174 +# Include the source dir first, so that headers paths are always picked
175 +# from there. By including it last race conditions might happen during paralle
176 +# builds, and headers might be already installed in RTE_OUT/include when the
177 +# variable is recursively expanded, thus causing GCC to sometimes use the
178 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
179 +# reproducible.
180 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
181 +CFLAGS += $(WERROR_FLAGS) -O3
182  
183  EXPORT_MAP := rte_ipfrag_version.map
184  
185 diff --git a/lib/librte_jobstats/Makefile b/lib/librte_jobstats/Makefile
186 index 561a0678c..57329b18e 100644
187 --- a/lib/librte_jobstats/Makefile
188 +++ b/lib/librte_jobstats/Makefile
189 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
190  # library name
191  LIB = librte_jobstats.a
192  
193 -CFLAGS += -O3
194 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
195 +# Include the source dir first, so that headers paths are always picked
196 +# from there. By including it last race conditions might happen during paralle
197 +# builds, and headers might be already installed in RTE_OUT/include when the
198 +# variable is recursively expanded, thus causing GCC to sometimes use the
199 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
200 +# reproducible.
201 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
202 +CFLAGS += $(WERROR_FLAGS) -O3
203  
204  EXPORT_MAP := rte_jobstats_version.map
205  
206 diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
207 index 70f1ca8f6..130d6fd74 100644
208 --- a/lib/librte_kni/Makefile
209 +++ b/lib/librte_kni/Makefile
210 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
211  # library name
212  LIB = librte_kni.a
213  
214 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
215 +# Include the source dir first, so that headers paths are always picked
216 +# from there. By including it last race conditions might happen during paralle
217 +# builds, and headers might be already installed in RTE_OUT/include when the
218 +# variable is recursively expanded, thus causing GCC to sometimes use the
219 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
220 +# reproducible.
221 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
222 +CFLAGS += $(WERROR_FLAGS) -O3 -fno-strict-aliasing
223  
224  EXPORT_MAP := rte_kni_version.map
225  
226 diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
227 index 564dd3102..7c332c110 100644
228 --- a/lib/librte_kvargs/Makefile
229 +++ b/lib/librte_kvargs/Makefile
230 @@ -36,7 +36,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
231  # library name
232  LIB = librte_kvargs.a
233  
234 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
235 +# Include the source dir first, so that headers paths are always picked
236 +# from there. By including it last race conditions might happen during paralle
237 +# builds, and headers might be already installed in RTE_OUT/include when the
238 +# variable is recursively expanded, thus causing GCC to sometimes use the
239 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
240 +# reproducible.
241 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
242 +CFLAGS += $(WERROR_FLAGS) -O3
243  
244  EXPORT_MAP := rte_kvargs_version.map
245  
246 diff --git a/lib/librte_latencystats/Makefile b/lib/librte_latencystats/Makefile
247 index eaacbb731..46a8ecd34 100644
248 --- a/lib/librte_latencystats/Makefile
249 +++ b/lib/librte_latencystats/Makefile
250 @@ -33,7 +33,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
251  # library name
252  LIB = librte_latencystats.a
253  
254 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
255 +# Include the source dir first, so that headers paths are always picked
256 +# from there. By including it last race conditions might happen during paralle
257 +# builds, and headers might be already installed in RTE_OUT/include when the
258 +# variable is recursively expanded, thus causing GCC to sometimes use the
259 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
260 +# reproducible.
261 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
262 +CFLAGS += $(WERROR_FLAGS) -O3
263  LDLIBS += -lm
264  LDLIBS += -lpthread
265  
266 diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
267 index 32be46b3b..6a97fdc97 100644
268 --- a/lib/librte_lpm/Makefile
269 +++ b/lib/librte_lpm/Makefile
270 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
271  # library name
272  LIB = librte_lpm.a
273  
274 -CFLAGS += -O3
275 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
276 +# Include the source dir first, so that headers paths are always picked
277 +# from there. By including it last race conditions might happen during paralle
278 +# builds, and headers might be already installed in RTE_OUT/include when the
279 +# variable is recursively expanded, thus causing GCC to sometimes use the
280 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
281 +# reproducible.
282 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
283 +CFLAGS += $(WERROR_FLAGS) -O3
284  
285  EXPORT_MAP := rte_lpm_version.map
286  
287 diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
288 index 548273054..4d51191ee 100644
289 --- a/lib/librte_mbuf/Makefile
290 +++ b/lib/librte_mbuf/Makefile
291 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
292  # library name
293  LIB = librte_mbuf.a
294  
295 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
296 +# Include the source dir first, so that headers paths are always picked
297 +# from there. By including it last race conditions might happen during paralle
298 +# builds, and headers might be already installed in RTE_OUT/include when the
299 +# variable is recursively expanded, thus causing GCC to sometimes use the
300 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
301 +# reproducible.
302 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
303 +CFLAGS += $(WERROR_FLAGS) -O3
304  
305  EXPORT_MAP := rte_mbuf_version.map
306  
307 diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
308 index 7b5bdfee7..33678192f 100644
309 --- a/lib/librte_mempool/Makefile
310 +++ b/lib/librte_mempool/Makefile
311 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
312  # library name
313  LIB = librte_mempool.a
314  
315 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
316 +# Include the source dir first, so that headers paths are always picked
317 +# from there. By including it last race conditions might happen during paralle
318 +# builds, and headers might be already installed in RTE_OUT/include when the
319 +# variable is recursively expanded, thus causing GCC to sometimes use the
320 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
321 +# reproducible.
322 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
323 +CFLAGS += $(WERROR_FLAGS) -O3
324  
325  EXPORT_MAP := rte_mempool_version.map
326  
327 diff --git a/lib/librte_metrics/Makefile b/lib/librte_metrics/Makefile
328 index d4990e839..195bd4d56 100644
329 --- a/lib/librte_metrics/Makefile
330 +++ b/lib/librte_metrics/Makefile
331 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
332  # library name
333  LIB = librte_metrics.a
334  
335 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
336 +# Include the source dir first, so that headers paths are always picked
337 +# from there. By including it last race conditions might happen during paralle
338 +# builds, and headers might be already installed in RTE_OUT/include when the
339 +# variable is recursively expanded, thus causing GCC to sometimes use the
340 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
341 +# reproducible.
342 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
343 +CFLAGS += $(WERROR_FLAGS) -O3
344  
345  EXPORT_MAP := rte_metrics_version.map
346  
347 diff --git a/lib/librte_net/Makefile b/lib/librte_net/Makefile
348 index 56727c4df..a08a7dd8b 100644
349 --- a/lib/librte_net/Makefile
350 +++ b/lib/librte_net/Makefile
351 @@ -33,7 +33,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
352  
353  LIB = librte_net.a
354  
355 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
356 +# Include the source dir first, so that headers paths are always picked
357 +# from there. By including it last race conditions might happen during paralle
358 +# builds, and headers might be already installed in RTE_OUT/include when the
359 +# variable is recursively expanded, thus causing GCC to sometimes use the
360 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
361 +# reproducible.
362 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
363 +CFLAGS += $(WERROR_FLAGS) -O3
364  
365  EXPORT_MAP := rte_net_version.map
366  LIBABIVER := 1
367 diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile
368 index 1c03bcbb7..8923d7499 100644
369 --- a/lib/librte_pdump/Makefile
370 +++ b/lib/librte_pdump/Makefile
371 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
372  # library name
373  LIB = librte_pdump.a
374  
375 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
376 -CFLAGS += -D_GNU_SOURCE
377 +# Include the source dir first, so that headers paths are always picked
378 +# from there. By including it last race conditions might happen during paralle
379 +# builds, and headers might be already installed in RTE_OUT/include when the
380 +# variable is recursively expanded, thus causing GCC to sometimes use the
381 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
382 +# reproducible.
383 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
384 +CFLAGS += $(WERROR_FLAGS) -O3 -D_GNU_SOURCE
385  LDLIBS += -lpthread
386  
387  EXPORT_MAP := rte_pdump_version.map
388 diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
389 index 06cd10e86..b76ad689e 100644
390 --- a/lib/librte_power/Makefile
391 +++ b/lib/librte_power/Makefile
392 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
393  # library name
394  LIB = librte_power.a
395  
396 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
397 +# Include the source dir first, so that headers paths are always picked
398 +# from there. By including it last race conditions might happen during paralle
399 +# builds, and headers might be already installed in RTE_OUT/include when the
400 +# variable is recursively expanded, thus causing GCC to sometimes use the
401 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
402 +# reproducible.
403 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
404 +CFLAGS += $(WERROR_FLAGS) -O3 -fno-strict-aliasing
405  
406  EXPORT_MAP := rte_power_version.map
407  
408 diff --git a/lib/librte_reorder/Makefile b/lib/librte_reorder/Makefile
409 index 4e44e72f0..51b5d490d 100644
410 --- a/lib/librte_reorder/Makefile
411 +++ b/lib/librte_reorder/Makefile
412 @@ -34,8 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
413  # library name
414  LIB = librte_reorder.a
415  
416 -CFLAGS += -O3
417 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
418 +# Include the source dir first, so that headers paths are always picked
419 +# from there. By including it last race conditions might happen during paralle
420 +# builds, and headers might be already installed in RTE_OUT/include when the
421 +# variable is recursively expanded, thus causing GCC to sometimes use the
422 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
423 +# reproducible.
424 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
425 +CFLAGS += $(WERROR_FLAGS) -O3
426  
427  EXPORT_MAP := rte_reorder_version.map
428  
429 diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
430 index 3e2f4b873..e5248a2c1 100644
431 --- a/lib/librte_ring/Makefile
432 +++ b/lib/librte_ring/Makefile
433 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
434  # library name
435  LIB = librte_ring.a
436  
437 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
438 +# Include the source dir first, so that headers paths are always picked
439 +# from there. By including it last race conditions might happen during paralle
440 +# builds, and headers might be already installed in RTE_OUT/include when the
441 +# variable is recursively expanded, thus causing GCC to sometimes use the
442 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
443 +# reproducible.
444 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
445 +CFLAGS += $(WERROR_FLAGS) -O3
446  
447  EXPORT_MAP := rte_ring_version.map
448  
449 diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
450 index 03a15390e..0c57cc6d3 100644
451 --- a/lib/librte_timer/Makefile
452 +++ b/lib/librte_timer/Makefile
453 @@ -34,7 +34,14 @@ include $(RTE_SDK)/mk/rte.vars.mk
454  # library name
455  LIB = librte_timer.a
456  
457 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
458 +# Include the source dir first, so that headers paths are always picked
459 +# from there. By including it last race conditions might happen during parallel
460 +# builds, and headers might be already installed in RTE_OUT/include when the
461 +# variable is recursively expanded, thus causing GCC to sometimes use the
462 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
463 +# reproducible.
464 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
465 +CFLAGS += $(WERROR_FLAGS) -O3
466  
467  EXPORT_MAP := rte_timer_version.map
468  
469 diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
470 index 4a116fe31..ef0d86990 100644
471 --- a/lib/librte_vhost/Makefile
472 +++ b/lib/librte_vhost/Makefile
473 @@ -38,7 +38,14 @@ EXPORT_MAP := rte_vhost_version.map
474  
475  LIBABIVER := 4
476  
477 -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64
478 +# Include the source dir first, so that headers paths are always picked
479 +# from there. By including it last race conditions might happen during parallel
480 +# builds, and headers might be already installed in RTE_OUT/include when the
481 +# variable is recursively expanded, thus causing GCC to sometimes use the
482 +# SRCDIR path and sometimes the RTE_OUT/include, making the builds not
483 +# reproducible.
484 +CFLAGS := -I$(SRCDIR) $(CFLAGS)
485 +CFLAGS += $(WERROR_FLAGS) -O3 -D_FILE_OFFSET_BITS=64
486  CFLAGS += -I vhost_user
487  LDLIBS += -lpthread
488  
489 -- 
490 2.11.0
491