[LTP] [RFC PATCH v2 1/2] Add 'make check' and clang-check to build system

Joerg Vehlow lkml@jv-coder.de
Mon Jun 7 11:18:55 CEST 2021


Hi,

On 6/4/2021 1:14 PM, Richard Palethorpe via ltp wrote:
> diff --git a/tools/clang-check/Makefile b/tools/clang-check/Makefile
> new file mode 100644
> index 000000000..4650d6057
> --- /dev/null
> +++ b/tools/clang-check/Makefile
> @@ -0,0 +1,14 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2021 SUSE LLC <rpalethorpe@suse.com>
> +# Copyright (c) 2019 Cyril Hrubis <chrubis@suse.cz>
> +# Copyright (c) 2020 Petr Vorel <pvorel@suse.cz>
> +
> +top_srcdir		?= ../..
> +
> +include $(top_srcdir)/include/mk/env_pre.mk
> +include $(top_srcdir)/include/mk/functions.mk
> +
> +HOST_MAKE_TARGETS	:= main
> +HOST_LDFLAGS 		+= -lclang
If anyone else trying this has problems linking the tool, at least for 
me, this must be
HOST_LDLIBS         += -lclang

Otherwise the link order is wrong (main.c after -lclang) and all symbols 
from libclang are undefined.

Jörg


More information about the ltp mailing list