[LTP] [PATCH v3 2/3] testcase: make use of .supported_archs

Cyril Hrubis chrubis@suse.cz
Mon Nov 8 13:41:36 CET 2021


Hi!
>  	asm volatile (
>  		"add $0x400, %%esp\n\t"
>  		"int $0x80\n\t"
> @@ -114,15 +112,14 @@ static void run(void)
>  
>  static struct tst_test test = {
>  	.test_all = run,
> +	.supported_archs = (const char *const []) {
> +		"i386",
> +		"ppc",
> +		NULL
> +	},
>  	.tags = (const struct tst_tag[]) {
>  		{"linux-git", "cf01fb9985e8"},
>  		{"CVE", "CVE-2017-7616"},
>  		{}
>  	}
>  };
> -
> -#else /* #if defined(__x86_64__) || defined(__powerpc__) */
> -
> -TST_TEST_TCONF("not i386 or powerpc");
> -
> -#endif /* #else #if defined(__x86_64__) || defined(__powerpc__) */

Accordingly to this table:

https://wiki.debian.org/ArchitectureSpecificsMemo

__powerpc__ matches both 32bit and 64bit variants.

I guess that we would have to change the checks in the library as:

#ifdef __powerpc__
# ifdef __powerpc64__ || __ppc64__
.arch = "ppc64",
.type = TST_PPC64,
# else
.arch = "ppc",
.type = "TST_PPC"
# endif
#endif

Also I guess that gcc does not define __x86__ for historical reasons and
__i386__ really means __x86__, but I haven't checked that one.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list