diff options
author | Andy Lutomirski <luto@kernel.org> | 2015-05-12 01:11:36 +0300 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2015-05-13 05:02:40 +0300 |
commit | e9886ace222eb48bb57bd541320056ca334bd3a0 (patch) | |
tree | 11c057e7a46cff720383c099edbee96eec4b60e6 /tools/testing/selftests/x86/trivial_64bit_program.c | |
parent | c1e6e5cb941b54c2e7e84d9a796c1ad8377f44da (diff) | |
download | linux-e9886ace222eb48bb57bd541320056ca334bd3a0.tar.xz |
selftests, x86: Rework x86 target architecture detection
We currently fail to build on a non-multilib x86_64 target. We
print a helpful error, but it's nicer to allow the build to succeed.
Fix it and improve cross-compilation support by detecting
architecture support directly and building only the relevant tests.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/x86/trivial_64bit_program.c')
-rw-r--r-- | tools/testing/selftests/x86/trivial_64bit_program.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/testing/selftests/x86/trivial_64bit_program.c b/tools/testing/selftests/x86/trivial_64bit_program.c new file mode 100644 index 000000000000..b994946c40fb --- /dev/null +++ b/tools/testing/selftests/x86/trivial_64bit_program.c @@ -0,0 +1,18 @@ +/* + * Trivial program to check that we have a valid 32-bit build environment. + * Copyright (c) 2015 Andy Lutomirski + * GPL v2 + */ + +#ifndef __x86_64__ +# error wrong architecture +#endif + +#include <stdio.h> + +int main() +{ + printf("\n"); + + return 0; +} |