Re: [LTP] [PATCH 1/2] hugemmap15: Compile with -O

Tarun Sahu
2023-01-26T21:05:35Z

Hi Petr, Cyril, all

Though It already got merged, please note this,

IIRC, I specifically turned off optimization for hugemmap15
because of clang compiler issue, it behaves weirdly with clang
without -O0 and test fails on the system.

Petr Vorel <pvorel@suse.cz> writes:

> -O0 originally used causes warning on gcc 12:
>
> In file included from /usr/include/bits/libc-header-start.h:33,
> from /usr/include/stdio.h:27,
> from hugemmap15.c:22:
> /usr/include/features.h:412:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
> 412 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
>
> Fixes: 15625f6185 ("Hugetlb: Migrating libhugetlbfs icache-hygiene")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> testcases/kernel/mem/hugetlb/hugemmap/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> index 6f10807cde..503a35f7f1 100644
> --- a/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> @@ -8,5 +8,5 @@ include $(top_srcdir)/include/mk/testcases.mk
> include $(abs_srcdir)/../Makefile.inc
> include $(top_srcdir)/include/mk/generic_leaf_target.mk
>
> -hugemmap15: CFLAGS+=-O0
> +hugemmap15: CFLAGS+=-O
> hugemmap06: CFLAGS+=-pthread
> --
> 2.39.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp