The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Ian Rogers <irogers@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf docs: Mark the Android document as obsolete
Date: Mon, 15 Jul 2024 21:36:38 +0100	[thread overview]
Message-ID: <f316e3ce-e1e3-45f0-ac78-9af590b58706@arm.com> (raw)
In-Reply-To: <CAP-5=fWY4AeMxfNGh_jB4gss_qtGSgfX4pvv-D-fpCWuqamVfA@mail.gmail.com>

On 7/15/2024 9:06 PM, Ian Rogers wrote:

[...]

> So if I add (somewhat taken from tools/testing/selftests/lib.mk):
> ```
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 5271a4c1d2b3..9edf5f41d6e4 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -19,6 +19,35 @@ detected_var = $(shell echo "$(1)=$($(1))" >>
> $(OUTPUT).config-detected)
> CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
> HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
> 
> +CLANG := clang
> +
> +CLANG_TARGET_FLAGS_arm          := arm-linux-gnueabi
> +CLANG_TARGET_FLAGS_arm64        := aarch64-linux-gnu
> +CLANG_TARGET_FLAGS_hexagon      := hexagon-linux-musl
> +CLANG_TARGET_FLAGS_i386         := i386-linux-gnu
> +CLANG_TARGET_FLAGS_m68k         := m68k-linux-gnu
> +CLANG_TARGET_FLAGS_mips         := mipsel-linux-gnu
> +CLANG_TARGET_FLAGS_powerpc      := powerpc64le-linux-gnu
> +CLANG_TARGET_FLAGS_riscv        := riscv64-linux-gnu
> +CLANG_TARGET_FLAGS_s390         := s390x-linux-gnu
> +CLANG_TARGET_FLAGS_x86          := x86_64-linux-gnu
> +CLANG_TARGET_FLAGS_x86_64       := x86_64-linux-gnu
> +
> +# Default to host architecture if ARCH is not explicitly given.
> +ifeq ($(ARCH),)
> +CLANG_TARGET_FLAGS := $(shell $(CLANG) -print-target-triple)
> +else
> +CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(ARCH))
> +endif
> +
> +ifeq ($(CLANG_TARGET_FLAGS),)
> +$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk)
> +else
> +CLANG_FLAGS     += --target=$(CLANG_TARGET_FLAGS)
> +endif # CLANG_TARGET_FLAGS
> +
> +CC := $(CLANG) $(CLANG_FLAGS) -fintegrated-as
> +
> # Enabled Wthread-safety analysis for clang builds.
> ifeq ($(CC_NO_CLANG), 0)
>   CFLAGS += -Wthread-safety
> ```
> I was able to build with:
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C tools/perf
> O=/tmp/perf NO_LIBELF=1 NO_LIBTRACEEVENT=1 NO_LIBPYTHON=1 CC=clang
> CXX=clang++

This command doesn't work for me.

Built with 'CROSS_COMPILE=aarch64-linux-gnu-' option, the perf tool is still
built with GCC:

  $ strings perf | grep GCC
  GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

After removing the option 'CROSS_COMPILE=aarch64-linux-gnu-', still failed
building.

Anyway, thanks a lot for sharing.

Leo

> Obviously not a complete fix as it is unconditionally forcing CC to
> clang, but I don't think we're too far from having a clang/llvm cross
> compile build that can work.
> 
> Thanks,
> Ian

  reply	other threads:[~2024-07-15 20:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 14:33 [PATCH v2] perf docs: Mark the Android document as obsolete Leo Yan
2024-07-15 15:29 ` James Clark
2024-07-15 17:17 ` Ian Rogers
2024-07-15 19:31   ` Leo Yan
2024-07-15 19:44     ` Ian Rogers
2024-07-15 20:06       ` Ian Rogers
2024-07-15 20:36         ` Leo Yan [this message]
2024-07-15 21:21           ` Ian Rogers
2024-07-16 10:06             ` Leo Yan
2024-07-16 13:30               ` Ian Rogers
2024-07-16 13:49                 ` Leo Yan
2024-07-16 15:05                   ` Ian Rogers
2024-07-16 15:41                     ` Leo Yan
2024-07-15 20:10       ` Leo Yan
2024-07-16  9:10   ` James Clark
2024-07-16 10:40     ` Leo Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f316e3ce-e1e3-45f0-ac78-9af590b58706@arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=justinstitt@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=morbo@google.com \
    --cc=namhyung@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox