blob: 963fd60e37e486f919b2069e904febdf76510120 [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001# SPDX-License-Identifier: MIT
2#
3# Copyright (c) 2021 Arm Limited
4#
5
6SUMMARY = "Android Clang compiler"
7DESCRIPTION = "Android Clang compiler, version r416183b. This is based on Clang 12.0.5 \
8Intended usage is to build kernel images that match the output of the Android (hermetic) \
9build system"
10
11LICENSE = "MIT"
12
13LIC_FILES_CHKSUM = "file://MODULE_LICENSE_MIT;md5=d41d8cd98f00b204e9800998ecf8427e"
14
15ANDROID_CLANG_VERSION = "clang-r416183b"
16ANDROID_CLANG_HASH = "bd96dfe349c962681f0e5388af874c771ef96670"
17
18COMPATIBLE_HOST = "x86_64.*-linux"
19
20SRC_URI = "https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/${ANDROID_CLANG_HASH}/${ANDROID_CLANG_VERSION}.tar.gz;subdir=${ANDROID_CLANG_VERSION}"
21
22# We need to set the checksum to "ignore" because the tarball is dynamically generated and has a new checksum every time
23# (the contents are the same, but the time stamp differs)
24BB_STRICT_CHECKSUM = "ignore"
25
26S = "${WORKDIR}/${ANDROID_CLANG_VERSION}"
27
28FILES:${PN} = "${libexecdir} ${bindir}"
29
30do_install() {
31 install -d ${D}${libexecdir}/${ANDROID_CLANG_VERSION}/
32
33 cp --no-preserve=ownership -r ${S}/. ${D}${libexecdir}/${ANDROID_CLANG_VERSION}/
34 # Strip bad RPATHs in the embedded python3
35 chrpath -d ${D}${libexecdir}/${ANDROID_CLANG_VERSION}/python3/lib/python*/lib-dynload/*.so
36
37 install -d ${D}${bindir}
38 # Symlink all executables into bindir
39 for f in ${D}${libexecdir}/${ANDROID_CLANG_VERSION}/bin/*; do
40 ln -rs $f ${D}${bindir}/$(basename $f)
41 done
42}
43
44INHIBIT_DEFAULT_DEPS = "1"
45
46INSANE_SKIP:${PN} = "already-stripped libdir staticdev file-rdeps arch dev-so"
47
48INHIBIT_SYSROOT_STRIP = "1"
49INHIBIT_PACKAGE_STRIP = "1"
50INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
51
52BBCLASSEXTEND = "native nativesdk"