All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Rossi <issor.oruam@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Chih-Wei Huang <cwhuang@android-x86.org>,
	 clang-built-linux <llvm@lists.linux.dev>
Subject: Re: Android 11 clang toochain: kernel 5.18 build error with 32 bit target
Date: Tue, 26 Apr 2022 22:16:38 +0200	[thread overview]
Message-ID: <CAEQFVGaUOQhCCceNzivzsR7XeNFrau48BuV-nf7CnSw7YauVoQ@mail.gmail.com> (raw)
In-Reply-To: <CAEQFVGYpPaE3cCxUBaiT97GU1i4Nr6yJdv6mU1kiCxqkLSMfBQ@mail.gmail.com>

> So I will report on x86 32bit target build attempt with
> android-12.1.0_r4 / clang version 12.0.7

I have found that the parameters passed along with make
can improve a lot the build of kernel with aosp toolchain,
by using the following ones used with clang 12.0.7 shipped with Android 12
do not show the aforementioned 32bit building error

CROSS_COMPILE := $(abspath $(TARGET_TOOLS_PREFIX))
KERNEL_CLANG_FLAGS := \
        LLVM=1 \
        CC=$(abspath $(LLVM_PREBUILTS_PATH)/clang) \
        LD=$(abspath $(LLVM_PREBUILTS_PATH)/ld.lld) \
        AR=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-ar) \
        NM=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-nm) \
        OBJCOPY=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-objcopy) \
        OBJDUMP=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-objdump) \
        READELF=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-readelf) \
        OBJSIZE=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-size) \
        STRIP=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-strip) \
        HOSTCC=$(abspath $(LLVM_PREBUILTS_PATH)/clang) \
        HOSTCXX=$(abspath $(LLVM_PREBUILTS_PATH)/clang++) \
        HOSTLD=$(abspath $(LLVM_PREBUILTS_PATH)/ld.lld) \
        HOSTLDFLAGS=-fuse-ld=lld \
        HOSTAR=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-ar)

Having had this good result with Android 12,
I have tried the same approach with Android 11 (clang 11.0.2) and it worked.
I have applied the change it in our official kernel build rules for Android 11

[1] http://git.osdn.net/view?p=android-x86/device-generic-common.git;a=commitdiff;h=43c43d0d1086672ec7fcea2f0fd91ad4a36ab16f;hp=368b6004e1362687b2add401d5f9a84e8ace370a

Maybe the problem was induced by CROSS_COMPILE := x86_64-linux-androidkernel-
or CROSS_COMPILE := $(abspath $(TARGET_TOOLS_PREFIX)), and the rest,
act as a Workaround

Thank you
Mauro

  parent reply	other threads:[~2022-04-26 20:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAEQFVGb2aXVu7eys5PM=xZ7gtzdap_QyRrzi3WzY83ka=heOwQ@mail.gmail.com>
     [not found] ` <CAK8P3a0Lwtm86wYH+0yFtr=Luc6g3OLu_+vzZaJqxDxNHFmQDQ@mail.gmail.com>
2022-04-25 18:04   ` Android 11 clang toochain: kernel 5.18 build error with 32 bit target Nick Desaulniers
2022-04-25 19:13     ` Mauro Rossi
2022-04-26 12:21       ` Arnd Bergmann
2022-04-26 18:24         ` Nathan Chancellor
2022-04-26 19:23           ` Nick Desaulniers
2022-04-26 19:31             ` Nick Desaulniers
2022-04-26 19:46               ` Nick Desaulniers
2022-04-26 20:16       ` Mauro Rossi [this message]
2022-04-26 22:23         ` Mauro Rossi
2022-04-28 22:28           ` Mauro Rossi
2022-05-01 18:40             ` Mauro Rossi
2022-05-12  0:36               ` Nick Desaulniers

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=CAEQFVGaUOQhCCceNzivzsR7XeNFrau48BuV-nf7CnSw7YauVoQ@mail.gmail.com \
    --to=issor.oruam@gmail.com \
    --cc=arnd@arndb.de \
    --cc=cwhuang@android-x86.org \
    --cc=llvm@lists.linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.