Mailing List Archive

[master] 62a25a97b build: test-run our compiler in wflags.py
commit 62a25a97b0171aa1359687c9cbe9801e965893ca
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Thu Jun 10 12:43:39 2021 +0200

build: test-run our compiler in wflags.py

... to have a solid baseline

diff --git a/wflags.py b/wflags.py
index 7912f47c8..1778fd41b 100644
--- a/wflags.py
+++ b/wflags.py
@@ -83,17 +83,13 @@ UNDESIRABLE_WFLAGS = [.


def cc(compiler, opt, obj, src):
+ a = [compiler, "-c"]
+ if opt is not None:
+ a.append(opt)
+ a += ["-o", obj, src]
+
try:
- j = subprocess.check_output(
- [.
- compiler,
- "-c",
- opt,
- "-o", obj,
- src
- ],
- stderr=subprocess.STDOUT
- )
+ j = subprocess.check_output(a, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as err:
if err.output:
j = err.output
@@ -110,6 +106,12 @@ def main():
src_file.flush()
obj_file = tempfile.NamedTemporaryFile(suffix='.o')

+ j = cc(compiler, None, obj_file.name, src_file.name)
+ if j:
+ sys.stderr.write(compiler + " failed without flags\n\t" +
+ j.decode('utf8') + '\n')
+ sys.exit(1)
+
use_flags = []
for i in DESIRABLE_OPTIONS + DESIRABLE_WFLAGS + UNDESIRABLE_WFLAGS:
j = cc(compiler, i, obj_file.name, src_file.name)
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit