Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame^] | 1 | # SPDX-License-Identifier: MIT |
| 2 | # |
| 3 | # Copyright (c) 2021 Arm Limited |
| 4 | # |
| 5 | |
| 6 | SUMMARY = "Android Clang compiler" |
| 7 | DESCRIPTION = "Android Clang compiler, version r416183b. This is based on Clang 12.0.5 \ |
| 8 | Intended usage is to build kernel images that match the output of the Android (hermetic) \ |
| 9 | build system" |
| 10 | |
| 11 | LICENSE = "MIT" |
| 12 | |
| 13 | LIC_FILES_CHKSUM = "file://MODULE_LICENSE_MIT;md5=d41d8cd98f00b204e9800998ecf8427e" |
| 14 | |
| 15 | ANDROID_CLANG_VERSION = "clang-r416183b" |
| 16 | ANDROID_CLANG_HASH = "bd96dfe349c962681f0e5388af874c771ef96670" |
| 17 | |
| 18 | COMPATIBLE_HOST = "x86_64.*-linux" |
| 19 | |
| 20 | SRC_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) |
| 24 | BB_STRICT_CHECKSUM = "ignore" |
| 25 | |
| 26 | S = "${WORKDIR}/${ANDROID_CLANG_VERSION}" |
| 27 | |
| 28 | FILES:${PN} = "${libexecdir} ${bindir}" |
| 29 | |
| 30 | do_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 | |
| 44 | INHIBIT_DEFAULT_DEPS = "1" |
| 45 | |
| 46 | INSANE_SKIP:${PN} = "already-stripped libdir staticdev file-rdeps arch dev-so" |
| 47 | |
| 48 | INHIBIT_SYSROOT_STRIP = "1" |
| 49 | INHIBIT_PACKAGE_STRIP = "1" |
| 50 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
| 51 | |
| 52 | BBCLASSEXTEND = "native nativesdk" |