diff options
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r-- | mesonbuild/compilers.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index e9a798d..1915644 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -579,7 +579,7 @@ int main () {{ {1}; }}''' element_exists_templ = '''#include <stdio.h> {0} int main(int argc, char **argv) {{ - {1}; + {1} something; }} ''' templ = '''#include <stdio.h> @@ -622,6 +622,11 @@ int main(int argc, char **argv) { return int(res.stdout) def cross_alignment(self, typename, env, extra_args=[]): + type_exists_templ = '''#include <stdio.h> +int main(int argc, char **argv) {{ + {0} something; +}} +''' templ = '''#include<stddef.h> struct tmp { char c; @@ -634,6 +639,9 @@ int testarray[%d-offsetof(struct tmp, target)]; extra_args += env.cross_info.config['properties'][self.language + '_args'] except KeyError: pass + extra_args += self.get_no_optimization_args() + if not self.compiles(type_exists_templ.format(typename)): + return -1 for i in range(1, 1024): code = templ % (typename, i) if self.compiles(code, extra_args): |