From patchwork Tue Nov 5 18:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19CEAD33A24 for ; Tue, 5 Nov 2024 18:45:45 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.web11.27948.1730832344731378300 for ; Tue, 05 Nov 2024 10:45:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Xl9xcvnj; spf=pass (domain: gmail.com, ip: 209.85.216.54, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2e2e88cb0bbso4463402a91.3 for ; Tue, 05 Nov 2024 10:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832344; x=1731437144; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zfm8wq4m3z8TgkExhOrCZGbBrqKeiRKIB0szk8r0+Wc=; b=Xl9xcvnji105nj+xo1nzppG2KIIENH47tMSqEsEpeb7VA5KahZwtT8Wtt6hfZbHnl4 beRFt5toYyA63+G2n2TkxnHbApz5ISOSfOa1PntLBPedkA5yPB+v0Dn7p0/f+zLHi/B5 P8v93PD7M8bmLOXtWfnyROQ0724P4M571fO/UKiA7PWpK7bvfwjgE7Zr1iben4MhZwth E/Uh+yUnAum4kuGdPxkxZhmAOpBBOuI2YHjp1bMX464Pr1uYXJBapt1GONfN5wMApypQ XMQWWq6KN2HANtag/ysY9c1nCC43LZdzS7+egDNNg3DFanqS5feOYc2Ff+hRcI34JWjS UsMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832344; x=1731437144; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zfm8wq4m3z8TgkExhOrCZGbBrqKeiRKIB0szk8r0+Wc=; b=bUifXRzDJM5fEsKTSqGlhSXR9ZJclPZPyEcNYK5oo9bFH4P5//W1VRFFbmgrlHW9w/ 6xfyfkjEAMVTfhuAgJ3X8oF8ZfE8D8nI2DewVRq/6MvNQ3yHwlspGQeSKQWLP3f5NFyQ jRB0UJvSDrwOu2CwJfdRYdXhhhw/LUKpWObnsc1auoo8MpX7W/FuN9aqkEP6YMQnMUT/ qmvweuwMQol005QbMy87ih/hq5P8Zesxk+9lLa6Up6bciOrs29Tb0SVUDfB8BOV4+/8K UNK7izlX74WqxO+z0O4Sjn3qohYwtF7HNVMsI5RakVMQQaW1SoF5XvoFUxBig0hsbzT9 i+mA== X-Gm-Message-State: AOJu0YyKoXR1tqhf/1D77MKoTPrU6vOi4+33ZJjYfjFDw/YEWUsoy/ZE hqGphvnqkpdTHZ7g6blCKVDlmKpc66Zm/bUDFR4XoSjU73skNxugXS5gCg== X-Google-Smtp-Source: AGHT+IHd0aA6ieHEzMtpB/kR9pI9fO9Ivlu+wuiYI/X+OZPMjRWUtuB80Czir0ggjURKkUE/qQt8Kw== X-Received: by 2002:a17:90a:7c03:b0:2e2:e6fa:cfef with SMTP id 98e67ed59e1d1-2e8f11bad3emr37681569a91.25.1730832343869; Tue, 05 Nov 2024 10:45:43 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:43 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 01/19] clang.inc: Global settings for clang toolchain Date: Tue, 5 Nov 2024 10:45:20 -0800 Message-ID: <20241105184540.3450302-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206729 It is added to default distro include file Signed-off-by: Khem Raj --- meta/conf/distro/include/clang.inc | 147 +++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 meta/conf/distro/include/clang.inc diff --git a/meta/conf/distro/include/clang.inc b/meta/conf/distro/include/clang.inc new file mode 100644 index 00000000000..ce49bbc0ed1 --- /dev/null +++ b/meta/conf/distro/include/clang.inc @@ -0,0 +1,147 @@ +# Add the necessary override +CCACHE_COMPILERCHECK:toolchain-clang ?= "%compiler% -v" +HOST_CC_ARCH:prepend:toolchain-clang = "-target ${HOST_SYS} " +CC:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +CXX:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +CPP:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E" +CCLD:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +RANLIB:toolchain-clang = "${HOST_PREFIX}llvm-ranlib" +AR:toolchain-clang = "${HOST_PREFIX}llvm-ar" +NM:toolchain-clang = "${HOST_PREFIX}llvm-nm" +OBJDUMP:toolchain-clang = "${HOST_PREFIX}llvm-objdump" +OBJCOPY:toolchain-clang = "${HOST_PREFIX}llvm-objcopy" +STRIP:toolchain-clang = "${HOST_PREFIX}llvm-strip" +STRINGS:toolchain-clang = "${HOST_PREFIX}llvm-strings" +READELF:toolchain-clang = "${HOST_PREFIX}llvm-readelf" +LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '${HOST_PREFIX}ld.lld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', d)}" + +LTO:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}" + +COMPILER_RT ??= "" +COMPILER_RT:toolchain-clang:class-native = "-rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT:armeb = "-rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT:libc-klibc = "-rtlib=libgcc ${UNWINDLIB}" + +UNWINDLIB ??= "" +UNWINDLIB:toolchain-clang:class-native = "--unwindlib=libgcc" +UNWINDLIB:armeb = "--unwindlib=libgcc" +UNWINDLIB_libc-klibc = "--unwindlib=libgcc" + +LIBCPLUSPLUS ??= "" +LIBCPLUSPLUS:armv5 = "-stdlib=libstdc++" + +CXXFLAGS:append:toolchain-clang = " ${LIBCPLUSPLUS}" +LDFLAGS:append:toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}" + +TUNE_CCARGS:remove:toolchain-clang = "-meb" +TUNE_CCARGS:remove:toolchain-clang = "-mel" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" + +# Clang does not yet support big.LITTLE performance tunes, so use the LITTLE for tunes +TUNE_CCARGS:remove:toolchain-clang = "\ + -mcpu=cortex-a57.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \ + -mcpu=cortex-a72.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \ + -mcpu=cortex-a15.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \ + -mcpu=cortex-a17.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \ + -mcpu=cortex-a72.cortex-a35${TUNE_CCARGS_MARCH_OPTS} \ + -mcpu=cortex-a73.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \ + -mcpu=cortex-a75.cortex-a55${TUNE_CCARGS_MARCH_OPTS} \ + -mcpu=cortex-a76.cortex-a55${TUNE_CCARGS_MARCH_OPTS}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa53 cortexa57-cortexa53 cortexa73-cortexa53", " -mcpu=cortex-a53${TUNE_CCARGS_MARCH_OPTS}", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa15-cortexa7 cortexa17-cortexa7", " -mcpu=cortex-a7${TUNE_CCARGS_MARCH_OPTS}", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa35", " -mcpu=cortex-a35${TUNE_CCARGS_MARCH_OPTS}", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa75-cortexa55 cortexa76-cortexa55", " -mcpu=cortex-a55${TUNE_CCARGS_MARCH_OPTS}", "", d)}" + +# Workaround for https://github.com/llvm/llvm-project/issues/85699 +# needed for 64bit rpi3/rpi4 machines +TUNE_CCARGS_MARCH_OPTS:append:toolchain-clang = "${@bb.utils.contains_any("DEFAULTTUNE", "cortexa72 cortexa53", "+nocrypto", "", d)}" + +# Clang does not support octeontx2 processor +TUNE_CCARGS:remove:toolchain-clang = "-mcpu=octeontx2${TUNE_CCARGS_MARCH_OPTS}" + +# Reconcile some ppc anamolies +TUNE_CCARGS:remove:toolchain-clang:powerpc = "-mhard-float -mno-spe" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64 = " -mlong-double-64" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64le = " -mlong-double-64" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64" +# usrmerge workaround +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}" + +TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments" + +LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2" +LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2" +LDFLAGS:append:toolchain-clang:class-nativesdk:aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1" + +LDFLAGS:toolchain-clang:class-nativesdk = "${BUILDSDK_LDFLAGS} \ + -Wl,-rpath-link,${STAGING_LIBDIR}/.. \ + -Wl,-rpath,${libdir}/.. " + +# Enable lld globally" +LDFLAGS:append:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=lld', '', d)}" + +# Remove gcc specific -fcanon-prefix-map option, added in gcc-13+ +# clang does not support it yet +DEBUG_PREFIX_MAP:remove:toolchain-clang = "-fcanon-prefix-map" + +# choose between 'gcc' 'clang' an empty '' can be used as well +TOOLCHAIN ??= "gcc" +# choose between 'gnu' 'llvm' +TC_CXX_RUNTIME ??= "gnu" +# Using gcc or llvm runtime is only available when using clang for compiler +#TC_CXX_RUNTIME:toolchain-gcc = "gnu" +TC_CXX_RUNTIME:armeb = "gnu" +TC_CXX_RUNTIME:armv5 = "gnu" + +TOOLCHAIN:class-native = "gcc" +TOOLCHAIN:class-nativesdk = "gcc" +TOOLCHAIN:class-cross-canadian = "gcc" +TOOLCHAIN:class-crosssdk = "gcc" +TOOLCHAIN:class-cross = "gcc" + +OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}" +OVERRIDES =. "${@['', 'runtime-${TC_CXX_RUNTIME}:']['${TC_CXX_RUNTIME}' != '']}" +OVERRIDES[vardepsexclude] += "TOOLCHAIN TC_CXX_RUNTIME" + +YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config" +YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}" + +#YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target[export] = "1" +#YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target[export] = "1" + +#DEPENDS:append:toolchain-clang:class-target = " clang-cross-${TARGET_ARCH} " +#DEPENDS:remove:toolchain-clang:allarch = "clang-cross-${TARGET_ARCH}" + +def clang_base_deps(d): + ret = "" + if not d.getVar('INHIBIT_DEFAULT_DEPS', False): + if not oe.utils.inherits(d, 'allarch') : + ret += " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc" + if (d.getVar('TC_CXX_RUNTIME').find('android') != -1): + ret += " ${MLPREFIX}libcxx" + else: + ret += " virtual/${TARGET_PREFIX}compilerlibs ${MLPREFIX}compiler-rt ${MLPREFIX}libcxx" + return ret + +BASE_DEFAULT_DEPS:append:class-target:toolchain-clang:class-target = " ${@clang_base_deps(d)}" +BASE_DEFAULT_DEPS:append:class-native:toolchain-clang:runtime-llvm = " libcxx-native compiler-rt-native" +BASE_DEFAULT_DEPS:append:class-nativesdk:toolchain-clang:runtime-llvm = " clang-native nativesdk-libcxx nativesdk-compiler-rt" + +# do_populate_sysroot needs STRIP +POPULATESYSROOTDEPS:toolchain-clang:class-target = "${MLPREFIX}clang-cross-${TARGET_ARCH}:do_populate_sysroot" + +cmake_do_generate_toolchain_file:append:toolchain-clang () { + cat >> ${WORKDIR}/toolchain.cmake < X-Patchwork-Id: 51848 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B60CD33A2A for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web11.27949.1730832346183358803 for ; Tue, 05 Nov 2024 10:45:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WMoucxpT; spf=pass (domain: gmail.com, ip: 209.85.216.50, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2e2ed2230d8so4444159a91.0 for ; Tue, 05 Nov 2024 10:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832345; x=1731437145; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WIxFXtpKHxrMdUOi8MDXh/xaagA3leLLtFd/rD/iOm4=; b=WMoucxpTKKz11N71MCEU8A/aSPDeH2mx7LSmr9QbMNe0ky5I5409+T4iPOSLdk9ZZB 0oWfpXdhhIIvbaeGPEDsMOUPiazHES+w1DBzbQGlXyj4gcbpbwh5C7dchBbzlcd7WT0c cQonhQ3C+NMAV0d8B/59g2PJjanOYfryzoc259IcyZRJXrxtrgk+hyTuOvpLFzrJnTGV gusNPQrscPzwS/LEi8AUcvr9yr6XgsBfyA1i8jsmc4LHzfcR6ZnSzQQZlaWYwkq+idFK oo0Y3wPTR/y2OJFRy9CO2cxkV1nbZi9ZNmxqpPBJo2IU08cW+DiwsvwRUQOK5Y8sczkj j81A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832345; x=1731437145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WIxFXtpKHxrMdUOi8MDXh/xaagA3leLLtFd/rD/iOm4=; b=d/Bs0l49UXtYbPX63QV3Se71DixY5vQjZ2+SV6k30d7TPkkvnGxNR43E9a9YVpZpU3 1oKmZTBr0mhKJjQfrsHG1YhEEsdRY7eaFIknArYDwSCzQvt698w83KIUt8g9sIDiyToW syAjIzt49/+c2ZBcaWu2xAoRP3R5TcIQtVlipwQ2K7CbvGriEeFG72jbQ4VLvgPnn98E c33o53VRBkqrsabfQU9vO+9DqtznnnW4IB7wgXoXS6kSLWWY2rU9dvg81SdW6t1iIGU+ QuxktPtttNDC8jVbjJJz9Npv1r3s+jwRpVKtxZTrH04N3NMewOJ3Gn4l5hL7ugci4+Aq n04Q== X-Gm-Message-State: AOJu0YxMlJhWSFrQvedanpW39ERgrHOMxw4rmlBeubja/onAku1r+2b9 OAfhjZVVtBZY5qEXszivaYb/4IHvEI3y1yKKEjWYqW0tOtaHZy7pgOESNw== X-Google-Smtp-Source: AGHT+IHa4nkE7JmQ1TjQOYHJwSpAVKBhJ+h8Xn+eT6K0rT8qzVkK+RcbbnPeJBrbhROyyM0YtM5E7w== X-Received: by 2002:a17:90b:2681:b0:2c8:647:1600 with SMTP id 98e67ed59e1d1-2e94c2b082fmr23613402a91.9.1730832344866; Tue, 05 Nov 2024 10:45:44 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:44 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 02/19] nonclangable.inc: Add recipe which can not be built with clang Date: Tue, 5 Nov 2024 10:45:21 -0800 Message-ID: <20241105184540.3450302-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206730 Some need adjusting commandline variables and other parameters all get housed here Signed-off-by: Khem Raj --- meta/conf/distro/include/nonclangable.inc | 687 ++++++++++++++++++++++ 1 file changed, 687 insertions(+) create mode 100644 meta/conf/distro/include/nonclangable.inc diff --git a/meta/conf/distro/include/nonclangable.inc b/meta/conf/distro/include/nonclangable.inc new file mode 100644 index 00000000000..bb322447879 --- /dev/null +++ b/meta/conf/distro/include/nonclangable.inc @@ -0,0 +1,687 @@ + +TUNE_CCARGS:remove:toolchain-clang = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '-mbranch-protection=standard', '', d)}" + +# https://github.com/llvm/llvm-project/issues/78337 +TOOLCHAIN:pn-kernel-selftest = "gcc" + +# x86_64/musl build fails with +# gtk4/4.12.5/build/gtk/libgtk-4.so.1: unsupported relocation type 37 +TOOLCHAIN:pn-gtk4:libc-musl:x86-64 = "gcc" + +TOOLCHAIN:pn-cpufrequtils = "gcc" + +TOOLCHAIN:pn-grub:genericx86-64 = "gcc" +# | grub-mkimage: error: relocation 0x2b is not implemented yet. +TOOLCHAIN:pn-grub-efi:aarch64 = "gcc" +TOOLCHAIN:pn-grub-efi:riscv32 = "gcc" +# clang-15 crashes +TOOLCHAIN:pn-grub-efi:riscv64 = "gcc" +TOOLCHAIN:pn-grub:riscv64 = "gcc" +# | build-grub-module-verifier: error: search_label: unsupported relocation 0x108. +TOOLCHAIN:pn-grub:aarch64 = "gcc" +# crash embeds version of gdb which is not buildable with clang +TOOLCHAIN:pn-crash = "gcc" +# See https://github.com/llvm/llvm-project/issues/71925 +LIBCPLUSPLUS:pn-elfutils:toolchain-clang = "-stdlib=libstdc++" +#| erl_bits.c:(.text+0xc2a): undefined reference to `__extendhfsf2' +#| erl_bits.c:(.text+0x1bfa): undefined reference to `__truncsfhf2' +#| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) +# both riscv64 and x86-64 +TOOLCHAIN:pn-erlang = "gcc" + +# /mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/firefox/60.1.0esr-r0/recipe-sysroot-native/usr/lib/clang/7.0.1/include/arm_neon.h:433:1: error: unknown type name 'inline' +# __ai uint8x16_t vabdq_u8(uint8x16_t __p0, uint8x16_t __p1) { +TOOLCHAIN:pn-firefox = "gcc" +TOOLCHAIN:pn-gcc = "gcc" +TOOLCHAIN:pn-gcc-runtime = "gcc" +TOOLCHAIN:pn-gcc-sanitizers = "gcc" +TOOLCHAIN:pn-glibc = "gcc" +TOOLCHAIN:pn-glibc-initial = "gcc" +TOOLCHAIN:pn-glibc-locale = "gcc" +TOOLCHAIN:pn-glibc-mtrace = "gcc" +TOOLCHAIN:pn-glibc-scripts = "gcc" +TOOLCHAIN:pn-glibc-testsuite = "gcc" +TOOLCHAIN:pn-glibc-y2038-tests = "gcc" + +#| prelink-rtld: error while loading shared libraries: ld.so.1 +#| /lib64/ld.so.1: No such file or directory +TOOLCHAIN:pn-gobject-intospection:mips64 = "gcc" +TOOLCHAIN:pn-avahi:mips64 = "gcc" + +# VLAs +#| control.c:286:19: error: fields must have a constant size: 'variable length array in structure' extension will never be supported +#| __u32 buffer[cam->max_response_quads]; +#| ^ +#| 1 error generated. +TOOLCHAIN:pn-libdc1394 = "gcc" + +# error: return address can be determined only for current frame +TOOLCHAIN:pn-libexecinfo:mipsarch = "gcc" +TOOLCHAIN:pn-libgcc = "gcc" +TOOLCHAIN:pn-libgcc-initial = "gcc" +TOOLCHAIN:pn-libgfortran = "gcc" +TOOLCHAIN:pn-libssp-nonshared = "gcc" + +TOOLCHAIN:pn-m4:powerpc = "gcc" +# clang does not have 64bit atomics on ppc +TOOLCHAIN:pn-mesa:powerpc = "gcc" +# clang fails with db.c:(.text+0x188): unsupported bss-plt -fPIC ifunc mmio_write64_be +TOOLCHAIN:pn-rdma-core:powerpc = "gcc" +# usermode qemu crashes when running binaries from clang + rust compiler on ppc32 +TOOLCHAIN:pn-librsvg:powerpc = "gcc" +# variant-impl.hpp:309:36: error: 'is_variant' does not name a template but is followed by template arguments +TOOLCHAIN:pn-omxplayer = "gcc" +# error: return address can be determined only for current frame +TOOLCHAIN:pn-openflow:mipsarch = "gcc" +TOOLCHAIN:pn-openjdk-8 = "gcc" +TOOLCHAIN:pn-openjre-8 = "gcc" +TOOLCHAIN:pn-syslinux = "gcc" +TOOLCHAIN:pn-systemtap = "gcc" +# v4l-utils uses nested functions +TOOLCHAIN:pn-v4l-utils = "gcc" +# https://bugs.kde.org/show_bug.cgi?id=369723 +TOOLCHAIN:pn-valgrind = "gcc" + +TOOLCHAIN:pn-vboxguestdrivers = "gcc" +# uses C++ which clang does not like +TOOLCHAIN:pn-wvstreams = "gcc" +TOOLCHAIN:pn-wvdial = "gcc" +# +#../../lib/libicui18n.so: undefined reference to `__atomic_fetch_sub_4' +#../../lib/libicui18n.so: undefined reference to `__atomic_load_4' +#../../lib/libicui18n.so: undefined reference to `__atomic_store_4' +#../../lib/libicui18n.so: undefined reference to `__atomic_fetch_add_4' +# +TOOLCHAIN:pn-icu:armv4 = "gcc" +TOOLCHAIN:pn-icu:armv5 = "gcc" + +#../../libgcrypt-1.6.5/mpi/mpih-div.c:98:3: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions +TOOLCHAIN:pn-libgcrypt:mips64 = "gcc" + +#recipe-sysroot/usr/include/mozjs-60/mozilla/Span.h:634:5: error: statement not allowed in constexpr function +#| MOZ_RELEASE_ASSERT(aStart <= len && (aLength == dynamic_extent || +#| ^ +TOOLCHAIN:pn-polkit = "gcc" + +# ppp uses nested functions and gcc specific option e.g. --print-sysroot +# +TOOLCHAIN:pn-ppp = "gcc" + +#| ./ports/linux/pseudo_wrappers.c:80:14: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] +#| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); +#| ^ +#| ./ports/linux/pseudo_wrappers.c:80:57: error: use of unknown builtin '__builtin_apply_args' [-Wimplicit-function-declaration] +#| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); +TOOLCHAIN:pn-pseudo = "gcc" + +# mix_neon.c:179:9: error: invalid operand in inline asm: 'vld1.s32 ${0:h}, [$2] +# vld1.s32 ${1:h}, [$3] ' +TOOLCHAIN:pn-pulseaudio:armv7ve = "gcc" +TOOLCHAIN:pn-pulseaudio:armv7a = "gcc" + +#| ./dsp/v4f_IIR2.h:554:12: error: no matching function for call to 'v4f_map' +#| a[5] = v4f_map<__builtin_cosf> (f); +#| ^~~~~~~~~~~~~~~~~~~~~~~ +TOOLCHAIN:pn-caps = "gcc" + +#| ../libffi-3.3-rc0/src/arm/sysv.S: Assembler messages: +#| ../libffi-3.3-rc0/src/arm/sysv.S:131: Error: selected processor does not support `vldrle d0,[sp]' in ARM mode +#| ../libffi-3.3-rc0/src/arm/sysv.S:132: Error: selected processor does not support `vldmgt sp,{d0-d7}' in ARM mode +TOOLCHAIN:pn-libffi:armeb = "gcc" + +# rocksdb/rocksdb/util/crc32c_ppc_asm.S:9:10: fatal error: 'ppc-asm.h' file not found +# #include +# This header is only available with gcc-cross +TOOLCHAIN:pn-mariadb:powerpc64le = "gcc" + +# OpenCV does not compile for ppc64 with clang due to VSX clashes with altivec.h from clang +TOOLCHAIN:pn-opencv:powerpc64le = "gcc" +# Ade is used by openCV and shared C++ runtime so we can not mix libstdc++ and libc++ +TOOLCHAIN:pn-ade:powerpc64le = "gcc" + +#| error: return address can be determined only for current frame +#| error: return address can be determined only for current frame +#| error: return address can be determined only for current frame +TOOLCHAIN:pn-gcompat:mips = "gcc" + +# Fixes Clang induced linker crashes when using glibc 2.35+ +# mips-yoe-linux/mips-yoe-linux-ld: DWARF error: invalid or unhandled FORM value: 0x22 +# mips-yoe-linux-ld: Zend/asm/make_mips32_o32_elf_gas.o: CALL16 reloc at 0x28 not against global symbol +# mips-yoe-linux/mips-yoe-linux-ld: BFD (GNU Binutils) 2.37.20210721 assertion fail ../../bfd/elfxx-mips.c:3614 +TOOLCHAIN:pn-php:mips = "gcc" + +# Workaround oe-core patching problem temporarily +TOOLCHAIN:pn-rsync = "gcc" + +TOOLCHAIN:pn-u-boot-at91 = "gcc" +TOOLCHAIN:pn-u-boot-fslc-mfgtool = "gcc" +TOOLCHAIN:pn-u-boot-fslc-mxsboot = "gcc" +TOOLCHAIN:pn-u-boot-fslc = "gcc" +TOOLCHAIN:pn-u-boot-imx-mfgtool = "gcc" +TOOLCHAIN:pn-u-boot-imx = "gcc" +TOOLCHAIN:pn-u-boot-qoriq = "gcc" +TOOLCHAIN:pn-u-boot-boundary = "gcc" +TOOLCHAIN:pn-u-boot-script-boundary = "gcc" +TOOLCHAIN:pn-u-boot-script-qoriq = "gcc" +TOOLCHAIN:pn-u-boot-script-toradex = "gcc" +TOOLCHAIN:pn-u-boot-kontron = "gcc" +TOOLCHAIN:pn-u-boot-variscite = "gcc" +TOOLCHAIN:pn-u-boot-toradex = "gcc" +TOOLCHAIN:pn-u-boot-hardkernel = "gcc" +TOOLCHAIN:pn-u-boot-starfive = "gcc" +TOOLCHAIN:pn-u-boot-hardkernel = "gcc" +TOOLCHAIN:pn-u-boot-nezha = "gcc" +TOOLCHAIN:pn-u-boot-ti-mainline = "gcc" +TOOLCHAIN:pn-u-boot-ti-staging = "gcc" +TOOLCHAIN:pn-u-boot-splash = "gcc" +TOOLCHAIN:pn-u-boot-coral = "gcc" + +# See https://github.com/kraj/meta-clang/issues/696 +TOOLCHAIN:pn-pixman:aarch64 = "gcc" +# libomp needs to link in libatomic after itself when -fopenmp is used +TOOLCHAIN:pn-pixman:mipsarcho32 = "gcc" +# See https://github.com/llvm/llvm-project/issues/61412 +TOOLCHAIN:pn-frr:riscv64 = "gcc" +TOOLCHAIN:pn-frr:riscv32 = "gcc" + +# Tegra stuff +TOOLCHAIN:pn-standalone-mm-optee-tegra:tegra = "gcc" +TOOLCHAIN:pn-edk2-firmware-tegra:tegra = "gcc" +TOOLCHAIN:pn-optee-os-tadevkit:tegra = "gcc" +TOOLCHAIN:pn-optee-nvsamples:tegra = "gcc" +TOOLCHAIN:pn-optee-os:tegra = "gcc" +TOOLCHAIN:pn-libgcc-for-nvcc:tegra = "gcc" +TOOLCHAIN:pn-gcc-for-nvcc-runtime:tegra = "gcc" + +# Does not compile with clang 18 +#| core/arch/arm/include/arm64.h:392:1: error: expected writable system register or pstate +#| 392 | DEFINE_U32_REG_READWRITE_FUNCS(fpcr) +#| | ^ +TOOLCHAIN:pn-optee-os:imx-nxp-bsp = "gcc" + +# Fails with clang-19+ +# Poco/PriorityDelegate.h:203:10: error: no member named '_pTarget' in 'PriorityDelegate' +TOOLCHAIN:pn-poco = "gcc" +TOOLCHAIN:pn-netdata = "gcc" +# Needs OMP and with clang openmp is not ported to rv32 yet +TOOLCHAIN:pn-python3-drgn:riscv32 = "gcc" + +CFLAGS:append:pn-liboil:toolchain-clang:x86-64 = " -fheinous-gnu-extensions " + +# TOPDIR/build/tmp/work/core2-32-yoe-linux/gnu-efi/3.0.17-r0/gnu-efi-3.0.17//lib/ctors.S:11:41: error: expected the entry size +# .section .init_array, "aM", @init_array +# ^ +CFLAGS:append:pn-gnu-efi:toolchain-clang = " -no-integrated-as" + +#../libffi-3.2.1/src/arm/sysv.S:363:2: error: invalid instruction, did you mean: fldmiax? +# fldmiadgt ip, {d0-d7} +CFLAGS:append:pn-libffi:mips64:toolchain-clang = " -no-integrated-as" + +# ../db-5.3.28/src/mutex/mut_tas.c:150:34: error: unknown directive +#:9:2: note: instantiated into assembly here +# .force_thumb +# ^ +#CFLAGS:append:pn-db:toolchain-clang = " -no-integrated-as" +# +#| ../../../DirectFB-1.7.7/lib/direct/armasm_memcpy.S:63:2: error: invalid instruction +#| ldmgeia r1!, {r3, r4, r12, lr} +#| ^ +CFLAGS:append:pn-directfb:toolchain-clang:arm = " -no-integrated-as" + +#| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free' +EXTRA_OECONF:pn-openssl:toolchain-clang:x86 = "-latomic" + +CFLAGS:append:pn-userland:toolchain-clang = " -no-integrated-as" + +# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S +# :13:5: error: invalid token in expression +# .if $17 != 0 +# ^ +CFLAGS:append:pn-libjpeg-turbo:toolchain-clang:mipsarch = " -no-integrated-as" + +#| /tmp/x86-sse2-cdb148.s:207:9: error: ambiguous operand size for instruction 'sub' +#| sub SIZE, 64 +#| ^~~~ +CFLAGS:append:pn-tinymembench:toolchain-clang:x86-64 = " -no-integrated-as" +CFLAGS:append:pn-tinymembench:toolchain-clang:x86 = " -no-integrated-as" +CFLAGS:append:pn-tinymembench:toolchain-clang:mipsarch = " -no-integrated-as" + +CFLAGS:append:pn-ne10:toolchain-clang:arm = " -no-integrated-as" +CFLAGS:append:pn-libde265:toolchain-clang:arm = " -no-integrated-as" + +#2816:2: error: changed section type for .debug_frame, expected: 0x7000001E +# .section .debug_frame,"",@progbits +# ^ +#lj_vm.S:2890:2: error: changed section flags for .eh_frame, expected: 0x2 +# .section .eh_frame,"aw",@progbits +# ^ +CFLAGS:append:pn-luajit:toolchain-clang:mips = " -no-integrated-as" + +# uftrace/0.15.2/git/arch/aarch64/dynamic.S:92:2: error: instruction requires: fp-armv8 +CFLAGS:append:pn-uftrace:toolchain-clang:aarch64 = " -no-integrated-as" + +#FAILED: libucontext_posix.so.1 +#clang-13: error: unable to execute command: Segmentation fault (core dumped) +#clang-13: error: linker command failed due to signal (use -v to see invocation) +CFLAGS:append:pn-libucontext:toolchain-clang:powerpc64le = " -no-integrated-as" + +# Generated asm file can not be compiled with clang assembler due to presence of .0 label +# and its references +#| aes-decrypt-internal-2.s:368:1: error: unexpected token at start of statement +#| .0: +#| ^ +CFLAGS:append:pn-nettle:toolchain-clang:powerpc64le = " -no-integrated-as" + +# include/gcc/arm/ck_pr.h:201:1: error: instruction requires: arm-mode +#| CK_PR_DOUBLE_STORE(uint64_t, 64) +#| ^ +#include/gcc/arm/ck_pr.h:192:6: note: expanded from macro 'CK_PR_DOUBLE_STORE' +#| "strexd %1, %3, [%2]\n" \ +#| ^ +CFLAGS:append:pn-concurrencykit:toolchain-clang:arm = " -no-integrated-as" +CFLAGS:append:pn-sysbench:toolchain-clang:arm = " -no-integrated-as" +#error: expected absolute expression +#.elseif (bpp == 24) && (numpix == 8) +# ^ +#:50:5: note: while in macro instantiation +# pixld chunk_size, mask_bpp, mask_basereg, MASK +# ^ +CFLAGS:append:pn-qtbase:toolchain-clang:arm = " -no-integrated-as" + +#../git/common/connection.c:154:55: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare] +# for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) { +# ^~~~~~~~~~~~~~~~~~~~~~ +CFLAGS:append:pn-seatd:toolchain-clang = " -Wno-sign-compare" + +# -fno-tree-vrp is gcc specific +CXXFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" +CFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" + +CFLAGS:append:pn-ffmpeg:riscv64 = " -march=rv64gczbb" +CFLAGS:append:pn-ffmpeg:riscv32 = " -march=rv32gczbb" + +# python3-lxml_5.0.0 onwards need this option with clang until the functions are fixes +# | src/lxml/etree.c:246911:63: error: incompatible function pointer types passing 'void (void *, const xmlError *)' (aka 'void (void *, const struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (* +#)(void *, struct _xmlError *)') [-Wincompatible-function-pointer-types] +#| 246911 | xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); +#| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +CFLAGS:append:pn-python3-lxml:toolchain-clang = " -Wno-error=incompatible-function-pointer-types" +# https://lists.openembedded.org/g/openembedded-devel/topic/103542151#108198 +CFLAGS:append:pn-python3-kivy:toolchain-clang = " -Wno-error=incompatible-function-pointer-types" + +# otherwise systemd efi fails to build +# error: the 'sse' unit is not supported with this instruction set +TUNE_CCARGS:remove:pn-systemd:toolchain-clang = "-mfpmath=sse" +TUNE_CCARGS:remove:pn-systemd-boot:toolchain-clang = "-mfpmath=sse" + +TUNE_CCARGS:remove:pn-omxplayer:toolchain-clang = "-no-integrated-as" +TUNE_CCARGS:remove:pn-nfs-utils:toolchain-clang = "-Qunused-arguments" + +# We want to error out when -msse option is used otherwise it enables sse on non-x86 arches +TUNE_CCARGS:remove:pn-pipewire:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-tesseract:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-pulseaudio:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-btrfs-tools:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:append:pn-btrfs-tools:toolchain-clang = " -Werror=unused-command-line-argument" + +# Disable altivec on ppc32 +#/usr/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h:1345:32: error: use of undeclared identifier 'vec_sqrt'; did you mean 'vec_rsqrt'? +# BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a); +# ^~~~~~~~ +# vec_rsqrt +TUNE_CCARGS:append:pn-ceres-solver:toolchain-clang:powerpc = " -mno-altivec" +TUNE_CCARGS:append:pn-opencv:toolchain-clang:powerpc = " -mno-altivec" +CXXFLAGS:append:pn-libeigen:toolchain-clang:powerpc = " -DEIGEN_ALTIVEC_DISABLE_MMA" + +# external/amber/src/src/amber.cc:53:41: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage] +# vk-wrappers-1-0.inc:74:34: error: cast from 'PFN_vkVoidFunction' (aka 'void (*)()') to 'PFN_vkCmdEndRenderPass' +# (aka 'void (*)(VkCommandBuffer_T *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] +CXXFLAGS:append:pn-opengl-es-cts:toolchain-clang = " -Wno-error=unsafe-buffer-usage -Wno-error=cast-function-type-strict" +CXXFLAGS:append:pn-vulkan-cts:toolchain-clang = " -Wno-error=unsafe-buffer-usage -Wno-error=cast-function-type-strict" +# Wno-error=overriding-option needed with clang-20 +# see https://github.com/jtv/libpqxx/issues/738 for deprecated-declarations ( not needed with clang19+ ) +CXXFLAGS:append:pn-vulkan-samples:toolchain-clang = " -Wno-error=overriding-option -Wno-error=deprecated-declarations" +# Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/6033 +CFLAGS:append:pn-gtk4:toolchain-clang = " -Wno-error=int-conversion" + +# usr/include/glib-2.0/glib/glib-autocleanups.h:49:1: error: cast from 'void (*)(void)' to 'GDestroyNotify' +# (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] +CFLAGS:append:pn-pidgin-sipe:toolchain-clang = " -Wno-error=cast-function-type-strict" + +# 32bit builds of nodejs needs this warning to be disabled with clang16 until +# v8 engine in nodejs moved beyong this commit +# https://github.com/v8/v8/commit/d15d49b09dc7aef9edcc4cf6a0cb2b77a0db203f +CXXFLAGS:append:pn-nodejs:toolchain-clang = " -Wno-error=enum-constexpr-conversion" +# deps/TinyDeflate/gunzip.hh:1144:35: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw] +CXXFLAGS:append:pn-doxygen:toolchain-clang = " -Wno-error=missing-template-arg-list-after-template-kw" + +#| /usr/src/debug/ruby/2.5.1-r0/build/../ruby-2.5.1/process.c:7073: undefined reference to `__mulodi4' +#| clang-7: error: linker command failed with exit code 1 (use -v to see invocation) +COMPILER_RT:pn-ruby:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-python3:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-m4:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-cpio:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-openssh:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-webkitgtk:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-wpewebkit:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-python3-numpy:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-mongodb:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:remove:pn-m4:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-ruby:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-webkitgtk:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-m4:armeb = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-ruby:armeb = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-webkitgtk:armeb = "-rtlib=compiler-rt" +# build/lib/libQt5Widgets.so: undefined reference to `__lshrti3' +# __lshrti3 is missing in libgcc +COMPILER_RT:pn-qtbase:toolchain-clang:riscv32 = "-rtlib=compiler-rt ${UNWINDLIB}" + +LDFLAGS:append:pn-qtwebengine:toolchain-clang:runtime-gnu:x86 = " -latomic" +LDFLAGS:append:pn-qemu:toolchain-clang:x86 = " -latomic" +# warning: has a LOAD segment with RWX permissions +LDFLAGS:append:pn-ruby:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}" +LDFLAGS:append:pn-cairo:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}" +LDFLAGS:append:pn-systemd:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}" + +# glibc is built with gcc and hence encodes some libgcc specific builtins which are not found +# when doing static linking with clang using compiler-rt, so use libgcc +# undefined reference to `__unordtf2' +COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-fmt:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-fmt:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mybw:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mybw:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mpich:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot//usr/lib/libc.a(printf_fp.o): in function `__printf_fp_l': +# | /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__unordtf2' +# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__unordtf2' +# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__letf2' +# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot//usr/lib/libc.a(printf_fphex.o): in function `__printf_fphex': +# | /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__unordtf2' +# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__unordtf2' +# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__letf2' +# | x86_64-lmp-linux-clang -target x86_64-lmp-linux -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -fstack-protector-strong -O2 -D_F +COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" + +#(unwind.o): in function `__pthread_unwind': +#/usr/src/debug/glibc/2.29-r0/git/nptl/unwind.c:121: undefined reference to `_Unwind_ForcedUnwind' +#clang-8: error: linker command failed with exit code 1 (use -v to see invocation) +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" + +# Does not compile with libc++ from clang 17+ anymore see +# https://github.com/llvm/llvm-project/issues/63743 +LIBCPLUSPLUS:pn-apt:toolchain-clang = "-stdlib=libstdc++" + +# All following need to use libstdc++ with clang-19 +# see https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals +LIBCPLUSPLUS:pn-pbzip2:toolchain-clang = "-stdlib=libstdc++" +LIBCPLUSPLUS:pn-nlohmann-json:toolchain-clang = "-stdlib=libstdc++" +LIBCPLUSPLUS:pn-paho-mqtt-cpp:toolchain-clang = "-stdlib=libstdc++" +LIBCPLUSPLUS:pn-poco:toolchain-clang = "-stdlib=libstdc++" +LIBCPLUSPLUS:pn-netdata:toolchain-clang = "-stdlib=libstdc++" +LIBCPLUSPLUS:pn-cpp-netlib:toolchain-clang = "-stdlib=libstdc++" +LIBCPLUSPLUS:pn-cpprest:toolchain-clang = "-stdlib=libstdc++" +# See https://lists.openembedded.org/g/openembedded-devel/topic/meta_oe_patch_2_3/108964413 +LIBCPLUSPLUS:pn-tomlplusplus:toolchain-clang = "-stdlib=libstdc++" +LIBCPLUSPLUS:pn-doxygen:toolchain-clang = "-stdlib=libstdc++" + +# Uses gcc for native tools, e.g. nsinstall and passes clang options which fails so +# let same compiler ( gcc or clang) be native/cross compiler +# | gcc: error: unrecognized command line option ‘-Qunused-arguments’ +BUILD_CC:pn-nss:toolchain-clang = "clang -rtlib=libgcc -unwindlib=none" + +# LTO +# Seems to use symver ASMs see https://stackoverflow.com/questions/46304742/how-to-combine-lto-with-symbol-versioning +# lib/puny_encode.c:136: multiple definition of `_idn2_punycode_encode' +LTO:pn-libidn2:toolchain-clang = "" + +#libcairo.so: undefined reference to pthread_mutexattr_init [--no-allow-shlib-undefined] +LTO:pn-cairo:toolchain-clang = "" + +# This works with gcc-ranlib wrapper only which expands $@ shell array, +# but it will fail if RANLIB was set to -ranlib or +# -llvn-ranlib has same behaviour +RANLIB:append:pn-tcf-agent:toolchain-clang = " $@" + +# Subprocess output:mips-yoe-linux-llvm-objcopy: error: Link field value 22 in section .rel.dyn is not a symbol table +# also seen on riscv64 and x86-64 +OBJCOPY:pn-linux-yocto:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-yocto-dev:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-yocto-rt:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-variscite:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-ti-staging:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-raspberrypi:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-starfive-dev:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-nezha-dev:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-hardkernel:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-imx:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-fslc:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-fslc-imx:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-fslc-lts:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-at91:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-linaro-qcomlt:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-linux-intel:toolchain-clang = "${HOST_PREFIX}objcopy" + +# see https://github.com/llvm/llvm-project/issues/53948 +OBJCOPY:pn-opensbi:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}strip" + +# Depend on GNU objcopy option missing in llvm-objcopy +# llvm-objcopy: error: unknown argument '--section-alignment=512' +OBJCOPY:pn-systemd-boot:toolchain-clang = "${HOST_PREFIX}objcopy" + +# See https://github.com/llvm/llvm-project/issues/53999 +STRIP:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}objcopy" + +# e.g. mips-yoe-linux-llvm-objcopy: error: Link field value 42 in section .rel.dyn is not a symbol table +# e.g. aarch64-yoe-linux-llvm-objcopy: error: Link field value 35 in section .rela.plt is not a symbol table +OBJCOPY:pn-mybw:toolchain-clang = "${HOST_PREFIX}objcopy" + +# Fails with llvm strip +# i686-yoe-linux-llvm-strip: error: SHT_STRTAB string table section [index 9] is non-null terminated +STRIP:pn-minio:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-minio:toolchain-clang = "${HOST_PREFIX}objcopy" + +# | aarch64-yoe-linux-llvm-objcopy: error: invalid output format: 'efi-app-aarch64' +OBJCOPY:pn-gnu-efi:toolchain-clang = "${HOST_PREFIX}objcopy" + +# see https://github.com/llvm/llvm-project/issues/54213 +# Generates a bad libbsd.so linker stub and apps like bluelsa, mg, netcat-openbsd, android-tools +# fails to link with libbsd +OBJDUMP:pn-libbsd:mips:toolchain-clang = "${HOST_PREFIX}objdump" + +# With clang/lld it builds objects which gnu strip complains about +# riscv64-yoe-linux-strip: /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-matplotlib/3.5.3-r0/package/usr/lib/python3.10/site-packages/matplotlib/stTcyupd: not enough room for program headers, try linking with -N +STRIP:pn-python3-matplotlib:toolchain-clang:riscv64 = "${HOST_PREFIX}llvm-strip" +STRIP:pn-python3-matplotlib:toolchain-clang:riscv32 = "${HOST_PREFIX}llvm-strip" + +# Need OBJDUMP during do_package_qa which is set to llvm-objdump with meta-clang +# it might work with GNU objdump since it falls back to one from build host +DEPENDS:append:pn-linux-firmware:toolchain-clang = " clang-native" + +# Needs for solving fopenmp issues +DEPENDS:append:pn-pixman:mips:toolchain-clang = " openmp" +#| ../pixman-0.40.0/pixman/pixman-arm-neon-asm.S:3625:1: note: while in macro instantiation +#| generate_bilinear_scanline_func pixman_scaled_bilinear_scanline_0565_0565_SRC_asm_neon, 0565, 0565, 1, 1, 28, BILINEAR_FLAG_UNROLL_4 +#| ^ +#| :134:1: error: unknown directive +#| .endfunc +#| ^ +CFLAGS:append:pn-pixman:arm:toolchain-clang = " -no-integrated-as" +# :98:23: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] +# vsetvli zero, zero, e16, m1 +CFLAGS:append:pn-dav1d:riscv64:toolchain-clang = " -no-integrated-as" + +# test_connectx segfaults with this option set to -fstack-protector-strong +SECURITY_STACK_PROTECTOR:pn-lksctp-tools:toolchain-clang = "" + +# ERROR: babeltrace2-2.0.5-r0 do_package_qa: QA Issue: babeltrace2: ELF binary /usr/lib/babeltrace2/plugins/babeltrace-plugin-ctf.so has relocations in .text +INSANE_SKIP:append:pn-babeltrace2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' textrel', '', d)}" + +LDFLAGS:append:pn-libidn2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-alsa-lib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libmd:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libbsd:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-slang:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libgcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libxml2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-binutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libnss-mdns:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-pulseaudio:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-mesa:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-mesa-gl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-mesa-pvr:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libnsl2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libnl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libnftnl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libtirpc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-ndctl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" + +LDFLAGS:append:pn-zlib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd -Wl,--undefined-version', '', d)}" +LDFLAGS:remove:pn-zlib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" + +LDFLAGS:append:pn-qtbase:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +# | aarch64-yoe-linux-ld.lld: error: version script assignment of 'Qt_6.5' to symbol 'qt_version_tag' failed: symbol not defined +LDFLAGS:append:pn-qtlanguageserver:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtserialport:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtimageformats:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtnetworkauth:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtsvg:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtshadertools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtdeclarative:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtserialbus:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtwebsockets:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtlottie:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtspeech:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtcoap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtsensors:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtquickdesigner-components:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtquicktimeline:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qt5compat:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qt3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtvirtualkeyboard:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtscxml:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtpositioning:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtdatavis3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtremoteobjects:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtopcua:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtcharts:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtconnectivity:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtwayland:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtgrpc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qthttpserver:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtmqtt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtwebchannel:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtquick3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtlocation:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtwebengine:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtwebview:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtmultimedia:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtquick3dphysics:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtinterfaceframework:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qttools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtdeviceutilities:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-qtpdf:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libxcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-popt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-json-c:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libtalloc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libdevmapper:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libtdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libtevent:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-cryptsetup:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libgphoto2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libxklavier:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-lame:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-keyutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libcdio:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libva:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libbpf:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-npth:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-tbb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-corosync:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libnetfilter-cttimeout:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-fuse3:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-tremor:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-flashrom:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-ipset:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-rdma-core:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-apitrace:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libkcapi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-gtk-vnc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libnss-nis:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libva-initial:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-dante:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-basu:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-passwdqc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-pcp:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-multipath-tools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-renderdoc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libldb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-samba:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libnvme:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-gnu-efi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libffi:x86:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libffi:arm:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-elfutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-pmdk:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-libcgroup:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld sysvinit', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-kernel-selftest:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-openldap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-liburing:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-frame:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +# | x86_64-yoe-linux-musl-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined +LDFLAGS:append:pn-wtmpdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +# arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined +LDFLAGS:append:pn-util-linux:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +LDFLAGS:append:pn-util-linux-libuuid:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" +TUNE_CCARGS:remove:pn-kernel-selftest:toolchain-clang = "-mfpmath=sse" + +# Avoid's go linker crash as reported in https://github.com/golang/go/issues/61872 +# it happens when libstd.so is linked with lld for aarch64 +LDFLAGS:append:pn-go-runtime:toolchain-clang:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" +LDFLAGS:remove:pn-go-runtime:toolchain-clang:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" +LDFLAGS:append:pn-go-runtime:toolchain-clang:x86-64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" +LDFLAGS:remove:pn-go-runtime:toolchain-clang:x86-64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" +# See https://github.com/llvm/llvm-project/issues/65017 +LDFLAGS:append:pn-libfaketime:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" +LDFLAGS:remove:pn-libfaketime:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" +# arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'readdir' failed: symbol not defined +#| arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'readdir_r' failed: symbol not defined +#| arm-yoe-linux-gnueabi-clang: error: linker command failed with exit code 1 (use -v to see invocation) +LDFLAGS:append:pn-aufs-util:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" +LDFLAGS:remove:pn-aufs-util:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" +# | arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined +LDFLAGS:append:pn-lastlog2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" +LDFLAGS:remove:pn-lastlog2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" +LDFLAGS:remove:pn-python3-bcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', '-fuse-ld=lld', '', d)}" +LDFLAGS:remove:pn-bluez5:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" +LDFLAGS:append:pn-bluez5:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" + +LD:pn-gnu-efi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', d)}" +LD:pn-libhugetlbfs:toolchain-clang = "${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}" +LD:pn-libunix-statgrab:toolchain-clang = "${CC}" + +TOOLCHAIN:pn-perf = "gcc" + +# See https://github.com/llvm/llvm-project/issues/108262 +SELECTED_OPTIMIZATION:remove:pn-libjxl:arm:toolchain-clang = "-O2" +SELECTED_OPTIMIZATION:append:pn-libjxl:arm:toolchain-clang = " -Og" + +# qemu usermode crashes when using clang as system compiler but works with gcc +# see https://patchwork.yoctoproject.org/project/oe-core/patch/20240923234336.3978188-1-raj.khem@gmail.com/ +GI_DATA_ENABLED:pn-vte:toolchain-clang:armv7ve = "False" From patchwork Tue Nov 5 18:45:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51846 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37526D33A33 for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web10.28077.1730832346497978987 for ; Tue, 05 Nov 2024 10:45:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QpZBD4ZH; spf=pass (domain: gmail.com, ip: 209.85.216.46, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2e2eba31d3aso4237210a91.2 for ; Tue, 05 Nov 2024 10:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832346; x=1731437146; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gwTafV/ZN1EAHGsv96S8OVWBMD3G1xBsThzBew9Td64=; b=QpZBD4ZHwOgmyuEjyyuijm9x+IqKxsb+4oExeVKAU1kCuRTQoCcTivwEgW8XZAT73W PjdlkgXTYojWVgguVXR/wpHh/mB7XwoNMFa9U0zT4f++/u37QCoWvXAmJExwXrwekR25 xXXBF1Aq37v9u7SW+TkTvr4BGBnfCcIK0I9VXy/KJZCl7DzPRhcFrZMYTvopEHjr2Cfn EHBdLxRU1bOSgdtl+qd9cUI/FXDLPjUDJQ8ba5CLQu6CuCouBFEMquCavLfU81gSEdV4 KITncSDBpC0qlu18vUZVKKIVl/c6WC5SnsyndrOsKU99SwMpvOA/IPhrjzG90o4iPa4L e2zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832346; x=1731437146; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gwTafV/ZN1EAHGsv96S8OVWBMD3G1xBsThzBew9Td64=; b=j4U1j5cIKLpoNjjyC/125Gmlgi6psdCAJy6Dh4dct8Hm1qII8mqkzaJ+ZRjM+V0cqt HRvYQM92d/qUdThdCZD9io5eO5VwOFNLvayThQ/e/HG2TbXzC7oRzwqwgdcv3sw+U6yW Wpupl2vlNcaMBNPRNkWtTyuqUwGeAhfwO2LCl0oQR3Y/x8yNzUrPywuWDLRWuZaiPtUj dcDdShj8b8P/LH9W38GM1VIdJpYII5DJrxyei3Mqz0TZ1fG8PJOLR5hcLC8/3/HZx2uC 1z+csiE//4TBcp8yZu0lpx1m7yULbjsR6WHETbh2uidE7wfpSg+pyc9MfaTSz+IGSsgJ 4nQg== X-Gm-Message-State: AOJu0YxuE4GdrrgLOUluaicJTWsRx3Sb5O064vn20m69JMDCYhLJ/KAK tTQO6U0/ZWUXF3oZXcP1ez3ubvbk39xWsIqddB1FHPG/2c2cZa0qPEu+6A== X-Google-Smtp-Source: AGHT+IEkARo5rO9mHTLej+9pSiHtZCvjgwJCIWUJyJaub08EWbx8DddTyV/Lo3TeX4ryeXViul9flg== X-Received: by 2002:a17:90a:c105:b0:2e9:4717:97a8 with SMTP id 98e67ed59e1d1-2e947179a9cmr20366715a91.36.1730832345715; Tue, 05 Nov 2024 10:45:45 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:45 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 03/19] nonscanable.inc: Includes recipes which can not be used with clang-scan Date: Tue, 5 Nov 2024 10:45:22 -0800 Message-ID: <20241105184540.3450302-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206731 clang-scan is a static code analyser that comes with clang/llvm collection but all recipes may not work out of box, so mention those recipes here so that if someone wants to enable it distro/image wide they can Signed-off-by: Khem Raj --- meta/conf/distro/include/nonscanable.inc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 meta/conf/distro/include/nonscanable.inc diff --git a/meta/conf/distro/include/nonscanable.inc b/meta/conf/distro/include/nonscanable.inc new file mode 100644 index 00000000000..3cdc454e905 --- /dev/null +++ b/meta/conf/distro/include/nonscanable.inc @@ -0,0 +1,22 @@ +SCAN_BUILD:pn-linux-libc-headers = "" +SCAN_BUILD:pn-update-rc.d = "" +SCAN_BUILD:pn-initscripts = "" +SCAN_BUILD:pn-base-files = "" +SCAN_BUILD:pn-os-release = "" +SCAN_BUILD:pn-wireless-regdb = "" +SCAN_BUILD:pn-tzdata = "" +SCAN_BUILD:pn-qemuwrapper-cross = "" +SCAN_BUILD:pn-depmodwrapper-cross = "" +SCAN_BUILD:pn-bluez-firmware-rpidistro = "" +SCAN_BUILD:pn-udev-rules-rpi = "" +SCAN_BUILD:pn-shadow-securetty = "" +SCAN_BUILD:pn-96boards-tools = "" +SCAN_BUILD:pn-run-postinsts = "" +SCAN_BUILD:pn-keymaps = "" +SCAN_BUILD:pn-sysvinit-inittab = "" +SCAN_BUILD:pn-pi-bluetooth = "" +SCAN_BUILD:pn-rpi-config = "" +SCAN_BUILD:pn-bcm2835-bootfiles = "" +SCAN_BUILD:pn-autoconf-archive = "" +SCAN_BUILD:pn-compiler-rt = "" +SCAN_BUILD:pn-libcxx = "" From patchwork Tue Nov 5 18:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09CA9D33A29 for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web11.27950.1730832347369967391 for ; Tue, 05 Nov 2024 10:45:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mc1n7c8b; spf=pass (domain: gmail.com, ip: 209.85.214.182, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-20c7ee8fe6bso55694125ad.2 for ; Tue, 05 Nov 2024 10:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832346; x=1731437146; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Y8Sl707spqOldVN9MV21RhfDUbNVH0J4xsVq2Tygoo=; b=mc1n7c8bmHqOzRnJWMMyTSwsVF9U1qwBoRURA2phC+qhGD3WUfTAPNNfcaZU5kO9Yv ZFWm6i8YGNRUuRoeiG5kPlGoDphi4T2Hx1CMxw8uH47ZpHvNsjSMwepTK0EUT1uy/uGU lPhsy+xoYtIRmxLL0LJa9og6a7V85HCy4nidMqDTQZszQwpolGsQY41fhf9wVoewu2Hl QEXYbom8C+rYb76nk+D0R3qb9mQvYUAhD6KI9q3/c6fHDU7MiixdnmdShjX+SrlWGHGF gbVpyPzdctsTxiLBjiDuXVsQw/dY/91Gaey0tOLeMd7xgfGf6XFOCTZABG0C6twMSvtL 26xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832346; x=1731437146; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Y8Sl707spqOldVN9MV21RhfDUbNVH0J4xsVq2Tygoo=; b=o6x1TTt+i48Bpv58mOmFHGixBjUtUBf/T3CuwWfTNDwlCwu8pme8/be1eBxEZluviM 4laozINVEeKArHU3qtu21VyuB9AE4DlQaprE02lp1+l6reYY8o3VLJwFqV7QV11SQ+7X e0TGGXSeJ7E7+A/QmKJQY9L1HmZ3aFCucwhEbMlvRDeqww8HeVg2ygvlt7Co5LlU+0XU SUFYoqBLj2kmDTmzuk9Kk1tFilbQFOM6AgM7iNbys5LT0XmVRTT4YL0KIlm+72wBdf+K OXy3J5blkMVXBQK6vUTXEnxzJeJuTxCF6s9TB5pvX4jmtnc6nQpVAQWpxqb7EMnJEtEA yH9w== X-Gm-Message-State: AOJu0YwhKtJjaTr7BZF7Q+GRzMYTP1z+MR751GwSnoExlLPz0Zv203Zx Etyc9aiY/vq2KimY/ZcQpTxe2nGcAahV3+19jl5xNnuSmdp+zIzON/0B9Q== X-Google-Smtp-Source: AGHT+IEFePbjCKkLhBvltDWhU0txZ5LtcxmvhHuM74Bz2QmudJfHAGs19t4hiVA1YVAUpHrW0ED2zA== X-Received: by 2002:a17:903:2b0e:b0:20c:769b:f042 with SMTP id d9443c01a7336-210c6c079fcmr530803965ad.31.1730832346583; Tue, 05 Nov 2024 10:45:46 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:46 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 04/19] scan-build.bbclass: Add class to enable clang static analyser Date: Tue, 5 Nov 2024 10:45:23 -0800 Message-ID: <20241105184540.3450302-4-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206732 Signed-off-by: Khem Raj --- meta/classes-recipe/scan-build.bbclass | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 meta/classes-recipe/scan-build.bbclass diff --git a/meta/classes-recipe/scan-build.bbclass b/meta/classes-recipe/scan-build.bbclass new file mode 100644 index 00000000000..e1a72de993e --- /dev/null +++ b/meta/classes-recipe/scan-build.bbclass @@ -0,0 +1,60 @@ +# Copyright (C) 2018 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +EXTRA_ANALYZER_OPTIONS += "-analyze-headers" +EXTRA_ANALYZER_OPTIONS += "--force-analyze-debug-code" +SCAN_BUILD ??= "1" +SCAN_BUILD:class-native = "" +SCAN_BUILD:class-nativesdk = "" +SCAN_BUILD:class-cross = "" +SCAN_BUILD:class-crosssdk = "" +SCAN_BUILD:class-cross-canadian = "" + +CLANG_SCAN_SERVER_IP ??= "0.0.0.0" +CLANG_SCAN_PORT ??= "8181" +SCAN_RESULTS_DIR ?= "${TMPDIR}/static-scan/${PN}" + +CCSCAN ?= "${HOST_PREFIX}${TOOLCHAIN}" +CXXSCAN:toolchain-clang ?= "${HOST_PREFIX}clang++" +CXXSCAN:toolchain-gcc ?= "${HOST_PREFIX}g++" + +do_scanbuild() { + rm -rf ${SCAN_RESULTS_DIR} + scan-build --use-cc ${CCSCAN} --use-c++ ${CXXSCAN} --analyzer-target ${HOST_SYS} --html-title ${BP} -o ${SCAN_RESULTS_DIR} ${EXTRA_ANALYZER_OPTIONS} ${MAKE} ${PARALLEL_MAKE} ${EXTRA_OEMAKE} +} + +do_scanview() { + bbplain "================================================================" + bbplain "Starting scan-view server at: http://${CLANG_SCAN_SERVER_IP}:${CLANG_SCAN_PORT}" + bbplain "Use Ctrl-C to exit" + bbplain "================================================================" + scan-view --host ${CLANG_SCAN_SERVER_IP} --port ${CLANG_SCAN_PORT} --allow-all-hosts --no-browser ${SCAN_RESULTS_DIR}/*/ +} + +do_scanview[depends] += "${PN}:do_scanbuild" +do_scanbuild[depends] += "clang-native:do_populate_sysroot" +#do_scanbuild[cleandirs] += "${SCAN_RESULTS_DIR}" +do_scanbuild[dirs] += "${B}" +do_scanview[dirs] += "${SCAN_RESULTS_DIR}" +#do_build[recrdeptask] += "do_scanbuild" + +do_scanbuild[doc] = "Build and scan static analysis data using clang" +do_scanview[doc] = "Start a webserver to visualize static analysis data" + +addtask scanbuild after do_configure before do_compile +addtask scanview after do_scanbuild +python () { + # Remove scanbuild task when scanning is not enabled or recipe does not have do_configure + if not(d.getVar('SCAN_BUILD') == "1") or not(d.getVar('TOOLCHAIN') == "clang") or oe.utils.inherits(d, 'allarch'): + for i in ['do_scanbuild', 'do_scanview']: + bb.build.deltask(i, d) + else: + cflags = d.getVar('CFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False) + cxxflags = d.getVar('CXXFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False) + d.setVar('CFLAGS', cflags) + d.setVar('CXXFLAGS', cxxflags) + if oe.utils.inherits(d, 'autotools'): + cachedvar = d.getVar('CACHED_CONFIGUREVARS', False) + cachedvar = cachedvar + " scan-build " + " --analyzer-target " + d.getVar('HOST_SYS', False) + " --use-cc " + d.getVar('CCSCAN', False) + " --use-c++ " + d.getVar('CXXSCAN', False) + d.setVar('CACHED_CONFIGUREVARS', cachedvar) +} From patchwork Tue Nov 5 18:45:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 183E1D33A2E for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.web11.27952.1730832348254045806 for ; Tue, 05 Nov 2024 10:45:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TlF4xkR9; spf=pass (domain: gmail.com, ip: 209.85.214.180, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20ce65c8e13so66569645ad.1 for ; Tue, 05 Nov 2024 10:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832347; x=1731437147; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2qGTRFUFDs+AvEXikQBPPlrnyJGjQjyghHsHqG6lzKM=; b=TlF4xkR9ysxgQS2saJHmkDqHOJqc1wnKBqGKlATRosVozVnQ+acHCMsvfeMEYVWX1O ufiLRg42mM3wPKHBD7zB/lpaf3rCkC4epz8ab6KA83KVx0diqtJbX3IuGvsgZDoGrd+m gMEY2DjzwFbYihqRUxuB93AwuuZlrQF23BD9dAdUDhJZGiHq4ZZUSQ6ntYBb/ZR3Tleq XuD6CIRHqsbBDthC9v57q2WhCus4sH9tw0m3f1tHZmH5LfN3/vRE82b0GXRFciWqXU9+ duhXp4TxovyFnDewJE2h+AT31PSpAX8gH1Hljuc1Eo59KY78VAU3JmKaaXIOK5Km7zKp /qZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832347; x=1731437147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2qGTRFUFDs+AvEXikQBPPlrnyJGjQjyghHsHqG6lzKM=; b=Q1TEBHh75uLFFUqHM2gLHpw4XOUdj51hUAvX6rp3B9JLkdbVF1ox18pM5ROBFHlWRR i/fanYa81Kyeo9lENBuTjUtdnspU9CdW6v2PdU5MqE0pB+7wVXYY18aL0Wm6RePlL57P PXFL3bQnKlEsBPPhOJ4UbQ5/XORKc9XeLuAO8dAjNrqD/VG/svX9PNgaqxEfl9jfKtZT eT6swDsWVy40kggCYaQWnT0ayqNlJ2ydKhROsXXorpqTU9pbVgCDbxvuJBxct2H5QH6g dl+aVab5xT+6LdF+Rdrrv4Wv3pTamKSDdWtrRIKmaRo5EO8cTtbWD8Qxz1E8dHIZlHfU Dt7w== X-Gm-Message-State: AOJu0YyY8/9GmRf1YRYIwaKLghNCbmAG7UtLfGuE2RgVpiVr4aTbEuqZ uKndGyRKflfhcTv2w5CCbsbN6Hb7u58XVlLoswR/JeIuY0XkG2haIghxNA== X-Google-Smtp-Source: AGHT+IH3ZlD46B6qduPfFHPGxsyqcAms0rB01n+W+5LIQlrV/y3pW5QhPMrkt40aCzZECD0uYiNKGA== X-Received: by 2002:a17:902:d2cc:b0:20c:b700:6e10 with SMTP id d9443c01a7336-21103b20489mr277007845ad.34.1730832347431; Tue, 05 Nov 2024 10:45:47 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:47 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 05/19] clang-native.bbclass: Abstraction to enable clang as native compiler Date: Tue, 5 Nov 2024 10:45:24 -0800 Message-ID: <20241105184540.3450302-5-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206733 Some packages demand clang all the way, including for native pieces e.g. chromium, this helps to get that going Signed-off-by: Khem Raj --- meta/classes-recipe/clang-native.bbclass | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 meta/classes-recipe/clang-native.bbclass diff --git a/meta/classes-recipe/clang-native.bbclass b/meta/classes-recipe/clang-native.bbclass new file mode 100644 index 00000000000..a136deeee38 --- /dev/null +++ b/meta/classes-recipe/clang-native.bbclass @@ -0,0 +1,24 @@ +# inherit this class if you would like to use clang to compile the native +# version of your recipes instead of system compiler ( which is normally gcc ) +# on build machines +# to use it add +# +# inherit clang-native +# +# to the concerned recipe via a bbappend or directly to recipe file +# +DEPENDS:append:runtime-llvm = " compiler-rt-native libcxx-native" +# Use libcxx headers for native parts +CXXFLAGS:append:runtime-llvm = " -stdlib=libc++" +BUILD_CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" +# Use libgcc for native parts +LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" +BUILD_LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" +DEPENDS:append = " clang-native" +BUILD_CC = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE}" +BUILD_CXX = "${CCACHE}clang++ -isysroot=${STAGING_DIR_NATIVE}" +BUILD_CPP = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE} -E" +BUILD_CCLD = "${CCACHE}clang" +BUILD_RANLIB = "llvm-ranlib" +BUILD_AR = "llvm-ar" +BUILD_NM = "llvm-nm" From patchwork Tue Nov 5 18:45:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2674BD33A31 for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mx.groups.io with SMTP id smtpd.web11.27953.1730832349163397940 for ; Tue, 05 Nov 2024 10:45:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Vh4DaioM; spf=pass (domain: gmail.com, ip: 209.85.216.51, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2e2cc469c62so4051125a91.2 for ; Tue, 05 Nov 2024 10:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832348; x=1731437148; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NBRyofExjoiHH+fTGXgBxI3bCDkyo7cVQSnyg0M8sTg=; b=Vh4DaioMgTxbQT+sNkYjkncCheUYmD6UT3gWJEyEYmeBfgMB+WwBjw2BLPdjciGOE0 /zbaARAsTsLHNUQGhzRAhGnU4SK+2J3g8VWp0zXYd11eh7ZWHGS2cOr2Nx9fYTiP6WpS GO3cg4Y25KuhNqHF7gwH4As1f/7mOEShLwXrD5breENLfHIb+upFH+bkYtvOfGz1UbiP A6O6c139T56omBsYJQLq2eV3yiOUppujDuQpS56ZPWHWCWHSHS3Z/zo0ygfyRrXyluEo lZSxJKgxQ3QmEijwhU6Z2HAQQjDPlyo6nyiayab8Fmu6JDo5iSJygEo6A3xarmQGAGl0 FZPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832348; x=1731437148; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NBRyofExjoiHH+fTGXgBxI3bCDkyo7cVQSnyg0M8sTg=; b=omazZ8KKGLxGKHIDZEoo1m1LjEJo8kmZi3wDCmTE2k+pARO6sFkz81FaoQqj84Datj f9et+gEz2g2zkDTwSIJ+Z+RXmNDiG9cLZpQY62/3JHnEt0/nVKp7cK4e44MMMsYKPs+H VwJGoxxNhnpN5THHzo++bU+0ujmktD5aiToZ9IASxo3MAgfOfIbzGl7XU4NZ/rPQ6b9B lKVuX6zyI/EsDYL1hfrJ8hr7f5r+smy2kQUQuyWsiPiXMANZQGZC8knW3M7whzsKZtRc +RMv3cYJG46pSL/owjOIt5/CdIH9MVdU6vTAVLZt4/LvpNsgg4EXe9fX/xv6VUYbPOxq tLMQ== X-Gm-Message-State: AOJu0YxKFXuAwl8yYcaLq/8p8Iv2YdINEVEu9q/bJaciygJMCUGEWwu0 EzRWUmok4tw9cJYWgAIyyqTnSY/3/YAVVqyp0W+8nemMvMXNWRPOIzik9g== X-Google-Smtp-Source: AGHT+IGUOCm81hniGMqirXsggC5zY4zH2RP+xfJjV624VAyzRXJCT0Qyx5HewBsbXJy+G0rXo7OdkA== X-Received: by 2002:a17:90b:4a91:b0:2e2:c423:8e17 with SMTP id 98e67ed59e1d1-2e94c295063mr24069400a91.7.1730832348335; Tue, 05 Nov 2024 10:45:48 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:47 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 06/19] cmake-native.bbclass: Abstraction to use cmake with native toolchains Date: Tue, 5 Nov 2024 10:45:25 -0800 Message-ID: <20241105184540.3450302-6-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206734 This would enable using OE built native toolchain e.g. clang-native to build cmake based native packages Signed-off-by: Khem Raj --- meta/classes-recipe/cmake-native.bbclass | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 meta/classes-recipe/cmake-native.bbclass diff --git a/meta/classes-recipe/cmake-native.bbclass b/meta/classes-recipe/cmake-native.bbclass new file mode 100644 index 00000000000..116cdd1a999 --- /dev/null +++ b/meta/classes-recipe/cmake-native.bbclass @@ -0,0 +1,56 @@ +# Native C/C++ compiler (without cpu arch/tune arguments) +OECMAKE_NATIVE_C_COMPILER ?= "`echo ${BUILD_CC} | sed 's/^\([^ ]*\).*/\1/'`" +OECMAKE_NATIVE_CXX_COMPILER ?= "`echo ${BUILD_CXX} | sed 's/^\([^ ]*\).*/\1/'`" +OECMAKE_NATIVE_AR ?= "${BUILD_AR}" +OECMAKE_NATIVE_RANLIB ?= "${BUILD_RANLIB}" +OECMAKE_NATIVE_NM ?= "${BUILD_NM}" + +# Native compiler flags +OECMAKE_NATIVE_C_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CFLAGS}" +OECMAKE_NATIVE_CXX_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CXXFLAGS}" +OECMAKE_NATIVE_C_FLAGS_RELEASE ?= "-DNDEBUG" +OECMAKE_NATIVE_CXX_FLAGS_RELEASE ?= "-DNDEBUG" +OECMAKE_NATIVE_C_LINK_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS}" +OECMAKE_NATIVE_CXX_LINK_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" +BUILD_CXXFLAGS += "${BUILD_CC_ARCH}" +BUILD_CFLAGS += "${BUILD_CC_ARCH}" + +do_generate_native_toolchain_file() { + cat > ${WORKDIR}/toolchain-native.cmake < X-Patchwork-Id: 51857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4707FD33A36 for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.web10.28082.1730832352469629010 for ; Tue, 05 Nov 2024 10:45:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iF9LegSx; spf=pass (domain: gmail.com, ip: 209.85.214.180, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20c693b68f5so62842745ad.1 for ; Tue, 05 Nov 2024 10:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832352; x=1731437152; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vsJtYimSidpa8TvpJYLYhPNR9qmDIM8N0Wtp05+2/fk=; b=iF9LegSxxuqXXke9/ozvuFhJOnB0Q8SHU2WaDeVeoNNt/MmMUcnoSD9gtacY1YlGQ3 0ZIUDwylECmDiqGNMh1A0S4fTtBCJyXuOeqAJDilQbl/cfZKJa8PBQq3BA1Fai2eQhSI JzXNI6vkrveyBH4GHRyMIjaPzc5NhI/tSeIfpzsy09DszKpc2FLlCv8TNNjH4QbGcSmr 043WSxtVoB6HxOb34CsIdCaGpFRveIzLt8ZDUpNNMNlYUERfZf0yoRzzeGJ0BPdqSBDQ Wg4+WHFzvhhoP5reAK/hTI5olPw7cPJ1hiE1nzlzWHRO68yEL5xr0b4othkITY0DZExE 7Nbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832352; x=1731437152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vsJtYimSidpa8TvpJYLYhPNR9qmDIM8N0Wtp05+2/fk=; b=GBsVt28eOj329F4LCDYV8od99rHIhaR9IfdapCIPho+cw2N2ofZw4ky7uHwvQkq35Y zpPuct5fOOBIS+P42pOZWFO36+t7Ng3CHsYf3fNnvw+RqE52ZoQRb//zsQTe6KJPCm+/ H6mQidfWaYaiVl4WxOJPWuIESpxMeo7tceKCQst0EMWtfvQCEFmeBKBH+qiNc4eTi1rX 4NX+eqEmZ3S5NgOvPo8ysq12mJLz2WizI88+P0lqXnpGMe7Zyc3lMlWw6XGXr1EohlGB rJC80jhNsdPlkrrmHSZLo3S2OuVuljMDwreglogBV9rNpjCgyFxmxZDUtA/lfR+mfQaZ Iivw== X-Gm-Message-State: AOJu0YxC8/3c2VMh2cwILFP/vncojwRpK/ZSOpjJLfUYKnuzs1u7oYzE 4QMT2IS2NtCv66QOf45uR/PPyGNx27Kh74lxihOUzVVX+TbRvpS/aNDXPg== X-Google-Smtp-Source: AGHT+IFA3guUzAZcw2FH8k0++6Y2zRea4Er15qYLtjlmlsxfYGaVTIO6yAmQsuutAD7yxGRfWQUeGw== X-Received: by 2002:a17:902:f791:b0:20b:5645:d860 with SMTP id d9443c01a7336-21103b34323mr272826485ad.36.1730832349736; Tue, 05 Nov 2024 10:45:49 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:49 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 07/19] clang: Migrate clang and related recipes from meta-clang Date: Tue, 5 Nov 2024 10:45:26 -0800 Message-ID: <20241105184540.3450302-7-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206736 This includes compiler, tools and runtime libraries, they are brought in together to avoid major rehashing due to their interdependence. Signed-off-by: Khem Raj --- .../clang/clang-cross-canadian_git.bb | 36 ++ .../recipes-devtools/clang/clang-cross_git.bb | 35 ++ .../clang/clang-crosssdk_git.bb | 34 ++ meta/recipes-devtools/clang/clang.inc | 24 + ...ibunwind-headers-when-LIBCXXABI_LIBU.patch | 60 +++ ...-support-a-new-embedded-linux-target.patch | 309 ++++++++++++ ...lify-cross-compilation.-Don-t-use-na.patch | 44 ++ ...ryInfo-Undefine-libc-functions-if-th.patch | 90 ++++ ...-env-override-of-exe-and-libdir-path.patch | 71 +++ ...g-driver-Check-sysroot-for-ldso-path.patch | 75 +++ ...tools.cpp-Add-lssp_nonshared-on-musl.patch | 32 ++ ...08-clang-Prepend-trailing-to-sysroot.patch | 39 ++ ...e-the-target-sysroot-for-compiler-ru.patch | 41 ++ ...efine-releative-gcc-installation-dir.patch | 47 ++ ...ad-and-ldl-along-with-lunwind-for-st.patch | 35 ++ ...UTABLE-when-cross-compiling-for-nati.patch | 24 + ...3-Check-for-atomic-double-intrinsics.patch | 34 ++ ...gure-for-packages-using-find_package.patch | 115 +++++ ...ce-dir-location-for-cross-toolchains.patch | 42 ++ ...-dyld-prefix-when-checking-sysroot-f.patch | 79 +++ ...-clang-Use-python3-in-python-scripts.patch | 35 ++ ...-Yocto-based-GCC-install-search-path.patch | 70 +++ ...or-for-adding-OE-distro-vendor-names.patch | 32 ++ ...ot-use-backtrace-APIs-on-non-glibc-l.patch | 68 +++ ...iple-for-non-debian-multiarch-linux-.patch | 28 ++ ...libunwind-Added-unw_backtrace-method.patch | 56 +++ ...ot-use-install-relative-libc-headers.patch | 34 ++ ...-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 +++ ...ry-search-path-for-OpenEmbedded-Host.patch | 84 ++++ ...0026-lldb-Link-with-libatomic-on-x86.patch | 33 ++ ...ompiler-rt-Enable-__int128-for-ppc32.patch | 73 +++ ...ot-use-cmake-infra-to-detect-libzstd.patch | 62 +++ ...t-Fix-stat-struct-s-size-for-O32-ABI.patch | 44 ++ ...f-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 ++ ....cpp-ARMLibDirs-search-also-in-lib32.patch | 81 +++ ...d-OE-specific-ABI-triple-for-N32-ABI.patch | 78 +++ ...unwind.pc.in-and-llvm-config-scripts.patch | 90 ++++ ...spect-LLVM_LIBDIR_SUFFIX-like-other-.patch | 92 ++++ meta/recipes-devtools/clang/clang_git.bb | 463 ++++++++++++++++++ meta/recipes-devtools/clang/common-source.inc | 17 + meta/recipes-devtools/clang/common.inc | 66 +++ .../clang/compiler-rt-sanitizers_git.bb | 123 +++++ .../recipes-devtools/clang/compiler-rt_git.bb | 126 +++++ meta/recipes-devtools/clang/libclc_git.bb | 36 ++ meta/recipes-devtools/clang/libcxx_git.bb | 115 +++++ .../clang/llvm-project-source.bb | 12 + .../clang/llvm-project-source.inc | 99 ++++ .../clang/nativesdk-clang-glue.bb | 36 ++ meta/recipes-devtools/clang/openmp_git.bb | 65 +++ 49 files changed, 3506 insertions(+) create mode 100644 meta/recipes-devtools/clang/clang-cross-canadian_git.bb create mode 100644 meta/recipes-devtools/clang/clang-cross_git.bb create mode 100644 meta/recipes-devtools/clang/clang-crosssdk_git.bb create mode 100644 meta/recipes-devtools/clang/clang.inc create mode 100644 meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch create mode 100644 meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch create mode 100644 meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch create mode 100644 meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch create mode 100644 meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch create mode 100644 meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch create mode 100644 meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch create mode 100644 meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch create mode 100644 meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch create mode 100644 meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch create mode 100644 meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch create mode 100644 meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch create mode 100644 meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch create mode 100644 meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch create mode 100644 meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch create mode 100644 meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch create mode 100644 meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch create mode 100644 meta/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch create mode 100644 meta/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 meta/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch create mode 100644 meta/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 meta/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch create mode 100644 meta/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch create mode 100644 meta/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch create mode 100644 meta/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch create mode 100644 meta/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch create mode 100644 meta/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch create mode 100644 meta/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch create mode 100644 meta/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch create mode 100644 meta/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch create mode 100644 meta/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch create mode 100644 meta/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch create mode 100644 meta/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch create mode 100644 meta/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch create mode 100644 meta/recipes-devtools/clang/clang_git.bb create mode 100644 meta/recipes-devtools/clang/common-source.inc create mode 100644 meta/recipes-devtools/clang/common.inc create mode 100644 meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb create mode 100644 meta/recipes-devtools/clang/compiler-rt_git.bb create mode 100644 meta/recipes-devtools/clang/libclc_git.bb create mode 100644 meta/recipes-devtools/clang/libcxx_git.bb create mode 100644 meta/recipes-devtools/clang/llvm-project-source.bb create mode 100644 meta/recipes-devtools/clang/llvm-project-source.inc create mode 100644 meta/recipes-devtools/clang/nativesdk-clang-glue.bb create mode 100644 meta/recipes-devtools/clang/openmp_git.bb diff --git a/meta/recipes-devtools/clang/clang-cross-canadian_git.bb b/meta/recipes-devtools/clang/clang-cross-canadian_git.bb new file mode 100644 index 00000000000..33c33c4d443 --- /dev/null +++ b/meta/recipes-devtools/clang/clang-cross-canadian_git.bb @@ -0,0 +1,36 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)" +HOMEPAGE = "http://clang.llvm.org/" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +PN = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}" + +require clang.inc +require common-source.inc +inherit cross-canadian + +DEPENDS += "nativesdk-clang binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} virtual/${HOST_PREFIX}binutils virtual/nativesdk-libc" +# We have to point gcc at a sysroot but we don't need to rebuild if this changes +# e.g. we switch between different machines with different tunes. +EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH" +TARGET_ARCH[vardepsexclude] = "TUNE_ARCH" + +do_install() { + install -d ${D}${bindir} + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov + do + ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool + done +} +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-llvm-ar \ + *-llvm-ranlib *-llvm-nm *-lld *-ld.lld *-llvm-as *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" +do_install:append() { + cross_canadian_bindirlinks +} diff --git a/meta/recipes-devtools/clang/clang-cross_git.bb b/meta/recipes-devtools/clang/clang-cross_git.bb new file mode 100644 index 00000000000..8aee5cd8628 --- /dev/null +++ b/meta/recipes-devtools/clang/clang-cross_git.bb @@ -0,0 +1,35 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "Cross compiler wrappers for LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +PN = "clang-cross-${TARGET_ARCH}" + +require clang.inc +require common-source.inc +inherit cross +DEPENDS += "clang-native virtual/${TARGET_PREFIX}binutils" + +do_install() { + install -d ${D}${bindir} + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov + do + ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool + done +} +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \ + *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" + +SYSROOT_PREPROCESS_FUNCS += "clangcross_sysroot_preprocess" + +clangcross_sysroot_preprocess () { + sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} +} +PACKAGES = "" diff --git a/meta/recipes-devtools/clang/clang-crosssdk_git.bb b/meta/recipes-devtools/clang/clang-crosssdk_git.bb new file mode 100644 index 00000000000..e4b521d0d23 --- /dev/null +++ b/meta/recipes-devtools/clang/clang-crosssdk_git.bb @@ -0,0 +1,34 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +PN = "clang-crosssdk-${SDK_SYS}" + +require clang.inc +require common-source.inc +inherit crosssdk +DEPENDS += "clang-native nativesdk-clang-glue virtual/${TARGET_PREFIX}binutils virtual/nativesdk-libc" + +do_install() { + install -d ${D}${bindir} + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov + do + ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool + done +} +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \ + *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" +sysroot_stage_all () { + sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} +} + +PACKAGES = "" + diff --git a/meta/recipes-devtools/clang/clang.inc b/meta/recipes-devtools/clang/clang.inc new file mode 100644 index 00000000000..3005acc7dd1 --- /dev/null +++ b/meta/recipes-devtools/clang/clang.inc @@ -0,0 +1,24 @@ +LLVM_RELEASE = "" +LLVM_DIR = "llvm${LLVM_RELEASE}" + +LLVM_HTTP ?= "https://github.com/llvm" + +MAJOR_VER = "19" +MINOR_VER = "1" +PATCH_VER = "3" +# could be 'rcX' or 'git' or empty ( for release ) +VER_SUFFIX = "" + +PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" + +LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" +CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" +LLDMD5SUM = "ae7dc7c027b1fa89b5b013d391d3ee2b" +LLDBMD5SUM = "2e0d44968471fcde980034dbb826bea9" + +LLVM_LIBDIR_SUFFIX="${@d.getVar('baselib').replace('lib', '')}" + +# set the default pigz thread +export PIGZ = "-p ${@oe.utils.cpu_count(at_least=2)}" + +require common.inc diff --git a/meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch new file mode 100644 index 00000000000..f2cc81e765d --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -0,0 +1,60 @@ +From 1ae8003c398cb280038301697860ef5769687648 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 27 Aug 2017 10:37:49 -0700 +Subject: [PATCH] libcxxabi: Find libunwind headers when + LIBCXXABI_LIBUNWIND_INCLUDES is set + +Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments +then it ends up not searching the specified dir and unwind.h is not found +especially for ARM targets + +This patch makes the searching synthesized directories and then set +LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libcxxabi/CMakeLists.txt | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt +index 43400c6e8d9a..cc0841112c0c 100644 +--- a/libcxxabi/CMakeLists.txt ++++ b/libcxxabi/CMakeLists.txt +@@ -423,7 +423,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH + "Specify path to libunwind source." FORCE) + + if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +- find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h ++ find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h + PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} + ${LIBCXXABI_LIBUNWIND_PATH}/include + ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} +@@ -434,18 +434,23 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) + NO_CMAKE_FIND_ROOT_PATH + ) + +- if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND") +- set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "") ++ if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND") ++ set(LIBCXXABI_LIBUNWIND_INCLUDES "") + endif() + endif() + +-if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "") +- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}") ++if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES}" STREQUAL "") ++ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") + endif() + + add_custom_target(cxxabi-test-depends + COMMENT "Build dependencies required to run the libc++abi test suite.") + ++set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH ++ "Specify path to libunwind includes." FORCE) ++set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH ++ "Specify path to libunwind source." FORCE) ++ + # Add source code. This also contains all of the logic for deciding linker flags + # soname, etc... + add_subdirectory(include) diff --git a/meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch b/meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch new file mode 100644 index 00000000000..e8981b8d763 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch @@ -0,0 +1,309 @@ +From c0462b384da7a882ea924ea47476c3cb49feae46 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 19 Apr 2015 15:16:23 -0700 +Subject: [PATCH] compiler-rt: support a new embedded linux target + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ + .../clang_linux_embedded_test_input.c | 0 + 2 files changed, 286 insertions(+) + create mode 100644 compiler-rt/make/platform/clang_linux_embedded.mk + create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c + +diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk +new file mode 100644 +index 000000000000..d0a890075a1c +--- /dev/null ++++ b/compiler-rt/make/platform/clang_linux_embedded.mk +@@ -0,0 +1,286 @@ ++# These are the functions which clang needs when it is targeting a previous ++# version of the OS. The issue is that the backend may use functions which were ++# not present in the libgcc that shipped on the platform. In such cases, we link ++# with a version of the library which contains private_extern definitions of all ++# the extra functions which might be referenced. ++ ++Description := Static runtime libraries for embedded clang/Linux ++ ++# A function that ensures we don't try to build for architectures that we ++# don't have working toolchains for. ++CheckArches = \ ++ $(shell \ ++ result=""; \ ++ for arch in $(1); do \ ++ if $(CC) -arch $$arch -c \ ++ -integrated-as \ ++ $(ProjSrcRoot)/make/platform/clang_linux_embedded_test_input.c \ ++ -o /dev/null > /dev/null 2> /dev/null; then \ ++ result="$$result$$arch "; \ ++ else \ ++ printf 1>&2 \ ++ "warning: clang_linux_embedded.mk: dropping arch '$$arch' from lib '$(2)'\n"; \ ++ fi; \ ++ done; \ ++ echo $$result) ++ ++XCRun = \ ++ $(shell \ ++ result=`xcrun -find $(1) 2> /dev/null`; \ ++ if [ "$$?" != "0" ]; then result=$(1); fi; \ ++ echo $$result) ++ ++### ++ ++CC := $(call XCRun,clang) ++AR := $(call XCRun,ar) ++RANLIB := $(call XCRun,ranlib) ++STRIP := $(call XCRun,strip) ++LIPO := $(call XCRun,lipo) ++DSYMUTIL := $(call XCRun,dsymutil) ++Configs := ++UniversalArchs := ++ ++# Soft-float version of the runtime. No floating-point instructions will be used ++# and the ABI (out of necessity) passes floating values in normal registers: ++# non-VFP variant of the AAPCS. ++UniversalArchs.soft_static := $(call CheckArches,arm armv7m armv7em armv7,soft_static) ++Configs += $(if $(UniversalArchs.soft_static),soft_static) ++ ++# Hard-float version of the runtime. On ARM VFP instructions and registers are ++# allowed, and floating point values get passed in them. VFP variant of the ++# AAPCS. ++UniversalArchs.hard_static := $(call CheckArches,armv7em armv7 i386 x86_64,hard_static) ++Configs += $(if $(UniversalArchs.hard_static),hard_static) ++ ++UniversalArchs.soft_pic := $(call CheckArches,armv6m armv7m armv7em armv7,soft_pic) ++Configs += $(if $(UniversalArchs.soft_pic),soft_pic) ++ ++UniversalArchs.hard_pic := $(call CheckArches,armv7em armv7 i386 x86_64,hard_pic) ++Configs += $(if $(UniversalArchs.hard_pic),hard_pic) ++ ++CFLAGS := -Wall -Werror -Oz -fomit-frame-pointer -ffreestanding ++ ++PIC_CFLAGS := -fPIC ++STATIC_CFLAGS := -static ++ ++CFLAGS_SOFT := -mfloat-abi=soft ++CFLAGS_HARD := -mfloat-abi=hard ++ ++CFLAGS_I386 := -march=pentium ++ ++CFLAGS.soft_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_SOFT) ++CFLAGS.hard_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_HARD) ++CFLAGS.soft_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_SOFT) ++CFLAGS.hard_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_HARD) ++ ++CFLAGS.soft_static.armv7 := $(CFLAGS.soft_static) $(CFLAGS_ARMV7) ++CFLAGS.hard_static.armv7 := $(CFLAGS.hard_static) $(CFLAGS_ARMV7) ++CFLAGS.soft_pic.armv7 := $(CFLAGS.soft_pic) $(CFLAGS_ARMV7) ++CFLAGS.hard_pic.armv7 := $(CFLAGS.hard_pic) $(CFLAGS_ARMV7) ++ ++# x86 platforms ignore -mfloat-abi options and complain about doing so. Despite ++# this they're hard-float. ++CFLAGS.hard_static.i386 := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_I386) ++CFLAGS.hard_pic.i386 := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_I386) ++CFLAGS.hard_static.x86_64 := $(CFLAGS) $(STATIC_CFLAGS) ++CFLAGS.hard_pic.x86_64 := $(CFLAGS) $(PIC_CFLAGS) ++ ++# Functions not wanted: ++# + eprintf is obsolete anyway ++# + *vfp: designed for Thumb1 CPUs with VFPv2 ++ ++COMMON_FUNCTIONS := \ ++ absvdi2 \ ++ absvsi2 \ ++ addvdi3 \ ++ addvsi3 \ ++ ashldi3 \ ++ ashrdi3 \ ++ bswapdi2 \ ++ bswapsi2 \ ++ clzdi2 \ ++ clzsi2 \ ++ cmpdi2 \ ++ ctzdi2 \ ++ ctzsi2 \ ++ divdc3 \ ++ divdi3 \ ++ divsc3 \ ++ divmodsi4 \ ++ udivmodsi4 \ ++ do_global_dtors \ ++ ffsdi2 \ ++ fixdfdi \ ++ fixsfdi \ ++ fixunsdfdi \ ++ fixunsdfsi \ ++ fixunssfdi \ ++ fixunssfsi \ ++ floatdidf \ ++ floatdisf \ ++ floatundidf \ ++ floatundisf \ ++ gcc_bcmp \ ++ lshrdi3 \ ++ moddi3 \ ++ muldc3 \ ++ muldi3 \ ++ mulsc3 \ ++ mulvdi3 \ ++ mulvsi3 \ ++ negdi2 \ ++ negvdi2 \ ++ negvsi2 \ ++ paritydi2 \ ++ paritysi2 \ ++ popcountdi2 \ ++ popcountsi2 \ ++ powidf2 \ ++ powisf2 \ ++ subvdi3 \ ++ subvsi3 \ ++ ucmpdi2 \ ++ udiv_w_sdiv \ ++ udivdi3 \ ++ udivmoddi4 \ ++ umoddi3 \ ++ adddf3 \ ++ addsf3 \ ++ cmpdf2 \ ++ cmpsf2 \ ++ div0 \ ++ divdf3 \ ++ divsf3 \ ++ divsi3 \ ++ extendsfdf2 \ ++ ffssi2 \ ++ fixdfsi \ ++ fixsfsi \ ++ floatsidf \ ++ floatsisf \ ++ floatunsidf \ ++ floatunsisf \ ++ comparedf2 \ ++ comparesf2 \ ++ modsi3 \ ++ muldf3 \ ++ mulsf3 \ ++ negdf2 \ ++ negsf2 \ ++ subdf3 \ ++ subsf3 \ ++ truncdfsf2 \ ++ udivsi3 \ ++ umodsi3 \ ++ unorddf2 \ ++ unordsf2 ++ ++ARM_FUNCTIONS := \ ++ aeabi_cdcmpeq \ ++ aeabi_cdrcmple \ ++ aeabi_cfcmpeq \ ++ aeabi_cfrcmple \ ++ aeabi_dcmpeq \ ++ aeabi_dcmpge \ ++ aeabi_dcmpgt \ ++ aeabi_dcmple \ ++ aeabi_dcmplt \ ++ aeabi_drsub \ ++ aeabi_fcmpeq \ ++ aeabi_fcmpge \ ++ aeabi_fcmpgt \ ++ aeabi_fcmple \ ++ aeabi_fcmplt \ ++ aeabi_frsub \ ++ aeabi_idivmod \ ++ aeabi_uidivmod \ ++ ++# ARM Assembly implementation which requires Thumb2 (i.e. won't work on v6M). ++THUMB2_FUNCTIONS := \ ++ switch16 \ ++ switch32 \ ++ switch8 \ ++ switchu8 \ ++ sync_fetch_and_add_4 \ ++ sync_fetch_and_sub_4 \ ++ sync_fetch_and_and_4 \ ++ sync_fetch_and_or_4 \ ++ sync_fetch_and_xor_4 \ ++ sync_fetch_and_nand_4 \ ++ sync_fetch_and_max_4 \ ++ sync_fetch_and_umax_4 \ ++ sync_fetch_and_min_4 \ ++ sync_fetch_and_umin_4 \ ++ sync_fetch_and_add_8 \ ++ sync_fetch_and_sub_8 \ ++ sync_fetch_and_and_8 \ ++ sync_fetch_and_or_8 \ ++ sync_fetch_and_xor_8 \ ++ sync_fetch_and_nand_8 \ ++ sync_fetch_and_max_8 \ ++ sync_fetch_and_umax_8 \ ++ sync_fetch_and_min_8 \ ++ sync_fetch_and_umin_8 ++ ++I386_FUNCTIONS := \ ++ i686.get_pc_thunk.eax \ ++ i686.get_pc_thunk.ebp \ ++ i686.get_pc_thunk.ebx \ ++ i686.get_pc_thunk.ecx \ ++ i686.get_pc_thunk.edi \ ++ i686.get_pc_thunk.edx \ ++ i686.get_pc_thunk.esi ++ ++# FIXME: Currently, compiler-rt is missing implementations for a number of the ++# functions. Filter them out for now. ++MISSING_FUNCTIONS := \ ++ cmpdf2 cmpsf2 div0 \ ++ ffssi2 \ ++ udiv_w_sdiv unorddf2 unordsf2 bswapdi2 \ ++ bswapsi2 \ ++ gcc_bcmp \ ++ do_global_dtors \ ++ i686.get_pc_thunk.eax i686.get_pc_thunk.ebp i686.get_pc_thunk.ebx \ ++ i686.get_pc_thunk.ecx i686.get_pc_thunk.edi i686.get_pc_thunk.edx \ ++ i686.get_pc_thunk.esi \ ++ aeabi_cdcmpeq aeabi_cdrcmple aeabi_cfcmpeq aeabi_cfrcmple aeabi_dcmpeq \ ++ aeabi_dcmpge aeabi_dcmpgt aeabi_dcmple aeabi_dcmplt aeabi_drsub \ ++ aeabi_fcmpeq \ aeabi_fcmpge aeabi_fcmpgt aeabi_fcmple aeabi_fcmplt \ ++ aeabi_frsub aeabi_idivmod aeabi_uidivmod ++ ++FUNCTIONS_ARMV6M := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) ++FUNCTIONS_ARM_ALL := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) $(THUMB2_FUNCTIONS) ++FUNCTIONS_I386 := $(COMMON_FUNCTIONS) $(I386_FUNCTIONS) ++FUNCTIONS_X86_64 := $(COMMON_FUNCTIONS) ++ ++FUNCTIONS_ARMV6M := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARMV6M)) ++FUNCTIONS_ARM_ALL := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARM_ALL)) ++FUNCTIONS_I386 := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_I386)) ++FUNCTIONS_X86_64 := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_X86_64)) ++ ++FUNCTIONS.soft_static.armv6m := $(FUNCTIONS_ARMV6M) ++FUNCTIONS.soft_pic.armv6m := $(FUNCTIONS_ARMV6M) ++ ++FUNCTIONS.soft_static.armv7m := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7m := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.soft_static.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_static.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_pic.armv7em := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.soft_static.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_static.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_pic.armv7 := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.hard_static.i386 := $(FUNCTIONS_I386) ++FUNCTIONS.hard_pic.i386 := $(FUNCTIONS_I386) ++ ++FUNCTIONS.hard_static.x86_64 := $(FUNCTIONS_X86_64) ++FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64) +diff --git a/compiler-rt/make/platform/clang_linux_embedded_test_input.c b/compiler-rt/make/platform/clang_linux_embedded_test_input.c +new file mode 100644 +index 000000000000..e69de29bb2d1 diff --git a/meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch new file mode 100644 index 00000000000..0cf0a89767d --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -0,0 +1,44 @@ +From 4f2e69944e8a42da9bd1f7d49399dc3d0fad4859 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 19 May 2016 23:11:45 -0700 +Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use + native-compiled llvm-config. + + Note: AddLLVM.cmake does not expose the LLVM source directory. + So if you want to run the test suite, you need to either: + + 1) set LLVM_MAIN_SRC_DIR explicitly (to find lit.py) + 2) change AddLLVM.cmake to point to an installed 'lit'. + 3) add_subdirectory(compiler-rt/test) from clang instead of compiler-rt. + +https://us.codeaurora.org/patches/quic/llvm/50683/compiler-rt-cross-compilation.patch + +Upstream-Status: Pending +Signed-off-by: Greg Fitzgerald +Signed-off-by: Khem Raj +--- + compiler-rt/CMakeLists.txt | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt +index 2207555b03a0..c28106378bdd 100644 +--- a/compiler-rt/CMakeLists.txt ++++ b/compiler-rt/CMakeLists.txt +@@ -86,7 +86,16 @@ if (COMPILER_RT_STANDALONE_BUILD) + set(CMAKE_CXX_EXTENSIONS NO) + + if (NOT LLVM_RUNTIMES_BUILD) +- load_llvm_config() ++ find_package(LLVM REQUIRED) ++ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") ++ ++ # Variables that AddLLVM.cmake depends on (included by AddCompilerRT) ++ set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin") ++ set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib") ++ ++ set(LLVM_LIBRARY_OUTPUT_INTDIR ++ ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) ++ + endif() + if (TARGET intrinsics_gen) + # Loading the llvm config causes this target to be imported so place it diff --git a/meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch new file mode 100644 index 00000000000..8d8995b3f99 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -0,0 +1,90 @@ +From 0d94f6e299bfa76da9be6451d9e759bc3f6d08a7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 21 May 2016 00:33:20 +0000 +Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are + macros + +musl defines some functions as macros and not inline functions +if this is the case then make sure to undefine them + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../llvm/Analysis/TargetLibraryInfo.def | 22 ++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +index 623cdb4b6e0b..18bb48beb702 100644 +--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def ++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +@@ -1368,6 +1368,9 @@ TLI_DEFINE_STRING_INTERNAL("fopen") + TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr) + + /// FILE *fopen64(const char *filename, const char *opentype) ++#ifdef fopen64 ++#undef fopen64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fopen64) + TLI_DEFINE_STRING_INTERNAL("fopen64") + TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr) +@@ -1446,7 +1449,9 @@ TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Long, Int) + TLI_DEFINE_ENUM_INTERNAL(fseeko) + TLI_DEFINE_STRING_INTERNAL("fseeko") + TLI_DEFINE_SIG_INTERNAL(Int, Ptr, IntX, Int) +- ++#ifdef fseeko64 ++#undef fseeko64 ++#endif + /// int fseeko64(FILE *stream, off64_t offset, int whence) + TLI_DEFINE_ENUM_INTERNAL(fseeko64) + TLI_DEFINE_STRING_INTERNAL("fseeko64") +@@ -1463,6 +1468,9 @@ TLI_DEFINE_STRING_INTERNAL("fstat") + TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr) + + /// int fstat64(int filedes, struct stat64 *buf) ++#ifdef fstat64 ++#undef fstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fstat64) + TLI_DEFINE_STRING_INTERNAL("fstat64") + TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr) +@@ -1488,6 +1496,9 @@ TLI_DEFINE_STRING_INTERNAL("ftello") + TLI_DEFINE_SIG_INTERNAL(IntPlus, Ptr) + + /// off64_t ftello64(FILE *stream) ++#ifdef ftello64 ++#undef ftello64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(ftello64) + TLI_DEFINE_STRING_INTERNAL("ftello64") + TLI_DEFINE_SIG_INTERNAL(Int64, Ptr) +@@ -1698,6 +1709,9 @@ TLI_DEFINE_STRING_INTERNAL("lstat") + TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) + + /// int lstat64(const char *path, struct stat64 *buf); ++#ifdef lstat64 ++#undef lstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(lstat64) + TLI_DEFINE_STRING_INTERNAL("lstat64") + TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) +@@ -2125,6 +2139,9 @@ TLI_DEFINE_STRING_INTERNAL("stat") + TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) + + /// int stat64(const char *path, struct stat64 *buf); ++#ifdef stat64 ++#undef stat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(stat64) + TLI_DEFINE_STRING_INTERNAL("stat64") + TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) +@@ -2350,6 +2367,9 @@ TLI_DEFINE_STRING_INTERNAL("tmpfile") + TLI_DEFINE_SIG_INTERNAL(Ptr) + + /// FILE *tmpfile64(void) ++#ifdef tmpfile64 ++#undef tmpfile64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(tmpfile64) + TLI_DEFINE_STRING_INTERNAL("tmpfile64") + TLI_DEFINE_SIG_INTERNAL(Ptr) diff --git a/meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch b/meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch new file mode 100644 index 00000000000..f7677807c0a --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch @@ -0,0 +1,71 @@ +From 754c5869819c2dd008786a191f06385e6b97e19b Mon Sep 17 00:00:00 2001 +From: Martin Kelly +Date: Fri, 19 May 2017 00:22:57 -0700 +Subject: [PATCH] llvm: allow env override of exe and libdir path + +When using a native llvm-config from inside a sysroot, we need llvm-config to +return the libraries, include directories, etc. from inside the sysroot rather +than from the native sysroot. Thus provide an env override for calling +llvm-config from a target sysroot. + +Add YOCTO_ALTERNATE_LIBDIR and YOCTO_ALTERNATE_EXE_PATH env variables + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Martin Kelly +Signed-off-by: Khem Raj +--- + llvm/tools/llvm-config/llvm-config.cpp | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + +diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp +index d5b76b1bb6c1..a739f0d8dbea 100644 +--- a/llvm/tools/llvm-config/llvm-config.cpp ++++ b/llvm/tools/llvm-config/llvm-config.cpp +@@ -246,6 +246,13 @@ Typical components:\n\ + + /// Compute the path to the main executable. + std::string GetExecutablePath(const char *Argv0) { ++ // Hack for Yocto: we need to override the root path when we are using ++ // llvm-config from within a target sysroot. ++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); ++ if (Sysroot != nullptr) { ++ return Sysroot; ++ } ++ + // This just needs to be some symbol in the binary; C++ doesn't + // allow taking the address of ::main however. + void *P = (void *)(intptr_t)GetExecutablePath; +@@ -325,7 +332,7 @@ int main(int argc, char **argv) { + // Compute various directory locations based on the derived location + // information. + std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir, +- ActiveCMakeDir; ++ ActiveCMakeDir, BaseLibDir; + std::string ActiveIncludeOption; + if (IsInDevelopmentTree) { + ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include"; +@@ -366,12 +373,18 @@ int main(int argc, char **argv) { + sys::fs::make_absolute(ActivePrefix, Path); + ActiveBinDir = std::string(Path); + } +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- { +- SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); +- sys::fs::make_absolute(ActivePrefix, Path); +- ActiveCMakeDir = std::string(Path); ++ // Hack for Yocto: we need to override the lib path when we are using ++ // llvm-config from within a target sysroot since LLVM_LIBDIR_SUFFIX ++ // maybe different for host llvm vs target e.g. ppc64 Libdir=lib64 but ++ // x86_64 Libdir = lib ++ const char *YoctoLibDir = std::getenv("YOCTO_ALTERNATE_LIBDIR"); ++ if (YoctoLibDir != nullptr) { ++ BaseLibDir = std::string(YoctoLibDir); ++ } else { ++ BaseLibDir = std::string("/lib") + LLVM_LIBDIR_SUFFIX; + } ++ ActiveLibDir = ActivePrefix + BaseLibDir; ++ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + diff --git a/meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch b/meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch new file mode 100644 index 00000000000..9a4621b3a4e --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch @@ -0,0 +1,75 @@ +From df4c35c458e7f0b752e76500316ce3ab7583dd5b Mon Sep 17 00:00:00 2001 +From: Dan McGregor +Date: Wed, 26 Apr 2017 20:29:41 -0600 +Subject: [PATCH] clang: driver: Check sysroot for ldso path + +OE does not necessarily follow the default path for the dynamic linker, +therefore adjust it for OE. Check for the default path, and if it isn't +there, check /lib. + +Upstream-Status: Pending +Signed-off-by: Dan McGregor +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 35bf39069605..e4f593e462d6 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -511,7 +511,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + Triple.getEnvironment() == llvm::Triple::GNUEABIHFT64 || + tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; + +- LibDir = "lib"; ++ LibDir = "lib32"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; + break; + } +@@ -566,11 +570,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::ppc64le: + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: { +@@ -588,6 +600,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::sparcv9: + LibDir = "lib64"; + Loader = "ld-linux.so.2"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::systemz: + LibDir = "lib"; +@@ -602,6 +618,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + + LibDir = X32 ? "libx32" : "lib64"; + Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + } + case llvm::Triple::ve: diff --git a/meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch new file mode 100644 index 00000000000..fc46b3ca1b1 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -0,0 +1,32 @@ +From 7875b568926bbec5b7e3312c55991723c917493e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 19 May 2016 21:11:06 -0700 +Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl + +musl driver will need to add ssp_nonshared for stack_check_local +on the linker cmdline when using stack protector commands on +compiler cmdline + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 5e9a655eaf82..3e301f2e1d95 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -632,6 +632,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, + if (IsIAMCU) + CmdArgs.push_back("-lgloss"); + ++ if (ToolChain.getTriple().isMusl() && ++ (Args.hasArg(options::OPT_fstack_protector) || ++ Args.hasArg(options::OPT_fstack_protector_strong) || ++ Args.hasArg(options::OPT_fstack_protector_all))) { ++ CmdArgs.push_back("-lssp_nonshared"); ++ } + if (IsStatic || IsStaticPIE) + CmdArgs.push_back("--end-group"); + else diff --git a/meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch b/meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch new file mode 100644 index 00000000000..f21be08e2a2 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch @@ -0,0 +1,39 @@ +From 84c1650cac223a4578eb43c905fdfb30b617274e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 16 Mar 2017 09:02:13 -0700 +Subject: [PATCH] clang: Prepend trailing '/' to sysroot + +This is needed to handle a case where clang +isntall and target sysroot are perilously same + +e.g. + +sysroot = /mnt/clang/recipe-sysroot +clang install = /mnt/clang/recipe-sysroot-native + +in this case it will mistakenly assume that +clang is installed under the same sysroot dir +and it will try to add relative ../lib paths +to linker steps which would then be wrong +since they will become relative to clang +installation and not sysroot + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index e4f593e462d6..720bc136528b 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -222,7 +222,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + Multilibs = GCCInstallation.getMultilibs(); + SelectedMultilibs.assign({GCCInstallation.getMultilib()}); + llvm::Triple::ArchType Arch = Triple.getArch(); +- std::string SysRoot = computeSysRoot(); ++ std::string SysRoot = computeSysRoot() + "/"; + ToolChain::path_list &PPaths = getProgramPaths(); + + Generic_GCC::PushPPaths(PPaths); diff --git a/meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch new file mode 100644 index 00000000000..2ee776bef2e --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -0,0 +1,41 @@ +From 4584c7048d003b239593ad66162437ffd669c220 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 16 Mar 2017 19:06:26 -0700 +Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime + +In OE compiler-rt and libc++ are built and staged into target +sysroot and not into resourcedir which is relative to clang +driver installation where the libraries are not instlled + +Specific to cross compiling the way yocto/OE works + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChain.cpp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp +index 20a555afb809..e6d285795337 100644 +--- a/clang/lib/Driver/ToolChain.cpp ++++ b/clang/lib/Driver/ToolChain.cpp +@@ -15,6 +15,7 @@ + #include "ToolChains/InterfaceStubs.h" + #include "clang/Basic/ObjCRuntime.h" + #include "clang/Basic/Sanitizers.h" ++#include "clang/Basic/Version.h" + #include "clang/Config/config.h" + #include "clang/Driver/Action.h" + #include "clang/Driver/Driver.h" +@@ -619,7 +620,10 @@ StringRef ToolChain::getOSLibName() const { + } + + std::string ToolChain::getCompilerRTPath() const { +- SmallString<128> Path(getDriver().ResourceDir); ++ SmallString<128> Path(getDriver().SysRoot); ++ StringRef ClangLibdirBasename(CLANG_INSTALL_LIBDIR_BASENAME); ++ llvm::sys::path::append(Path, "/usr/", ClangLibdirBasename, "clang", ++ CLANG_VERSION_STRING); + if (isBareMetal()) { + llvm::sys::path::append(Path, "lib", getOSLibName()); + if (!SelectedMultilibs.empty()) { diff --git a/meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch b/meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch new file mode 100644 index 00000000000..c8978088d93 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch @@ -0,0 +1,47 @@ +From c86ed165440802158757582df52f848cad3c0e57 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 20 Mar 2021 16:09:16 -0700 +Subject: [PATCH] clang: Define / releative gcc installation dir + +This is required for OE gcc installation to work. +Without this its not able to find the paths for libgcc +and other standard headers and libraries from gcc +installation in OE + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 3e301f2e1d95..89ffc429d059 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2918,19 +2918,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // Whether this library suffix is relevant for the triple. + bool Active; + } Suffixes[] = { +- // This is the normal place. +- {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, +- +- // Debian puts cross-compilers in gcc-cross. +- {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}, +- + // The Freescale PPC SDK has the gcc libraries in + // /usr/lib//x.y.z so have a look there as well. Only do + // this on Freescale triples, though, since some systems put a *lot* of + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}}; ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ ++ // This is the normal place. ++ {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, ++ ++ // Debian puts cross-compilers in gcc-cross. ++ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}}; + + for (auto &Suffix : Suffixes) { + if (!Suffix.Active) diff --git a/meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch new file mode 100644 index 00000000000..b5712d6b690 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -0,0 +1,35 @@ +From 08b05e4e835b6cb73c844e300dcc4eb4919d8154 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 31 Jul 2019 22:51:39 -0700 +Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static + linking + +When doing static liking with --unwindlib=libunwind -static we encounter +undefined symbols +libunwind/src/RWMutex.hpp:68: undefined reference to `pthread_rwlock_wrlock' + +and + +libunwind/src/AddressSpace.hpp:597: undefined reference to `dladdr' + +therefore we need to link in libpthread and libdl to fill these symbols + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index 019df16a909f..00d608c0c095 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -2183,6 +2183,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, + CmdArgs.push_back("-lunwind"); + } else if (LGT == LibGccType::StaticLibGcc) { + CmdArgs.push_back("-l:libunwind.a"); ++ CmdArgs.push_back("-lpthread"); ++ CmdArgs.push_back("-ldl"); + } else if (LGT == LibGccType::SharedLibGcc) { + if (TC.getTriple().isOSCygMing()) + CmdArgs.push_back("-l:libunwind.dll.a"); diff --git a/meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file mode 100644 index 00000000000..2086e0ad2f2 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,24 @@ +From 322385b4a6109f3f53c3679d7a276ec0084dd7b6 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Thu, 26 Dec 2019 12:56:16 -0800 +Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build + +Upstream-Status: Pending +Signed-off-by: Anuj Mittal +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CrossCompile.cmake | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake +index 39b4abaa0d93..a47afde7f85d 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -92,6 +92,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" + -DLLVM_INCLUDE_BENCHMARKS=OFF + -DLLVM_INCLUDE_TESTS=OFF ++ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" + ${build_type_flags} ${linker_flag} ${external_clang_dir} ${libc_flags} + ${ARGN} + WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} diff --git a/meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch b/meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch new file mode 100644 index 00000000000..6db24a941a6 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch @@ -0,0 +1,34 @@ +From 2f41e0721f964677e8876b2c2f540836f426c83f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 18 Nov 2019 17:00:29 -0800 +Subject: [PATCH] Check for atomic intrinsics + +On some architectures e.g. x86/32bit gcc decides to inline calls to +double atomic variables but clang does not and defers it to libatomic +therefore detect if clang can use built-ins for atomic if not +then link libatomic, this helps building clangd for x86 on linux systems +with gcc runtime + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CheckAtomic.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake +index f11cadf39ff6..80a18a92956a 100644 +--- a/llvm/cmake/modules/CheckAtomic.cmake ++++ b/llvm/cmake/modules/CheckAtomic.cmake +@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname) + #include + #include + std::atomic x (0); ++std::atomic y (0); + int main() { + uint64_t i = x.load(std::memory_order_relaxed); + (void)i; +- return 0; ++ return int(y); + } + " ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) diff --git a/meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch b/meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch new file mode 100644 index 00000000000..5e9eb01a925 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch @@ -0,0 +1,115 @@ +From 6c4f71af6a8c5c0e9261cd20522ecf8d1cdb9e48 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Fri, 31 Jan 2020 10:56:11 +0200 +Subject: [PATCH] cmake: Fix configure for packages using find_package() + +Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) +that depends on LLVM/Clang tries to run cmake find_package() during +do_configure, it will fail with a similar error: + +| The imported target "llvm-tblgen" references the file +| ".../recipe-sysroot/usr/bin/llvm-tblgen" +| +| but this file does not exist. Possible reasons include: +| * The file was deleted, renamed, or moved to another location. +| * An install or uninstall procedure did not complete successfully. +| * The installation package was faulty and contained +| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" +| but not all the files it references. + +This is due to the fact that currently the cmake scripts look for target +binaries in sysroot. Work around this by not exporting the target binaries in +Exports-* cmake files. + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + clang/cmake/modules/AddClang.cmake | 2 -- + llvm/cmake/modules/AddLLVM.cmake | 7 +------ + llvm/cmake/modules/TableGen.cmake | 6 ------ + 3 files changed, 1 insertion(+), 14 deletions(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 9d09be193684..d6123b834337 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -169,7 +169,6 @@ macro(add_clang_tool name) + if (CLANG_BUILD_TOOLS) + get_target_export_arg(${name} Clang export_to_clangtargets) + install(TARGETS ${name} +- ${export_to_clangtargets} + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT ${name}) + +@@ -178,7 +177,6 @@ macro(add_clang_tool name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) + endif() + endif() + endmacro() +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 03f4e1f190fd..6335ab262d19 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1435,7 +1435,6 @@ macro(llvm_add_tool project name) + if( LLVM_BUILD_TOOLS ) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1446,9 +1445,7 @@ macro(llvm_add_tool project name) + endif() + endif() + endif() +- if( LLVM_BUILD_TOOLS ) +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) +- endif() ++ set_target_properties(${name} PROPERTIES FOLDER "Tools") + endif() + get_subproject_title(subproject_title) + set_target_properties(${name} PROPERTIES FOLDER "${subproject_title}/Tools") +@@ -1497,7 +1494,6 @@ macro(add_llvm_utility name) + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1506,7 +1502,6 @@ macro(add_llvm_utility name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + elseif(LLVM_BUILD_UTILS) + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) + endif() +diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake +index ffcc718b4777..a76f28e74b86 100644 +--- a/llvm/cmake/modules/TableGen.cmake ++++ b/llvm/cmake/modules/TableGen.cmake +@@ -232,12 +232,7 @@ macro(add_tablegen target project) + + if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND + (LLVM_BUILD_UTILS OR ${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)) +- set(export_arg) +- if(ADD_TABLEGEN_EXPORT) +- get_target_export_arg(${target} ${ADD_TABLEGEN_EXPORT} export_arg) +- endif() + install(TARGETS ${target} +- ${export_arg} + COMPONENT ${target} + RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}") + if(NOT LLVM_ENABLE_IDE) +@@ -248,6 +243,5 @@ macro(add_tablegen target project) + endif() + if(ADD_TABLEGEN_EXPORT) + string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper) +- set_property(GLOBAL APPEND PROPERTY ${export_upper}_EXPORTS ${target}) + endif() + endmacro() diff --git a/meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch new file mode 100644 index 00000000000..74ddbefabc2 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -0,0 +1,42 @@ +From 11fce59f48e7d15d9b16509146484d60a04f25e9 Mon Sep 17 00:00:00 2001 +From: Jim Broadus +Date: Thu, 26 Mar 2020 16:05:53 -0700 +Subject: [PATCH] clang: Fix resource dir location for cross toolchains + +When clang looks for the resources directory, it does so based on the binary +location and assumes that the containing directory is a sibling to lib. The +Yocto cross.bbclass defines the default bindir as +${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}. ex: /usr/bin/aarch64-poky-linux/. +This causes clang to form a path that looks like /usr/bin/lib/clang/... + +As a fix for this, check the parent directory name. If that is "bin", then +use that directory's parent. + +Upstream-Status: Pending +Signed-off-by: Jim Broadus +Signed-off-by: Khem Raj +--- + clang/lib/Driver/Driver.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp +index ecae475f75da..ca6c8c98961f 100644 +--- a/clang/lib/Driver/Driver.cpp ++++ b/clang/lib/Driver/Driver.cpp +@@ -189,9 +189,15 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, + // With a static-library build of libclang, LibClangPath will contain the + // path of the embedding binary, which for LLVM binaries will be in bin/. + // ../lib gets us to lib/ in both cases. +- P = llvm::sys::path::parent_path(Dir); ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); + // This search path is also created in the COFF driver of lld, so any + // changes here also needs to happen in lld/COFF/Driver.cpp ++ ++ // OE cross toolchains are installed, by default, in a subdir of bin. ++ if (llvm::sys::path::filename(Dir) == "bin") { ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); ++ } ++ P = Dir; + llvm::sys::path::append(P, CLANG_INSTALL_LIBDIR_BASENAME, "clang", + CLANG_VERSION_MAJOR_STRING); + } diff --git a/meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch new file mode 100644 index 00000000000..7b130e99829 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -0,0 +1,79 @@ +From ed293c1fb5888f6ffe091f7276a7897e1a239c01 Mon Sep 17 00:00:00 2001 +From: Oleksandr Ocheretnyi +Date: Wed, 15 Apr 2020 00:08:39 +0300 +Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso + path + + * the dyld-prefix shall be taken into account when the default + path for the dynamic linker has to be checked. + + * this patch shall be used as annex to the next patch: + 'clang: driver: Check sysroot for ldso path' which includes + the usrmerge scenario. + +Upstream-Status: Pending +Signed-off-by: Oleksandr Ocheretnyi +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 720bc136528b..b3a399187ec3 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -512,8 +512,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; + + LibDir = "lib32"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; +@@ -570,8 +570,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -579,8 +579,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -600,8 +600,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::sparcv9: + LibDir = "lib64"; + Loader = "ld-linux.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -618,8 +618,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + + LibDir = X32 ? "libx32" : "lib64"; + Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; diff --git a/meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch b/meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch new file mode 100644 index 00000000000..2631ba76933 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch @@ -0,0 +1,35 @@ +From 42acc8d6b252851b3f3cdae08bd9e1ed5a9c8935 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Oct 2020 22:19:57 -0700 +Subject: [PATCH] clang: Use python3 in python scripts + +Some scripts ask for python, but they work fine with python3 +and in OE python symlink is not exposed to build, only python3 is + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../find-all-symbols/tool/run-find-all-symbols.py | 2 +- + clang/tools/scan-view/bin/scan-view | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +index 471dbf8c110b..f98385dc6651 100755 +--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py ++++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # =- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# + # +diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view +index d01aebb4029a..f3375804654d 100755 +--- a/clang/tools/scan-view/bin/scan-view ++++ b/clang/tools/scan-view/bin/scan-view +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from __future__ import print_function + diff --git a/meta/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/meta/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch new file mode 100644 index 00000000000..5970565d1ab --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -0,0 +1,70 @@ +From 1acea10c68785c42d625618d5cf120e4f19138f2 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Mon, 25 Jan 2021 16:14:35 +0800 +Subject: [PATCH] For x86_64, set Yocto based GCC install search path + +Under Yocto host, while using clang-native to build, it searches +install host gcc failed which causing the include file not found +[snip] +|clang++ -target x86_64-linux -MMD -MF src/base/files/file_path_constants.o.d -I../../../tools/gn/src -I. \ +-isystem/tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/recipe-sysroot-native/usr/include -O2 -pipe \ +-std=c++17 -c ../../../tools/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o +|../../../tools/gn/src/base/files/file_path_constants.cc:7:10: fatal error: 'iterator' file not found +|#include +| ^~~~~~~~ +[snip] + +Set three Yocto based GCC triple: poky, oe-core and wind river + +Before aplly the patch +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 43ff75f2c3feef64f9d73328230d34dac8832a91) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +[snip] + +After aplly the patch: +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 22c3241ff9a6224261df48d0258957fd8acc3d64) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.1.0 +Selected GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 +[snip] + +BTW, it is hardly to insert a triple by the replacement of TARGET_SYS +(=${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}), since TARGET_VENDOR +is different between clang and clang-native + +The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of +additional triples based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_distro_vendor() + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Martin Jansa +Signed-off-by: Hongxu Jia +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 89ffc429d059..e05dd30c3f89 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2498,6 +2498,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", + "x86_64-redhat-linux", "x86_64-suse-linux", + "x86_64-manbo-linux-gnu", "x86_64-slackware-linux", ++ "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES + "x86_64-unknown-linux", "x86_64-amazon-linux"}; + static const char *const X32Triples[] = {"x86_64-linux-gnux32", + "x86_64-pc-linux-gnux32"}; diff --git a/meta/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/meta/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch new file mode 100644 index 00000000000..06b8ffd1705 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -0,0 +1,32 @@ +From a1ae883e90cb9554e10d24277a955fb0660e85a1 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 11 Feb 2021 16:42:49 -0800 +Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names + +This helps in making right detection for OE built gcc toolchains + +The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of +additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_distro_vendor() + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Khem Raj +Signed-off-by: Martin Jansa +--- + llvm/lib/TargetParser/Triple.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp +index 21d6c74b5956..32adf92c47bf 100644 +--- a/llvm/lib/TargetParser/Triple.cpp ++++ b/llvm/lib/TargetParser/Triple.cpp +@@ -639,7 +639,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { + .Case("amd", Triple::AMD) + .Case("mesa", Triple::Mesa) + .Case("suse", Triple::SUSE) +- .Case("oe", Triple::OpenEmbedded) ++ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES + .Default(Triple::UnknownVendor); + } + diff --git a/meta/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/meta/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 00000000000..5b17a7a6367 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From 11ef637da77e0fd115211f42665c2ed533f921a5 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:32:13 -0700 +Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux + +musl e.g. does not provide backtrace APIs + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +index ea8e72be287d..0344074dd254 100644 +--- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp ++++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +@@ -7,7 +7,9 @@ + //===----------------------------------------------------------------------===// + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -21,8 +23,11 @@ + namespace { + size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); +- ++#ifdef __GLIBC__ + return backtrace(reinterpret_cast(TraceBuffer), Size); ++#else ++ return -1; ++#endif + } + + // We don't need any custom handling for the Segv backtrace - the libc unwinder +@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + // to avoid the additional frame. + GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, + void * /*Context*/) { ++#ifdef __GLIBC__ + return Backtrace(TraceBuffer, Size); ++#else ++ return -1; ++#endif + } + + static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, +@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + return; + } + ++#ifdef __GLIBC__ + char **BacktraceSymbols = + backtrace_symbols(reinterpret_cast(Trace), TraceLength); + +@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + Printf("\n"); + if (BacktraceSymbols) + free(BacktraceSymbols); ++#endif + } + } // anonymous namespace + diff --git a/meta/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/meta/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 00000000000..b33a9f4c592 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,28 @@ +From 9a336eeaa8f8d62057802a98e249df695befa6b6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:56:03 -0700 +Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros + +OpenEmbedded does not hardcode mutli-arch like debian therefore ensure +that it still uses the proper tuple + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index b3a399187ec3..f39c771798a8 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -715,6 +715,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + GCCInstallation.getTriple().getArch() == llvm::Triple::x86 + ? "i386-linux-gnu" + : TripleStr; ++ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian ++ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ DebianMultiarch = TripleStr; + + // Try generic GCC detection first. + if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/meta/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch b/meta/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 00000000000..77cbc1cde51 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,56 @@ +From 01500348e14ae9fa8272f00c2a99ac6e153f5f8e Mon Sep 17 00:00:00 2001 +From: Maksim Kita +Date: Sun, 23 May 2021 10:27:29 +0000 +Subject: [PATCH] libunwind: Added unw_backtrace method + +Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libunwind/include/libunwind.h | 1 + + libunwind/src/libunwind.cpp | 20 ++++++++++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +index b2dae8feed9a..0ab974c9bfa4 100644 +--- a/libunwind/include/libunwind.h ++++ b/libunwind/include/libunwind.h +@@ -130,6 +130,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; + extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; + extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; + //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); ++extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; + + extern unw_addr_space_t unw_local_addr_space; + +diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp +index cf39ec5f7dbd..1896f20d57f8 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -431,6 +431,26 @@ int __unw_remove_find_dynamic_unwind_sections( + + #endif // __APPLE__ + ++int unw_backtrace(void **buffer, int size) { ++ unw_context_t context; ++ unw_cursor_t cursor; ++ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { ++ return 0; ++ } ++ ++ unw_word_t ip; ++ int current = 0; ++ while (unw_step(&cursor) > 0) { ++ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { ++ break; ++ } ++ ++ buffer[current++] = reinterpret_cast(static_cast(ip)); ++ } ++ ++ return current; ++} ++ + // Add logging hooks in Debug builds only + #ifndef NDEBUG + #include diff --git a/meta/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch b/meta/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 00000000000..bac9d105c18 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,34 @@ +From 081655795d08178e20bcfbaef5dab4a97230f095 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 11 Aug 2021 18:37:11 -0700 +Subject: [PATCH] clang: Do not use install relative libc++ headers + +In OE we use same clang for native and cross builds, therefore we need +to ensure that native sysroot install of libc++ is not searched for +headers when doing cross compile instead it searches the target sysroot +this is especially troublesome when libcxx-native is staged along with +libcxx e.g. chromium + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index e05dd30c3f89..d9efd09d9da6 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -3316,8 +3316,11 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + // incompatible with the NDK libraries. + SmallString<128> DriverIncludeDir(getDriver().Dir); + llvm::sys::path::append(DriverIncludeDir, "..", "include"); ++ ++ // do not add it when --sysroot is specified, since it would expect ++ // libc++ headers from sysroot and not relative to compiler install location + if (AddIncludePath(DriverIncludeDir, +- /*TargetDirRequired=*/getTriple().isAndroid())) ++ /*TargetDirRequired=*/getTriple().isAndroid() | !computeSysRoot().empty())) + return; + // If this is a development, non-installed, clang, libcxx will + // not be found at ../include/c++ but it likely to be found at diff --git a/meta/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch b/meta/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 00000000000..617113d4c9d --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +From 68007800df2e080d799670378c7ec9d667c7e782 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:08:22 +0000 +Subject: [PATCH] Fix lib paths for OpenEmbedded Host + +Under OpenEmbedded Host, while building with clang-native, it cannot find +the GCCInstallPath, which causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +hosttools/ld: cannot find crtbeginS.o: No such file or directory +[snip] + +Before this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 + +After this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 +Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 + +Summary: +For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. +Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. +For clang-native, the target vendor is '-unknown', need to test current distro +to follow above form. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index d9efd09d9da6..4ec4976a6a0c 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -19,6 +19,7 @@ + #include "Linux.h" + #include "clang/Config/config.h" // for GCC_INSTALL_PREFIX + #include "clang/Driver/Compilation.h" ++#include "clang/Driver/Distro.h" + #include "clang/Driver/Driver.h" + #include "clang/Driver/DriverDiagnostic.h" + #include "clang/Driver/MultilibBuilder.h" +@@ -2908,6 +2909,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + const llvm::Triple &TargetTriple, const ArgList &Args, + const std::string &LibDir, StringRef CandidateTriple, + bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { ++ Distro Distro(D.getVFS(), TargetTriple); + // Locations relative to the system lib directory where GCC's triple-specific + // directories might reside. + struct GCCLibSuffix { +@@ -2925,7 +2927,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || ++ Distro.IsOpenEmbedded()}, + + // This is the normal place. + {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, diff --git a/meta/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch b/meta/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 00000000000..11dc1966ee9 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +From 65e12e7671888531d657e0484aa0397e7e98b134 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:55:48 +0000 +Subject: [PATCH] Correct library search path for OpenEmbedded Host + +For OpenEmbedded Host, the gcc install path is +/usr/lib/x86_64-[distroname]-linux/[gcc-version]. +So the library search path is not found with default triple +'x86_64-linux-gnu' for x86_64. Causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) +[snip] + +before this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +after this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/include/clang/Driver/Distro.h | 2 ++ + clang/lib/Driver/Distro.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 3 files changed, 4 insertions(+) + +diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h +index 1404e1686848..90940e4a0bac 100644 +--- a/clang/include/clang/Driver/Distro.h ++++ b/clang/include/clang/Driver/Distro.h +@@ -45,6 +45,7 @@ public: + RHEL7, + Fedora, + Gentoo, ++ //CLANG_EXTRA_OE_DISTRO_NAME + OpenSUSE, + UbuntuHardy, + UbuntuIntrepid, +@@ -138,6 +139,7 @@ public: + + bool IsGentoo() const { return DistroVal == Gentoo; } + ++ //CLANG_EXTRA_OE_DISTRO_CHECK + /// @} + }; + +diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp +index 6f49e641104c..63b9ff30f0b6 100644 +--- a/clang/lib/Driver/Distro.cpp ++++ b/clang/lib/Driver/Distro.cpp +@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { + .Case("sles", Distro::OpenSUSE) + .Case("opensuse", Distro::OpenSUSE) + .Case("exherbo", Distro::Exherbo) ++ //CLANG_EXTRA_OE_DISTRO_CASE + .Default(Distro::UnknownDistro); + return Version; + } +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index f39c771798a8..9af52769b09a 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -82,6 +82,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return "x86_64-linux-android"; + if (TargetEnvironment == llvm::Triple::GNUX32) + return "x86_64-linux-gnux32"; ++ //CLANG_EXTRA_OE_DISTRO_TRIPLE + return "x86_64-linux-gnu"; + case llvm::Triple::aarch64: + if (IsAndroid) diff --git a/meta/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch b/meta/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 00000000000..275a7c68381 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +From d395cc2696d62d7d3448bc9a90f7697cf60e6273 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 8 Feb 2022 01:31:26 -0800 +Subject: [PATCH] lldb: Link with libatomic on x86 + +cmake atomic check is not sufficient for i686 target where clang14 still +generates __atomic_store calls but the check does not entail this +function and happily thinks that compiler can resolve all atomic via intrinsics +on i686, but thats not the case, ideally the check for determining +atomic operation should be make more robust but until then lets ask to +link with libatomic on i686/linux + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + lldb/source/Utility/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt +index e9954d66cd1a..f36f1c9e9d28 100644 +--- a/lldb/source/Utility/CMakeLists.txt ++++ b/lldb/source/Utility/CMakeLists.txt +@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") + list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) + endif () + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND LLDB_SYSTEM_LIBS atomic) ++endif() ++ + if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) + list(APPEND LLDB_SYSTEM_LIBS atomic) + endif() diff --git a/meta/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch b/meta/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch new file mode 100644 index 00000000000..bbccb8a71cd --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch @@ -0,0 +1,73 @@ +From a92ea48f1959a20ab58b88091127f80a90d5870a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 9 Mar 2022 16:28:16 -0800 +Subject: [PATCH] compiler-rt: Enable __int128 for ppc32 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/CMakeLists.txt | 15 +++++++-------- + compiler-rt/lib/builtins/int_types.h | 2 +- + 2 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt +index e0b2d08c2077..1b245fd5deeb 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -710,11 +710,9 @@ set(mips64el_SOURCES ${GENERIC_TF_SOURCES} + + set(nvptx64_SOURCES ${GENERIC_SOURCES}) + +-set(powerpc_SOURCES ${GENERIC_SOURCES}) +- + set(powerpcspe_SOURCES ${GENERIC_SOURCES}) + +-set(powerpc64_SOURCES ++set(powerpc_SOURCES + ppc/divtc3.c + ppc/fixtfdi.c + ppc/fixunstfdi.c +@@ -729,14 +727,15 @@ set(powerpc64_SOURCES + ) + # These routines require __int128, which isn't supported on AIX. + if (NOT OS_NAME MATCHES "AIX") +- set(powerpc64_SOURCES ++ set(powerpc_SOURCES + ppc/floattitf.c + ppc/fixtfti.c + ppc/fixunstfti.c +- ${powerpc64_SOURCES} ++ ${powerpc_SOURCES} + ) + endif() +-set(powerpc64le_SOURCES ${powerpc64_SOURCES}) ++set(powerpc64le_SOURCES ${powerpc_SOURCES}) ++set(powerpc64_SOURCES ${powerpc_SOURCES}) + + set(riscv_SOURCES + riscv/fp_mode.c +@@ -888,9 +887,9 @@ else () + list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) + endif() + +- # For RISCV32, we must force enable int128 for compiling long ++ # For RISCV32/PPC32, we must force enable int128 for compiling long + # double routines. +- if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32") ++ if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc") + list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) + endif() + +diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h +index 48862f364217..cc47d3e33f67 100644 +--- a/compiler-rt/lib/builtins/int_types.h ++++ b/compiler-rt/lib/builtins/int_types.h +@@ -64,7 +64,7 @@ typedef union { + } udwords; + + #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ +- defined(__SIZEOF_INT128__) || defined(_WIN64) ++ defined(__SIZEOF_INT128__) || defined(_WIN64) || defined(__powerpc__) + #define CRT_HAS_128BIT + #endif + diff --git a/meta/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/meta/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch new file mode 100644 index 00000000000..8c56c1de5aa --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch @@ -0,0 +1,62 @@ +From e06415c9d95a4830b61a21d2a9b159145c0a46f3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 12 Aug 2022 11:50:57 -0700 +Subject: [PATCH] llvm: Do not use cmake infra to detect libzstd + +OE's version is build using plain make not cmake as a result we do not +have the cmake support files and this probing method can get this info +from build host and force linking with libzstd from /usr/lib which is +not what we want when cross building. + +Fixes errors building llvm-config like +/usr/lib/libzstd.so.1.5.2: error adding symbols: file in wrong +format +| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) +| ninja: build stopped: subcommand failed. + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + llvm/lib/Support/CMakeLists.txt | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt +index f653379e3033..6456caff9dff 100644 +--- a/llvm/lib/Support/CMakeLists.txt ++++ b/llvm/lib/Support/CMakeLists.txt +@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS) + endif() + + if(LLVM_ENABLE_ZLIB) +- list(APPEND imported_libs ZLIB::ZLIB) ++ list(APPEND imported_libs z) + endif() + + if(LLVM_ENABLE_ZSTD) +@@ -34,7 +34,7 @@ if(LLVM_ENABLE_ZSTD) + endif() + + if(LLVM_ENABLE_ZSTD) +- list(APPEND imported_libs ${zstd_target}) ++ list(APPEND imported_libs zstd) + endif() + + if( WIN32 ) +@@ -310,7 +310,7 @@ if(LLVM_ENABLE_ZLIB) + get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) + endif() + get_library_name(${zlib_library} zlib_library) +- set(llvm_system_libs ${llvm_system_libs} "${zlib_library}") ++ set(llvm_system_libs ${llvm_system_libs} z) + endif() + + if(LLVM_ENABLE_ZSTD) +@@ -324,7 +324,7 @@ if(LLVM_ENABLE_ZSTD) + endif() + if (zstd_target STREQUAL zstd::libzstd_shared) + get_library_name(${zstd_library} zstd_library) +- set(llvm_system_libs ${llvm_system_libs} "${zstd_library}") ++ set(llvm_system_libs ${llvm_system_libs} zstd) + else() + set(llvm_system_libs ${llvm_system_libs} "${zstd_STATIC_LIBRARY}") + endif() diff --git a/meta/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/meta/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch new file mode 100644 index 00000000000..674cbe52293 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch @@ -0,0 +1,44 @@ +From a1729e842b825919a8efe0389aa2b0f0c16a2924 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 3 Jan 2023 18:44:34 -0800 +Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI + +stat struct size differs on glibc based on ABI choices e.g. 64bit off_t +and/or 64bit time_t will make this size different. Therefore separate +out the O32 case out, makes it more readable. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../sanitizer_platform_limits_posix.h | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +index 34bfef1f7ef4..0ba5451c1ccf 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -98,11 +98,24 @@ const unsigned struct_kernel_stat64_sz = 104; + const unsigned struct_kernel_stat_sz = 144; + const unsigned struct_kernel_stat64_sz = 104; + #elif defined(__mips__) ++#if defined(__mips_o32) // O32 ABI ++#if _TIME_BITS == 64 ++const unsigned struct_kernel_stat_sz = 112; ++const unsigned struct_kernel_stat64_sz = 112; ++#elif _FILE_OFFSET_BITS == 64 ++const unsigned struct_kernel_stat_sz = 160; ++const unsigned struct_kernel_stat64_sz = 160; ++#else ++const unsigned struct_kernel_stat_sz = 144; ++const unsigned struct_kernel_stat64_sz = 160; ++#endif ++#else // __mips_o32 + const unsigned struct_kernel_stat_sz = + SANITIZER_ANDROID + ? FIRST_32_SECOND_64(104, 128) + : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216); + const unsigned struct_kernel_stat64_sz = 104; ++#endif + #elif defined(__s390__) && !defined(__s390x__) + const unsigned struct_kernel_stat_sz = 64; + const unsigned struct_kernel_stat64_sz = 104; diff --git a/meta/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/meta/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch new file mode 100644 index 00000000000..1c5e1adb4cd --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch @@ -0,0 +1,43 @@ +From dbf32edb06caeed5324edfb13bc42bf8fc1406a5 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 21 Feb 2023 12:46:10 -0800 +Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS in + sanitizers + +On 32bit systems using 64bit time_t build fails because +_FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64 + +Fixes +In file included from compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:17: +In file included from compiler-rt/lib/sanitizer_common/sanitizer_platform.h:25: +In file included from /usr/include/features.h:393: +/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" + ^ +1 error generated. + +Upstream-Status: Submitted [https://reviews.llvm.org/D144514] +Signed-off-by: Khem Raj +--- + compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +index 57966403c92a..efa83f30eca0 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +@@ -22,6 +22,15 @@ + // function declarations into a .S file which doesn't compile. + // https://crbug.com/1162741 + #if __has_include() && !defined(__ANDROID__) ++// Some sources undefine _FILE_OFFSET_BITS deliberately e.g. ++// sanitizer_procmaps_solaris.cpp. This is problematic on glibc systems with ++// 32-bit architectures using 64-bit time_t and users passing _TIME_BITS=64 ++// from build environment, therefore both _FILE_OFFSET_BITS and _TIME_BITS ++// need to be undefined together since features.h will check for both being 64 ++// if one is set to 64. ++# if !defined(_FILE_OFFSET_BITS) ++# undef _TIME_BITS ++# endif + # include + #endif + diff --git a/meta/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/meta/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch new file mode 100644 index 00000000000..48e3d7a3513 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch @@ -0,0 +1,81 @@ +From ac240fbfa07115791271abdbfde256ea0f0c64c6 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Thu, 31 Aug 2023 18:14:47 +0200 +Subject: [PATCH] ToolChains/Gnu.cpp: ARMLibDirs search also in lib32 + +* in some strange multilib configs we build lib32-image where + 32bit libs are in /usr/lib32 and 64bit in /usr/lib64 but in such + setup the clang search for GCC candidate installation doesn't + check lib32 directory in sysroot and fails to find the installation + + X86LibDirs was already searching in lib32 for very long time: + https://github.com/llvm/llvm-project/commit/621fed5f5a051a0333415aaed75b8f2ed2350dbd + but ARMLibDirs didn't include it for some reason. + +* if we don't add lib32 for arm in getOSLibDir(), then it will + find -lgcc, crtbeginS.o, crtendS.o, but still fail to find + -lgcc_s, -lc, Scrt1.o, crti.o, crtn.o + +* fixes lib32-compiler-rt build failure: + +-- Configuring incomplete, errors occurred! +CMake Error at TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message): + The C compiler + + "TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang" + + is not able to compile a simple test program. + + It fails with the following output: + + Change Dir: TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ + + Run Build Command(s):ninja -v cmTC_84d18 && [1/2] TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -fPIE -MD -MT CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -c TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ/testCCompiler.c + [2/2] : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : + FAILED: cmTC_84d18 + : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open Scrt1.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crti.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtbeginS.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtendS.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtn.o: No such file or directory + clang-16: error: linker command failed with exit code 1 (use -v to see invocation) + ninja: build stopped: subcommand failed. + +Upstream-Status: Pending +Signed-off-by: Martin Jansa +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 2 +- + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 4ec4976a6a0c..d5cfb99686d1 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2475,7 +2475,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + static const char *const AArch64beLibDirs[] = {"/lib"}; + static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu"}; + +- static const char *const ARMLibDirs[] = {"/lib"}; ++ static const char *const ARMLibDirs[] = {"/lib", "/lib32"}; + static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; + static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", + "armv7hl-redhat-linux-gnueabi", +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 9af52769b09a..33e8ae99ba1d 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -205,6 +205,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) { + // reasoning about oslibdir spellings with the lib dir spellings in the + // GCCInstallationDetector, but that is a more significant refactoring. + if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() || ++ Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb || + Triple.getArch() == llvm::Triple::sparc) + return "lib32"; + diff --git a/meta/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch b/meta/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch new file mode 100644 index 00000000000..019ed3d2d00 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch @@ -0,0 +1,78 @@ +From 05d5bc0e32b8275f91421b24fc86494b9e81815d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 3 Feb 2024 16:47:10 -0800 +Subject: [PATCH] clang/llvm: Add OE specific ABI triple for N32 ABI + +Its gnun32 when using OE + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 4 ++-- + llvm/lib/TargetParser/Triple.cpp | 4 +++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index d5cfb99686d1..926455ac6680 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2538,6 +2538,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + + static const char *const MIPSN32LibDirs[] = {"/lib32"}; + static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32", ++ "mips64-linux-gnun32", + "mipsisa64r6-linux-gnuabin32"}; + static const char *const MIPSN32ELLibDirs[] = {"/lib32"}; + static const char *const MIPSN32ELTriples[] = { +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 33e8ae99ba1d..58badf20d1b3 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -136,7 +136,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu"; + case llvm::Triple::mips64: { + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") + +- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); ++ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); + if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) + return MT; + if (D.getVFS().exists(concat(SysRoot, "/lib/mips64-linux-gnu"))) +@@ -145,7 +145,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + } + case llvm::Triple::mips64el: { + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") + +- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); ++ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); + if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) + return MT; + if (D.getVFS().exists(concat(SysRoot, "/lib/mips64el-linux-gnu"))) +diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp +index 32adf92c47bf..3411e3c968a2 100644 +--- a/llvm/lib/TargetParser/Triple.cpp ++++ b/llvm/lib/TargetParser/Triple.cpp +@@ -319,7 +319,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) { + case GNU: return "gnu"; + case GNUT64: return "gnut64"; + case GNUABI64: return "gnuabi64"; +- case GNUABIN32: return "gnuabin32"; ++ case GNUABIN32: return "gnun32"; + case GNUEABI: return "gnueabi"; + case GNUEABIT64: return "gnueabit64"; + case GNUEABIHF: return "gnueabihf"; +@@ -695,6 +695,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) { + .StartsWith("eabihf", Triple::EABIHF) + .StartsWith("eabi", Triple::EABI) + .StartsWith("gnuabin32", Triple::GNUABIN32) ++ .StartsWith("gnun32", Triple::GNUABIN32) + .StartsWith("gnuabi64", Triple::GNUABI64) + .StartsWith("gnueabihft64", Triple::GNUEABIHFT64) + .StartsWith("gnueabihf", Triple::GNUEABIHF) +@@ -1002,6 +1003,7 @@ Triple::Triple(const Twine &Str) + Environment = + StringSwitch(Components[0]) + .StartsWith("mipsn32", Triple::GNUABIN32) ++ .StartsWith("mips64-n32", Triple::GNUABIN32) + .StartsWith("mips64", Triple::GNUABI64) + .StartsWith("mipsisa64", Triple::GNUABI64) + .StartsWith("mipsisa32", Triple::GNU) diff --git a/meta/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/meta/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch new file mode 100644 index 00000000000..97554cbda1a --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch @@ -0,0 +1,90 @@ +From a1b090d189ebc5ccda088f222a927fb6e225588d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 14 May 2024 22:04:43 -0700 +Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts + +These are added by OE project + +Upstream-Status: Inappropriate [ OE-Specific ] + +Signed-off-by: Khem Raj +--- + libunwind/libunwind.pc.in | 9 ++++++ + llvm/tools/llvm-config/llvm-config | 52 ++++++++++++++++++++++++++++++ + 2 files changed, 61 insertions(+) + create mode 100644 libunwind/libunwind.pc.in + create mode 100644 llvm/tools/llvm-config/llvm-config + +diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in +new file mode 100644 +index 000000000000..a93d676604f9 +--- /dev/null ++++ b/libunwind/libunwind.pc.in +@@ -0,0 +1,9 @@ ++prefix=/usr ++exec_prefix=/usr ++libdir=@LIBDIR@ ++includedir=/usr/include ++ ++Name: libunwind ++Description: libunwind base library ++Version: @VERSION@ ++Libs: -lunwind +diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config +new file mode 100644 +index 000000000000..6a0dd54b8eab +--- /dev/null ++++ b/llvm/tools/llvm-config/llvm-config +@@ -0,0 +1,52 @@ ++#!/bin/bash ++# ++# Wrapper script for llvm-config. Supplies the right environment variables ++# for the target and delegates to the native llvm-config for anything else. This ++# is needed because arguments like --ldflags, --cxxflags, etc. are set by the ++# native compile rather than the target compile. ++# ++SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" ++NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" ++export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" ++if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then ++ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" ++else ++ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" ++fi ++if [[ $# == 0 ]]; then ++ exec "$NEXT_LLVM_CONFIG" ++fi ++ ++remain="" ++output="" ++for arg in "$@"; do ++ case "$arg" in ++ --cppflags) ++ output="${output} ${CPPFLAGS}" ++ ;; ++ --cflags) ++ output="${output} ${CFLAGS}" ++ ;; ++ --cxxflags) ++ output="${output} ${CXXFLAGS}" ++ ;; ++ --ldflags) ++ output="${output} ${LDFLAGS}" ++ ;; ++ --shared-mode) ++ output="${output} shared" ++ ;; ++ --link-shared) ++ break ++ ;; ++ *) ++ remain="${remain} ${arg}" ++ ;; ++ esac ++done ++ ++if [ "${remain}" != "" ]; then ++ output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) ++fi ++ ++echo "${output}" diff --git a/meta/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch b/meta/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch new file mode 100644 index 00000000000..0eebe63721a --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch @@ -0,0 +1,92 @@ +From 47a9749e0dcd1c7dd85922610434ce63d5fe8bd6 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Fri, 13 Sep 2024 13:38:08 +0200 +Subject: [PATCH] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do + +* other libraries are installed in 'lib64' or 'lib32' based on + LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always + installed in 'lib' + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/108549] + +Signed-off-by: Martin Jansa +--- + clang/tools/scan-build-py/CMakeLists.txt | 38 ++++++++++++------------ + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt +index 9273eb5ed977..9033786d2da5 100644 +--- a/clang/tools/scan-build-py/CMakeLists.txt ++++ b/clang/tools/scan-build-py/CMakeLists.txt +@@ -77,52 +77,52 @@ foreach(lib ${LibExecs}) + endforeach() + + foreach(lib ${LibScanbuild}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib} +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/ ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}) + install(FILES lib/libscanbuild/${lib} +- DESTINATION lib/libscanbuild ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMPONENT scan-build-py) + endforeach() + + foreach(resource ${LibScanbuildResources}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource} +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}) + install(FILES lib/libscanbuild/resources/${resource} +- DESTINATION lib/libscanbuild/resources ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + COMPONENT scan-build-py) + endforeach() + + foreach(lib ${LibEar}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libear ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib} +- ${CMAKE_BINARY_DIR}/lib/libear/ ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}) + install(FILES lib/libear/${lib} +- DESTINATION lib/libear ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libear + COMPONENT scan-build-py) + endforeach() + diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb new file mode 100644 index 00000000000..c2b6f272d8f --- /dev/null +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -0,0 +1,463 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +SECTION = "devel" + +require clang.inc +require common-source.inc + +INHIBIT_DEFAULT_DEPS = "1" + +BUILD_CC:class-nativesdk = "clang" +BUILD_CXX:class-nativesdk = "clang++" +BUILD_AR:class-nativesdk = "llvm-ar" +BUILD_RANLIB:class-nativesdk = "llvm-ranlib" +BUILD_NM:class-nativesdk = "llvm-nm" + +BUILDSDK_CPPFLAGS:append:class-nativesdk = "${@oe.utils.vartrue('DEBUG_BUILD', ' -Wno-error=unused-command-line-argument', '', d)}" + +LDFLAGS:remove:class-nativesdk = "-fuse-ld=lld" + +LDFLAGS:append:class-target:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" +LDFLAGS:append:class-target:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed" + +inherit cmake cmake-native pkgconfig python3native python3targetconfig + +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" + +def get_clang_arch(bb, d, arch_var): + import re + a = d.getVar(arch_var) + if re.match('(i.86|athlon|x86.64)$', a): return 'X86' + elif re.match('arm$', a): return 'ARM' + elif re.match('armeb$', a): return 'ARM' + elif re.match('aarch64$', a): return 'AArch64' + elif re.match('aarch64_be$', a): return 'AArch64' + elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' + elif re.match('riscv32$', a): return 'riscv32' + elif re.match('riscv64$', a): return 'riscv64' + elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' + elif re.match('loongarch64$', a): return 'loongarch64' + else: + bb.note("'%s' is not a primary llvm architecture" % a) + return "" + +def get_clang_host_arch(bb, d): + return get_clang_arch(bb, d, 'HOST_ARCH') + +def get_clang_target_arch(bb, d): + return get_clang_arch(bb, d, 'TARGET_ARCH') + +PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs \ + ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \ + " + +PACKAGECONFIG ??= "compiler-rt libcplusplus lldb-wchar terminfo \ + ${PACKAGECONFIG_CLANG_COMMON} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'lto thin-lto', d)} \ + " +PACKAGECONFIG:class-native = "clangd \ + ${PACKAGECONFIG_CLANG_COMMON} \ + " +PACKAGECONFIG:class-nativesdk = "clangd \ + ${PACKAGECONFIG_CLANG_COMMON} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'lto thin-lto', d)} \ + " + +PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," +PACKAGECONFIG[build-id] = "-DENABLE_LINKER_BUILD_ID=ON,-DENABLE_LINKER_BUILD_ID=OFF,," +PACKAGECONFIG[clangd] = "-DCLANG_ENABLE_CLANGD=ON,-DCLANG_ENABLE_CLANGD=OFF,," +PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," +PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," +PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," +PACKAGECONFIG[libedit] = "-DLLVM_ENABLE_LIBEDIT=ON -DLLDB_ENABLE_LIBEDIT=ON,-DLLVM_ENABLE_LIBEDIT=OFF -DLLDB_ENABLE_LIBEDIT=OFF,libedit libedit-native" +PACKAGECONFIG[libomp] = "-DCLANG_DEFAULT_OPENMP_RUNTIME=libomp,," +PACKAGECONFIG[lld] = "-DCLANG_DEFAULT_LINKER=lld,," +PACKAGECONFIG[lldb-lua] = "-DLLDB_ENABLE_LUA=ON,-DLLDB_ENABLE_LUA=OFF,lua" +PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCHAR=0," +PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," +PACKAGECONFIG[pfm] = "-DLLVM_ENABLE_LIBPFM=ON,-DLLVM_ENABLE_LIBPFM=OFF,libpfm," +PACKAGECONFIG[rtti] = "-DLLVM_ENABLE_RTTI=ON,-DLLVM_ENABLE_RTTI=OFF,," +PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,," +PACKAGECONFIG[split-dwarf] = "-DLLVM_USE_SPLIT_DWARF=ON,-DLLVM_USE_SPLIT_DWARF=OFF,," +PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," +PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," +PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,," + +OECMAKE_SOURCEPATH = "${S}/llvm" + +OECMAKE_TARGET_COMPILE = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', 'stage2', 'all', d)}" +OECMAKE_TARGET_INSTALL = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', 'stage2-install', 'install', d)}" +BINPATHPREFIX = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', '/tools/clang/stage2-bins/NATIVE', '', d)}" + +PASSTHROUGH = "\ +CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_CXX_STDLIB;LLVM_BUILD_LLVM_DYLIB;LLVM_LINK_LLVM_DYLIB;\ +LLVM_ENABLE_ASSERTIONS;LLVM_ENABLE_EXPENSIVE_CHECKS;LLVM_ENABLE_PIC;\ +LLVM_BINDINGS_LIST;LLVM_ENABLE_FFI;FFI_INCLUDE_DIR;LLVM_OPTIMIZED_TABLEGEN;\ +LLVM_ENABLE_RTTI;LLVM_ENABLE_EH;LLVM_BUILD_EXTERNAL_COMPILER_RT;CMAKE_SYSTEM_NAME;\ +CMAKE_BUILD_TYPE;BUILD_SHARED_LIBS;LLVM_ENABLE_PROJECTS;LLVM_BINUTILS_INCDIR;\ +LLVM_TARGETS_TO_BUILD;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;PYTHON_EXECUTABLE;\ +PYTHON_LIBRARY;PYTHON_INCLUDE_DIR;LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN;LLDB_EDITLINE_USE_WCHAR;\ +LLVM_ENABLE_LIBEDIT;LLDB_ENABLE_LIBEDIT;LLDB_PYTHON_RELATIVE_PATH;LLDB_PYTHON_EXE_RELATIVE_PATH;\ +LLDB_PYTHON_EXT_SUFFIX;CMAKE_C_FLAGS_RELEASE;CMAKE_CXX_FLAGS_RELEASE;CMAKE_ASM_FLAGS_RELEASE;\ +CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_UNWINDLIB;\ +CLANG_DEFAULT_OPENMP_RUNTIME;LLVM_ENABLE_PER_TARGET_RUNTIME_DIR;\ +LLVM_BUILD_TOOLS;LLVM_USE_HOST_TOOLS;LLVM_CONFIG_PATH;\ +" +# +# Default to build all OE-Core supported target arches (user overridable). +# Gennerally setting LLVM_TARGETS_TO_BUILD = "" in local.conf is ok in most simple situations +# where only one target architecture is needed along with just one build arch (usually X86) +# +LLVM_TARGETS_TO_BUILD ?= "AMDGPU;AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch" + +LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" + +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF[vardepvalue] = "${HF}" + +LLVM_PROJECTS ?= "clang;clang-tools-extra;lld${LLDB}" +LLDB ?= ";lldb" +# LLDB support for RISCV32/Mips32 does not work yet +LLDB:riscv32 = "" +LLDB:mips = "" +LLDB:mipsel = "" +LLDB:powerpc = "" + +# linux hosts (.so) on Windows .pyd +SOLIBSDEV:mingw32 = ".pyd" + +#CMAKE_VERBOSE = "VERBOSE=1" + +EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ + -DLLVM_APPEND_VC_REV=OFF \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ + -DLLVM_ENABLE_PIC=ON \ + -DCLANG_DEFAULT_PIE_ON_LINUX=ON \ + -DLLVM_BINDINGS_LIST='' \ + -DLLVM_ENABLE_FFI=ON \ + -DLLVM_ENABLE_ZSTD=ON \ + -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ + -DLLVM_OPTIMIZED_TABLEGEN=ON \ + -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS_RELEASE='${CXXFLAGS} -DNDEBUG -g0' \ + -DCMAKE_C_FLAGS_RELEASE='${CFLAGS} -DNDEBUG -g0' \ + -DBUILD_SHARED_LIBS=OFF \ + -DLLVM_ENABLE_PROJECTS='${LLVM_PROJECTS}' \ + -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR} \ + -DLLVM_VERSION_SUFFIX='${VER_SUFFIX}' \ + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ + -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ +" + +EXTRA_OECMAKE:append:class-native = "\ + -DPYTHON_EXECUTABLE='${PYTHON}' \ +" +EXTRA_OECMAKE:append:class-nativesdk = "\ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON_PN} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \ + -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \ + -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \ + -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ + -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON_PN} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ + -DPYTHON_EXECUTABLE='${PYTHON}' \ +" +EXTRA_OECMAKE:append:class-target = "\ + -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \ + -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \ + -DLLVM_TARGET_ARCH=${@get_clang_target_arch(bb, d)} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS}${HF} \ + -DLLVM_HOST_TRIPLE=${TARGET_SYS}${HF} \ + -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ + -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ + -DLLVM_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ + -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${bindir} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ +" + +DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} virtual/${TARGET_PREFIX}binutils nativesdk-python3" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 compiler-rt libcxx" + +RRECOMMENDS:${PN} = "binutils" +RRECOMMENDS:${PN}:append:class-target = " libcxx-dev" + +# patch out build host paths for reproducibility +reproducible_build_variables() { + sed -i -e "s,${DEBUG_PREFIX_MAP},,g" \ + -e "s,--sysroot=${RECIPE_SYSROOT},,g" \ + -e "s,${STAGING_DIR_HOST},,g" \ + -e "s,${S}/llvm,,g" \ + -e "s,${B},,g" \ + ${B}/tools/llvm-config/BuildVariables.inc +} + +do_configure:append:class-target() { + reproducible_build_variables +} + +do_configure:append:class-nativesdk() { + reproducible_build_variables +} + +do_install:append() { + rm -rf ${D}${libdir}/python*/site-packages/six.py + for t in clang-pseudo clang-pseudo-gen clang-rename; do + if [ -e ${B}${BINPATHPREFIX}/bin/$t ]; then + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/$t ${D}${bindir}/$t + fi + done +} + +do_install:append:class-target () { + # Allow bin path to change based on YOCTO_ALTERNATE_EXE_PATH + sed -i 's;${_IMPORT_PREFIX}/bin;${_IMPORT_PREFIX_BIN};g' ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake + + # Insert function to populate Import Variables + sed -i "4i\ +if(DEFINED ENV{YOCTO_ALTERNATE_EXE_PATH})\n\ + execute_process(COMMAND \"llvm-config\" \"--bindir\" OUTPUT_VARIABLE _IMPORT_PREFIX_BIN OUTPUT_STRIP_TRAILING_WHITESPACE)\n\ +else()\n\ + set(_IMPORT_PREFIX_BIN \"\${_IMPORT_PREFIX}/bin\")\n\ +endif()\n" ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake + + if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then + mkdir -p ${D}${nonarch_libdir} + mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang + ln -rs ${D}${nonarch_libdir}/clang ${D}${libdir}/clang + rmdir --ignore-fail-on-non-empty ${D}${libdir} + fi + for t in clang clang++ llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov; do + ln -sf $t ${D}${bindir}/${TARGET_PREFIX}$t + done + + # reproducibility + sed -i -e 's,${B},,g' ${D}${libdir}/cmake/llvm/LLVMConfig.cmake +} + +do_install:append:class-native () { + if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer + fi + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/lldb-tblgen ${D}${bindir}/lldb-tblgen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/llvm-min-tblgen ${D}${bindir}/llvm-min-tblgen + for f in `find ${D}${bindir} -executable -type f -not -type l`; do + test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f + echo "stripped $f" + done + ln -sf clang-tblgen ${D}${bindir}/clang-tblgen${PV} + ln -sf llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} + ln -sf llvm-config ${D}${bindir}/llvm-config${PV} +} + +do_install:append:class-nativesdk () { + sed -i -e "s|${B}/./bin/||g" ${D}${libdir}/cmake/llvm/LLVMConfig.cmake + if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer + fi + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen + for f in `find ${D}${bindir} -executable -type f -not -type l`; do + test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f + done + ln -sf clang-tblgen ${D}${bindir}/clang-tblgen${PV} + ln -sf llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} + ln -sf llvm-config ${D}${bindir}/llvm-config${PV} + rm -rf ${D}${datadir}/llvm/cmake + rm -rf ${D}${datadir}/llvm + + #reproducibility + sed -i -e 's,${B},,g' ${D}${libdir}/cmake/llvm/LLVMConfig.cmake +} + +PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ + libclang lldb lldb-server liblldb llvm-linker-tools" + +BBCLASSEXTEND = "native nativesdk" + +RDEPENDS:lldb += "${PN}-lldb-python lldb-server" + +RDEPENDS:${PN}-tools += "\ + perl-module-digest-md5 \ + perl-module-file-basename \ + perl-module-file-copy \ + perl-module-file-find \ + perl-module-file-path \ + perl-module-findbin \ + perl-module-hash-util \ + perl-module-sys-hostname \ + perl-module-term-ansicolor \ +" + +RRECOMMENDS:${PN}-tidy += "${PN}-tools" + +FILES:llvm-linker-tools = "${libdir}/LLVMgold* ${libdir}/libLTO.so.* ${libdir}/LLVMPolly*" + +FILES:${PN}-libclang-cpp = "${libdir}/libclang-cpp.so.*" + +FILES:${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" + +FILES:${PN}-tidy = "${bindir}/*clang-tidy*" +FILES:${PN}-format = "${bindir}/*clang-format*" + +FILES:${PN}-tools = "${bindir}/analyze-build \ + ${bindir}/c-index-test \ + ${bindir}/clang-apply-replacements \ + ${bindir}/clang-change-namespace \ + ${bindir}/clang-check \ + ${bindir}/clang-doc \ + ${bindir}/clang-extdef-mapping \ + ${bindir}/clang-include-fixer \ + ${bindir}/clang-linker-wrapper \ + ${bindir}/clang-move \ + ${bindir}/clang-nvlink-wrapper \ + ${bindir}/clang-offload-bundler \ + ${bindir}/clang-offload-packager \ + ${bindir}/clang-pseudo* \ + ${bindir}/clang-query \ + ${bindir}/clang-refactor \ + ${bindir}/clang-rename* \ + ${bindir}/clang-reorder-fields \ + ${bindir}/clang-repl \ + ${bindir}/clang-scan-deps \ + ${bindir}/diagtool \ + ${bindir}/find-all-symbols \ + ${bindir}/hmaptool \ + ${bindir}/hwasan_symbolize \ + ${bindir}/intercept-build \ + ${bindir}/modularize \ + ${bindir}/pp-trace \ + ${bindir}/sancov \ + ${bindir}/scan-build \ + ${bindir}/scan-build-py \ + ${bindir}/scan-view \ + ${bindir}/split-file \ + ${libdir}/libscanbuild/* \ + ${libdir}/libear/* \ + ${libexecdir}/analyze-c++ \ + ${libexecdir}/analyze-cc \ + ${libexecdir}/c++-analyzer \ + ${libexecdir}/ccc-analyzer \ + ${libexecdir}/intercept-c++ \ + ${libexecdir}/intercept-cc \ + ${datadir}/scan-build/* \ + ${datadir}/scan-view/* \ + ${datadir}/opt-viewer/* \ + ${datadir}/clang/* \ +" + +FILES:${PN} += "\ + ${bindir}/clang-cl \ + ${libdir}/BugpointPasses.so \ + ${libdir}/LLVMHello.so \ + ${libdir}/*Plugin.so \ + ${libdir}/${BPN} \ + ${nonarch_libdir}/${BPN}/*/include/ \ +" + +FILES:lldb = "\ + ${bindir}/lldb \ + ${bindir}/lldb-argdumper \ + ${bindir}/lldb-instr \ + ${bindir}/lldb-vscode \ +" + +FILES:lldb-server = "\ + ${bindir}/lldb-server \ +" + +FILES:liblldb = "\ + ${libdir}/liblldbIntelFeatures.so.* \ + ${libdir}/liblldb.so.* \ +" + +FILES:${PN}-libllvm =+ "\ + ${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \ + ${libdir}/libLLVM-${MAJOR_VER}.so \ + ${libdir}/libRemarks.so.* \ +" + +FILES:libclang = "\ + ${libdir}/libclang.so.* \ +" + +FILES:${PN}-dev += "\ + ${datadir}/llvm/cmake \ + ${libdir}/cmake \ + ${nonarch_libdir}/libear \ + ${nonarch_libdir}/${BPN}/*.la \ +" +FILES:${PN}-doc += "${datadir}/clang-doc" + +FILES:${PN}-staticdev += "${nonarch_libdir}/${BPN}/*.a" + +FILES:${PN}-staticdev:remove = "${libdir}/${BPN}/*.a" +FILES:${PN}-dev:remove = "${libdir}/${BPN}/*.la" +FILES:${PN}:remove = "${libdir}/${BPN}/*" + + +INSANE_SKIP:${PN} += "already-stripped" +#INSANE_SKIP:${PN}-dev += "dev-elf" +INSANE_SKIP:${PN}-lldb-python += "dev-so dev-deps" +INSANE_SKIP:${MLPREFIX}liblldb = "dev-so" +INSANE_SKIP:${PN}-libllvm = "dev-so" + +#Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. +SSTATE_SCAN_FILES:remove = "*-config" + +TOOLCHAIN = "clang" +TOOLCHAIN:class-native = "gcc" +TOOLCHAIN:class-nativesdk = "clang" +COMPILER_RT:class-nativesdk:toolchain-clang:runtime-llvm = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk:toolchain-clang:runtime-llvm = "-stdlib=libstdc++" + +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" + +SYSROOT_PREPROCESS_FUNCS:append:class-target = " clang_sysroot_preprocess" + +clang_sysroot_preprocess() { + install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + install -m 0755 ${S}/llvm/tools/llvm-config/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} + # LLDTargets.cmake references the lld executable(!) that some modules/plugins link to + install -d ${SYSROOT_DESTDIR}${bindir} + + binaries="lld diagtool clang-${MAJOR_VER} clang-format clang-offload-packager + clang-offload-bundler clang-scan-deps clang-repl + clang-refactor clang-check clang-extdef-mapping clang-apply-replacements + clang-reorder-fields clang-tidy clang-change-namespace clang-doc clang-include-fixer + find-all-symbols clang-move clang-query pp-trace modularize" + + if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then + binaries="${binaries} clangd" + fi + + for f in ${binaries} + do + install -m 755 ${D}${bindir}/$f ${SYSROOT_DESTDIR}${bindir}/ + done +} diff --git a/meta/recipes-devtools/clang/common-source.inc b/meta/recipes-devtools/clang/common-source.inc new file mode 100644 index 00000000000..d8a0f68175c --- /dev/null +++ b/meta/recipes-devtools/clang/common-source.inc @@ -0,0 +1,17 @@ +do_fetch() { + : +} +do_fetch[noexec] = "1" +deltask do_unpack +deltask do_patch + +SRC_URI = "" + +do_configure[depends] += "llvm-project-source-${PV}:do_preconfigure" +do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack" +do_create_spdx[depends] += "llvm-project-source-${PV}:do_preconfigure" + +# spdx shared workdir detection fails as not WORKDIR is altered but S and B +# return always true to fix that +def is_work_shared_spdx(d): + return True diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc new file mode 100644 index 00000000000..927aac693bc --- /dev/null +++ b/meta/recipes-devtools/clang/common.inc @@ -0,0 +1,66 @@ +FILESEXTRAPATHS =. "${FILE_DIRNAME}/clang:" + +LIC_FILES_CHKSUM = "file://llvm/LICENSE.TXT;md5=${LLVMMD5SUM} \ + file://clang/LICENSE.TXT;md5=${CLANGMD5SUM} \ +" +LICENSE = "Apache-2.0-with-LLVM-exception" + +# Snapshot +#RELEASE ?= "7ba7d8e2f7b6445b60679da826210cdde29eaf8b" +#BASEURI ?= "https://api.github.com/repos/llvm/llvm-project/tarball/${RELEASE};downloadfilename=llvm-${PV}-${RELEASE}.tar.gz" +#SOURCEDIR ?= "llvm-llvm-project-${@'${RELEASE}'[0:7]}" +#SRC_URI[sha256sum] = "cca3fa1c6efb72bd8bc22b926a2c5551e6b8560d95828452bc62b9140cb87a90" + +# GA Release +RELEASE ?= "${PV}" +BASEURI ?= "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz" +SOURCEDIR ?= "llvm-project-${PV}.src" +SRC_URI[sha256sum] = "324d483ff0b714c8ce7819a1b679dd9e4706cf91c6caf7336dc4ac0c1d3bf636" + +SRC_URI = "\ + ${BASEURI} \ + file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ + file://0002-compiler-rt-support-a-new-embedded-linux-target.patch \ + file://0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ + file://0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ + file://0005-llvm-allow-env-override-of-exe-and-libdir-path.patch \ + file://0006-clang-driver-Check-sysroot-for-ldso-path.patch \ + file://0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ + file://0008-clang-Prepend-trailing-to-sysroot.patch \ + file://0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ + file://0010-clang-Define-releative-gcc-installation-dir.patch \ + file://0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ + file://0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0013-Check-for-atomic-double-intrinsics.patch \ + file://0014-cmake-Fix-configure-for-packages-using-find_package.patch \ + file://0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ + file://0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0017-clang-Use-python3-in-python-scripts.patch \ + file://0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ + file://0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ + file://0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ + file://0022-libunwind-Added-unw_backtrace-method.patch \ + file://0023-clang-Do-not-use-install-relative-libc-headers.patch \ + file://0024-Fix-lib-paths-for-OpenEmbedded-Host.patch \ + file://0025-Correct-library-search-path-for-OpenEmbedded-Host.patch \ + file://0026-lldb-Link-with-libatomic-on-x86.patch \ + file://0027-compiler-rt-Enable-__int128-for-ppc32.patch \ + file://0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ + file://0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \ + file://0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ + file://0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ + file://0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \ + file://0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \ + file://0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \ +" +# Fallback to no-PIE if not set +GCCPIE ??= "" + +S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/${SOURCEDIR}" +B ?= "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" + +# We need to ensure that for the shared work directory, the do_patch signatures match +# The real WORKDIR location isn't a dependency for the shared workdir. +src_patches[vardepsexclude] = "WORKDIR" +should_apply[vardepsexclude] += "PN" diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb new file mode 100644 index 00000000000..db484683af4 --- /dev/null +++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -0,0 +1,123 @@ +# Copyright (C) 2021 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler Runtime" +HOMEPAGE = "http://compiler-rt.llvm.org/" +SECTION = "base" + +require clang.inc +require common-source.inc + +inherit cmake pkgconfig python3native + + +LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" + +TUNE_CCARGS:remove = "-no-integrated-as" + +DEPENDS += "ninja-native virtual/crypt compiler-rt" +DEPENDS:append:class-native = " clang-native libxcrypt-native" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_SYS} nativesdk-libxcrypt" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" +PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DCOMPILER_RT_ENABLE_STATIC_UNWINDER=ON,," +# Context Profiling +PACKAGECONFIG[ctx-profile] ="-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF" + +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF[vardepvalue] = "${HF}" + +CXXFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE" + +OECMAKE_TARGET_COMPILE = "compiler-rt" +OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" +OECMAKE_SOURCEPATH = "${S}/llvm" +EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCOMPILER_RT_STANDALONE_BUILD=OFF \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ + -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ + -DCOMPILER_RT_BUILD_BUILTINS=OFF \ + -DCOMPILER_RT_INCLUDE_TESTS=OFF \ + -DSANITIZER_CXX_ABI_LIBNAME=${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libc++", "libstdc++", d)} \ + -DCOMPILER_RT_BUILD_XRAY=ON \ + -DCOMPILER_RT_BUILD_SANITIZERS=ON \ + -DCOMPILER_RT_BUILD_LIBFUZZER=ON \ + -DCOMPILER_RT_BUILD_PROFILE=ON \ + -DCOMPILER_RT_BUILD_MEMPROF=ON \ + -DLLVM_ENABLE_PROJECTS='compiler-rt' \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ + -DLLVM_APPEND_VC_REV=OFF \ +" + +EXTRA_OECMAKE:append:class-nativesdk = "\ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ + -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ +" + +EXTRA_OECMAKE:append:class-target = "\ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ +" + +EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " +EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " + +do_install:append () { + if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then + mkdir -p ${D}${nonarch_libdir}/clang + mv ${D}${libdir}/clang/${MAJOR_VER} ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} + rmdir --ignore-fail-on-non-empty ${D}${libdir}/clang ${D}${libdir} + else + mv ${D}${libdir}/clang/${MAJOR_VER} ${D}${libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} + fi + # Already shipped with compile-rt Orc support + rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/liborc_rt-*.a + rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/include/orc/ +} + +FILES_SOLIBSDEV = "" +FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} \ + ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/lib*${SOLIBSDEV} \ + ${nonarch_libdir}/clang/${MAJOR_VER}/*.txt \ + ${nonarch_libdir}/clang/${MAJOR_VER}/share/*.txt" +FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" +FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/*.syms \ + ${nonarch_libdir}/clang/${MAJOR_VER}/include \ + ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/clang_rt.crt*.o \ + ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/libclang_rt.asan-preinit*.a" +INSANE_SKIP:${PN} = "dev-so libdir" +INSANE_SKIP:${PN}-dbg = "libdir" + +#PROVIDES:append:class-target = "\ +# virtual/${TARGET_PREFIX}compilerlibs \ +# libgcc \ +# libgcc-initial \ +# libgcc-dev \ +# libgcc-initial-dev \ +# " +# + +RDEPENDS:${PN}-dev += "${PN}-staticdev" + +BBCLASSEXTEND = "native nativesdk" + +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-dev = "1" + +TOOLCHAIN:forcevariable = "clang" +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" + +# riscv and x86_64 Sanitizers work on musl too +COMPATIBLE_HOST:libc-musl:x86-64 = "(.*)" +COMPATIBLE_HOST:libc-musl:riscv64 = "(.*)" +COMPATIBLE_HOST:libc-musl:riscv32 = "(.*)" +COMPATIBLE_HOST:libc-musl = "null" diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb new file mode 100644 index 00000000000..a6f6db3cc73 --- /dev/null +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -0,0 +1,126 @@ +# Copyright (C) 2015 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler Runtime" +HOMEPAGE = "http://compiler-rt.llvm.org/" +SECTION = "base" + +require clang.inc +require common-source.inc + +inherit cmake cmake-native pkgconfig python3native + + +LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" + +LIBCPLUSPLUS = "" +COMPILER_RT = "" + +TUNE_CCARGS:remove = "-no-integrated-as" + +INHIBIT_DEFAULT_DEPS = "1" + +DEPENDS += "ninja-native libgcc" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime" +DEPENDS:append:class-native = " clang-native" + +# Trick clang.bbclass into not creating circular dependencies +UNWINDLIB:class-nativesdk:toolchain-clang = "--unwindlib=libgcc" +COMPILER_RT:class-nativesdk:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk:toolchain-clang = "-stdlib=libstdc++" +UNWINDLIB:class-native:toolchain-clang = "--unwindlib=libgcc" +COMPILER_RT:class-native:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-native:toolchain-clang = "-stdlib=libstdc++" +UNWINDLIB:class-target:toolchain-clang = "--unwindlib=libgcc" +COMPILER_RT:class-target:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-target:toolchain-clang = "-stdlib=libstdc++" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" +PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" +# Context Profiling, might need to enable 'profile' too +PACKAGECONFIG[ctx-profile] ="-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF" + +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF[vardepvalue] = "${HF}" + +OECMAKE_TARGET_COMPILE = "compiler-rt" +OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" +OECMAKE_SOURCEPATH = "${S}/llvm" +EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCOMPILER_RT_STANDALONE_BUILD=OFF \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ + -DCOMPILER_RT_INCLUDE_TESTS=OFF \ + -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ + -DCOMPILER_RT_BUILD_XRAY=OFF \ + -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ + -DCOMPILER_RT_BUILD_MEMPROF=OFF \ + -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ + -DLLVM_ENABLE_PROJECTS='compiler-rt' \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ + -DLLVM_APPEND_VC_REV=OFF \ +" +EXTRA_OECMAKE:append:class-target = "\ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ +" + +EXTRA_OECMAKE:append:class-nativesdk = "\ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ + -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ +" +EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " + +do_install:append () { + if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then + mkdir -p ${D}${nonarch_libdir}/clang + mv ${D}${libdir}/clang/${MAJOR_VER} ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} + rmdir --ignore-fail-on-non-empty ${D}${libdir}/clang ${D}${libdir} + else + mv ${D}${libdir}/clang/${MAJOR_VER} ${D}${libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} + fi +} + +FILES_SOLIBSDEV = "" + +FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" +FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" +FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.asan-preinit*.a" + +INSANE_SKIP:${PN} = "dev-so libdir" +INSANE_SKIP:${PN}-dbg = "libdir" + +#PROVIDES:append:class-target = "\ +# virtual/${TARGET_PREFIX}compilerlibs \ +# libgcc \ +# libgcc-initial \ +# libgcc-dev \ +# libgcc-initial-dev \ +# " +# + +RDEPENDS:${PN}-dev += "${PN}-staticdev" + +BBCLASSEXTEND = "native nativesdk" + +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-dev = "1" + +TOOLCHAIN = "clang" +# Overrides defaults from clang.bbclass +TOOLCHAIN:class-nativesdk = "clang" +TOOLCHAIN:class-native = "clang" +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" diff --git a/meta/recipes-devtools/clang/libclc_git.bb b/meta/recipes-devtools/clang/libclc_git.bb new file mode 100644 index 00000000000..16ab8332138 --- /dev/null +++ b/meta/recipes-devtools/clang/libclc_git.bb @@ -0,0 +1,36 @@ +DESCRIPTION = "LLVM based OpenCL runtime support library" +HOMEPAGE = "http://libclc.llvm.org/" +SECTION = "libs" + +require clang.inc +require common-source.inc + +TOOLCHAIN = "clang" + +LIC_FILES_CHKSUM = "file://libclc/LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db" + +inherit cmake cmake-qemu pkgconfig python3native + +DEPENDS += "clang spirv-tools spirv-llvm-translator spirv-llvm-translator-native ncurses" + +OECMAKE_SOURCEPATH = "${S}/libclc" + +EXTRA_OECMAKE += "\ + -DLLVM_APPEND_VC_REV=OFF \ + -DLIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR=${STAGING_BINDIR_NATIVE} \ + -DLLVM_CLANG=${STAGING_BINDIR_NATIVE}/clang \ + -DLLVM_AS=${STAGING_BINDIR_NATIVE}/llvm-as \ + -DLLVM_LINK=${STAGING_BINDIR_NATIVE}/llvm-link \ + -DLLVM_OPT=${STAGING_BINDIR_NATIVE}/opt \ + -DLLVM_SPIRV=${STAGING_BINDIR_NATIVE}/llvm-spirv \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -Dclc_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeCLCCompiler.cmake.in \ + -Dll_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeLLAsmCompiler.cmake.in \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON" + +FILES:${PN} += "${datadir}/clc" + +BBCLASSEXTEND = "native nativesdk" + +export YOCTO_ALTERNATE_EXE_PATH +export YOCTO_ALTERNATE_LIBDIR diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb new file mode 100644 index 00000000000..a2a67880a8b --- /dev/null +++ b/meta/recipes-devtools/clang/libcxx_git.bb @@ -0,0 +1,115 @@ +# Copyright (C) 2015 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "libc++ is a new implementation of the C++ standard library, targeting C++11" +HOMEPAGE = "http://libcxx.llvm.org/" +SECTION = "base" + +require clang.inc +require common-source.inc + +inherit cmake cmake-native python3native + +PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind unwind-shared", "", d)}" +PACKAGECONFIG:append:armv5 = " no-atomics" +PACKAGECONFIG:remove:class-native = "compiler-rt" +PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," +PACKAGECONFIG[exceptions] = "-DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DLIBCXX_ENABLE_EXCEPTIONS=ON,-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF -DLIBCXX_ENABLE_EXCEPTIONS=OFF -DCMAKE_REQUIRED_FLAGS='-fno-exceptions'," +PACKAGECONFIG[no-atomics] = "-D_LIBCXXABI_HAS_ATOMIC_BUILTINS=OFF -DCMAKE_SHARED_LINKER_FLAGS='-latomic',," +PACKAGECONFIG[compiler-rt] = "-DLIBCXX_USE_COMPILER_RT=ON -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBUNWIND_USE_COMPILER_RT=ON,,compiler-rt" +PACKAGECONFIG[unwind-shared] = "-DLIBUNWIND_ENABLE_SHARED=ON,-DLIBUNWIND_ENABLE_SHARED=OFF,," + +DEPENDS += "ninja-native" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt" +DEPENDS:append:class-native = " clang-native compiler-rt-native" + +COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}" +UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}" +LIBCPLUSPLUS ?= "-stdlib=libstdc++" +# Trick clang.bbclass into not creating circular dependencies +UNWINDLIB:class-nativesdk = "-unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" +UNWINDLIB:class-native = "-unwindlib=libgcc" +LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" + +LDFLAGS:append = " ${UNWINDLIB}" + +INHIBIT_DEFAULT_DEPS = "1" + +LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da3953 \ + file://libcxxabi/LICENSE.TXT;md5=7b9334635b542c56868400a46b272b1e \ + file://libunwind/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ +" + +OECMAKE_TARGET_COMPILE = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind", "", d)} cxxabi cxx" +OECMAKE_TARGET_INSTALL = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "install-unwind", "", d)} install-cxxabi install-cxx" + +OECMAKE_SOURCEPATH = "${S}/llvm" +EXTRA_OECMAKE += "\ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCMAKE_CROSSCOMPILING=ON \ + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ + -DLIBCXXABI_INCLUDE_TESTS=OFF \ + -DLIBCXXABI_ENABLE_SHARED=ON \ + -DLIBCXXABI_LIBCXX_INCLUDES=${S}/libcxx/include \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/libcxxabi/include \ + -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib${LLVM_LIBDIR_SUFFIX} \ + -S ${S}/runtimes \ + -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \ + -DLLVM_RUNTIME_TARGETS=${HOST_SYS} \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ + -DLLVM_APPEND_VC_REV=OFF \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ +" + +EXTRA_OECMAKE:append:class-target = " \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${HOST_SYS} \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ +" + +EXTRA_OECMAKE:append:class-nativesdk = " \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${HOST_SYS} \ +" + +EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " + +CXXFLAGS:append:armv5 = " -mfpu=vfp2" + +ALLOW_EMPTY:${PN} = "1" + +PROVIDES:append:runtime-llvm = " libunwind" + +do_install:append() { + if ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "true", "false", d)} + then + for f in libunwind.h __libunwind_config.h unwind.h unwind_itanium.h unwind_arm_ehabi.h + do + install -Dm 0644 ${S}/libunwind/include/$f ${D}${includedir}/$f + done + install -d ${D}${libdir}/pkgconfig + sed -e 's,@LIBDIR@,${libdir},g;s,@VERSION@,${PV},g' ${S}/libunwind/libunwind.pc.in > ${D}${libdir}/pkgconfig/libunwind.pc + fi +} + +PACKAGES:append:runtime-llvm = " libunwind" +FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*" +# Package library module manifest path +FILES:${PN}-dev += "${datadir}/libc++/v1/ ${libdir}/libc++.modules.json" + +BBCLASSEXTEND = "native nativesdk" +TOOLCHAIN = "clang" +# Overrides defaults from clang.bbclass +TOOLCHAIN:class-nativesdk = "clang" +TOOLCHAIN:class-native = "clang" diff --git a/meta/recipes-devtools/clang/llvm-project-source.bb b/meta/recipes-devtools/clang/llvm-project-source.bb new file mode 100644 index 00000000000..c1cd8877ab8 --- /dev/null +++ b/meta/recipes-devtools/clang/llvm-project-source.bb @@ -0,0 +1,12 @@ +# Copyright (C) 2018 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "This is the canonical git mirror of the LLVM subversion repository." +HOMEPAGE = "https://github.com/llvm/llvm-project" + +require llvm-project-source.inc +require clang.inc + +BPN = "llvm-project-source" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta/recipes-devtools/clang/llvm-project-source.inc b/meta/recipes-devtools/clang/llvm-project-source.inc new file mode 100644 index 00000000000..50e9154e87a --- /dev/null +++ b/meta/recipes-devtools/clang/llvm-project-source.inc @@ -0,0 +1,99 @@ +deltask do_configure +deltask do_compile +deltask do_install +deltask do_populate_sysroot +deltask do_populate_lic +RM_WORK_EXCLUDE += "${PN}" + +inherit nopackages + +PN = "llvm-project-source-${PV}" +WORKDIR = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}" +SSTATE_SWSPEC = "sstate:llvm-project-source::${PV}:${PR}::${SSTATE_VERSION}:" + +STAMP = "${STAMPS_DIR}/work-shared/llvm-project-source-${PV}-${PR}" +STAMPCLEAN = "${STAMPS_DIR}/work-shared/llvm-project-source-${PV}-*" + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "" +PACKAGES = "" +TARGET_ARCH = "allarch" +TARGET_AS_ARCH = "none" +TARGET_CC_ARCH = "none" +TARGET_LD_ARCH = "none" +TARGET_OS = "linux" +baselib = "lib" +PACKAGE_ARCH = "all" + +B = "${WORKDIR}/build" + +# space separated list of additional distro vendor values we want to support e.g. +# "yoe webos" or "-yoe -webos" '-' is optional +CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}" +# Extra OE DISTRO that want to support as build host. space separated list of additional distro. +# ":" separated the ID in "/etc/os-release" and the triple for finding gcc on this OE DISTRO. +# eg: "poky:poky wrlinux:wrs" +CLANG_EXTRA_OE_DISTRO ?= "poky:poky" +# Match with MULTILIB_GLOBAL_VARIANTS +MULTILIB_VARIANTS = "lib32 lib64 libx32" + +python do_preconfigure() { + import subprocess + case = "" + triple = "" + vendors = d.getVar('CLANG_EXTRA_OE_VENDORS') + multilib_variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + vendors_to_add = [] + for vendor in vendors.split(): + # convert -yoe into yoe + vendor = vendor.lstrip('-') + # generate possible multilib vendor names for yoe + # such as yoemllib32 + vendors_to_add.extend([vendor + 'ml' + variant for variant in multilib_variants]) + # skip oe since already part of the cpp file + if vendor != "oe": + vendors_to_add.append(vendor) + + for vendor_to_add in vendors_to_add: + case += '\\n .Case("' + vendor_to_add + '", Triple::OpenEmbedded)' + triple += ' "x86_64-' + vendor_to_add + '-linux",' + + bb.note("Adding support following TARGET_VENDOR values") + bb.note(str(vendors_to_add)) + bb.note("in llvm/lib/TargetParser/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp") + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/TargetParser/Triple.cpp" % (case)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + + + case = "" + triple = "" + name = "" + check = "" + oe_names = "" + distros = d.getVar('CLANG_EXTRA_OE_DISTRO') + for distro in distros.split(): + distro_id = distro.split(":")[0].replace('-','_') + distro_triple = distro.split(":")[1] + case += '\\n .Case("' + distro_id + '", Distro::' + distro_id.upper() + ')' + triple += '\\n if (Distro.Is' + distro_id.upper() + '())\\n return "x86_64-' + distro_triple + '-linux",' + name += '\\n '+ distro_id.upper() + ',' + check += '\\nbool Is' + distro_id.upper() + '() const { return DistroVal == ' + distro_id.upper() + '; }' + oe_names += distro_id.upper() + ' ||' + + check += '\\nbool IsOpenEmbedded() const { return DistroVal == ' + oe_names[0:-3] + '; }' + + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_NAME#%s#g' ${S}/clang/include/clang/Driver/Distro.h" % (name)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_CHECK#%s#g' ${S}/clang/include/clang/Driver/Distro.h" % (check)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Linux.cpp" % (triple)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_CASES#%s#g' -i ${S}/clang/lib/Driver/Distro.cpp" % (case)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) +} + +do_patch[vardepsexclude] = "MULTILIBS" +addtask do_preconfigure after do_patch +do_create_spdx[depends] += "${PN}:do_preconfigure" diff --git a/meta/recipes-devtools/clang/nativesdk-clang-glue.bb b/meta/recipes-devtools/clang/nativesdk-clang-glue.bb new file mode 100644 index 00000000000..a0b93740845 --- /dev/null +++ b/meta/recipes-devtools/clang/nativesdk-clang-glue.bb @@ -0,0 +1,36 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +LICENSE = "Apache-2.0-with-LLVM-exception" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +inherit_defer nativesdk +DEPENDS += "nativesdk-clang" + +do_install() { + install -d ${D}${prefix_nativesdk} + cd ${D}${prefix_nativesdk} + ln -s ..${libdir} . + ln -s ..${includedir} . + cd .. + ln -s .${base_libdir} . +} + +sysroot_stage_all () { + sysroot_stage_dir ${D} ${SYSROOT_DESTDIR} +} + +FILES:${PN} += "${prefix_nativesdk} ${base_libdir_nativesdk}" +FILES:${PN}-dbg = "" + +deltask do_configure +deltask do_compile +deltask do_patch +deltask do_fetch +deltask do_unpack +deltask do_create_spdx +deltask do_create_package_spdx +deltask do_create_runtime_spdx diff --git a/meta/recipes-devtools/clang/openmp_git.bb b/meta/recipes-devtools/clang/openmp_git.bb new file mode 100644 index 00000000000..34f6e4ab9e5 --- /dev/null +++ b/meta/recipes-devtools/clang/openmp_git.bb @@ -0,0 +1,65 @@ +# Copyright (C) 2017 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler Runtime" +HOMEPAGE = "https://openmp.llvm.org/" +SECTION = "libs" + +require clang.inc +require common-source.inc + +TOOLCHAIN = "clang" + +LIC_FILES_CHKSUM = "file://openmp/LICENSE.TXT;md5=d75288d1ce0450b28b8d58a284c09c79" + +inherit cmake pkgconfig perlnative python3native python3targetconfig + +DEPENDS += "elfutils libffi clang" + +EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_APPEND_VC_REV=OFF \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DOPENMP_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ + -DOPENMP_STANDALONE_BUILD=ON \ + -DCLANG_TOOL=${STAGING_BINDIR_NATIVE}/clang \ + -DLINK_TOOL=${STAGING_BINDIR_NATIVE}/llvm-link \ + -DOPT_TOOL=${STAGING_BINDIR_NATIVE}/opt \ + -DOPENMP_LLVM_LIT_EXECUTABLE=${STAGING_BINDIR_NATIVE}/llvm-lit \ + -DEXTRACT_TOOL=${STAGING_BINDIR_NATIVE}/llvm-extract \ + -DPACKAGER_TOOL=${STAGING_BINDIR_NATIVE}/clang-offload-packager \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + " + +OECMAKE_SOURCEPATH = "${S}/openmp" + +PACKAGECONFIG ?= "ompt-tools offloading-plugin" + +PACKAGECONFIG:remove:arm = "ompt-tools offloading-plugin" +PACKAGECONFIG:remove:powerpc = "ompt-tools offloading-plugin" + +PACKAGECONFIG:append:mipsarcho32 = " no-atomics" + +PACKAGECONFIG[ompt-tools] = "-DOPENMP_ENABLE_OMPT_TOOLS=ON,-DOPENMP_ENABLE_OMPT_TOOLS=OFF," +PACKAGECONFIG[aliases] = "-DLIBOMP_INSTALL_ALIASES=ON,-DLIBOMP_INSTALL_ALIASES=OFF," +PACKAGECONFIG[offloading-plugin] = ",,elfutils libffi,libelf libffi" +PACKAGECONFIG[no-atomics] = "-DLIBOMP_HAVE_BUILTIN_ATOMIC=OFF -DLIBOMP_LIBFLAGS='-latomic',," + +PACKAGES += "${PN}-libomptarget ${PN}-gdb-plugin" +FILES_SOLIBSDEV = "" +FILES:${PN} += "${libdir}/lib*${SOLIBSDEV}" +FILES:${PN}-libomptarget = "${libdir}/libomptarget-*.bc" +FILES:${PN}-gdb-plugin = "${datadir}/gdb/python/ompd" + +RDEPENDS:${PN}-gdb-plugin += "python3-core" + +INSANE_SKIP:${PN} = "dev-so" +# Currently the static libraries contain buildpaths +INSANE_SKIP:${PN}-staticdev += "buildpaths" + +COMPATIBLE_HOST:mips64 = "null" +COMPATIBLE_HOST:riscv32 = "null" +COMPATIBLE_HOST:powerpc = "null" + +BBCLASSEXTEND = "native nativesdk" + +CVE_STATUS[CVE-2022-26345] = "cpe-incorrect: specific to the Intel distribution before 2022.1" From patchwork Tue Nov 5 18:45:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26A70D33A32 for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mx.groups.io with SMTP id smtpd.web11.27955.1730832351662841600 for ; Tue, 05 Nov 2024 10:45:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bNen9d9g; spf=pass (domain: gmail.com, ip: 209.85.214.177, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20ca388d242so58779425ad.2 for ; Tue, 05 Nov 2024 10:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832351; x=1731437151; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0M6PSOiWB/4P5Ib+O7NMZroGplhInshT4hwzyrHqtYc=; b=bNen9d9ggex8+FqwNFLDCF6Hkmh/fT3k+92vrEwiDUxZY1E+4I5VACQtNup221MMop oJzANnSbg5fPDOOOn7iU+jFkeqa+XdRRCar4/CilGeDO+0H2tHiKqBqGwlYWisSXTi61 PPVUw+x2cj3sMBFXYAAnJEqggfR+mmVUO1u+tHz2D0ONoRItEIKpdZO+icXLX58JYqYc KlR//Jk+7Z8VLcTeqrycWTuRSiWPL9cW7uXPvbf2mK6HmFyQcX2+k2Yv8jR6TPzQtOw6 bZ59WzidSHMvPxMO5gQlkB7yJv7LMFQZAIPQkSzi6TFBWX/BN+LToUkyNIvnPAj3OKDf Zedg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832351; x=1731437151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0M6PSOiWB/4P5Ib+O7NMZroGplhInshT4hwzyrHqtYc=; b=f6IyBE6TwGaW40aNcR5aX9wgxbcmmHSPxq6OH53cbVBzDgBHI3FSO2xAdr3/MMwyYo 6Y4uJV4YzSw9Oap1E27P1uw6kbaXwH4UTMveesCnhdk/TtK7ZAmOEXQvmK9wSCPKCMdd DjreCKkhAWkLADN5ytNub6vEcXXueGxOkwKLhOT3wHTGYzNKpmaW6p+eVKxUOe2ppAEg aoDjNaESErFtr1rBIEXZ111M+RcIbULycKNAS86rwCnmfg/MPauKBfwmPZtF1V4Lm9yI NAr3Y35mW1wpJO++Z9AZJ17cx2+iP8AJjRKy/nbmvrMajXIR6AXuR1bHg0oZvgrEAwJq xc6A== X-Gm-Message-State: AOJu0YynhUZ+/RkoE2RtF5XyzqEs7jcfVzc7aqIIkA5z2NH1Qqys70+R Tc37fL+RbFVWBdkZbFtRE6lONQ1JO3XiaF8QSolvfp6qufdGG+8rfOyQxw== X-Google-Smtp-Source: AGHT+IGHKDHmF7VKRfUydMo3Ggglwi5nFcAR+eZwOccoDEpvn2kmWeij+q0/tiTOL0tjZ2UOQRFwBg== X-Received: by 2002:a17:902:db0b:b0:20b:a41f:6e48 with SMTP id d9443c01a7336-2111af69655mr240731595ad.27.1730832350689; Tue, 05 Nov 2024 10:45:50 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:50 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 08/19] clang/recipes: Add missing SUMMARY field Date: Tue, 5 Nov 2024 10:45:27 -0800 Message-ID: <20241105184540.3450302-8-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206735 Enhance description while here Signed-off-by: Khem Raj --- .../clang/clang-cross-canadian_git.bb | 2 +- meta/recipes-devtools/clang/clang-cross_git.bb | 2 +- meta/recipes-devtools/clang/clang-crosssdk_git.bb | 2 +- meta/recipes-devtools/clang/clang_git.bb | 11 ++++++++++- .../clang/compiler-rt-sanitizers_git.bb | 4 +++- meta/recipes-devtools/clang/compiler-rt_git.bb | 6 +++++- meta/recipes-devtools/clang/libclc_git.bb | 2 +- meta/recipes-devtools/clang/libcxx_git.bb | 2 +- meta/recipes-devtools/clang/nativesdk-clang-glue.bb | 2 +- meta/recipes-devtools/clang/openmp_git.bb | 2 +- 10 files changed, 25 insertions(+), 10 deletions(-) diff --git a/meta/recipes-devtools/clang/clang-cross-canadian_git.bb b/meta/recipes-devtools/clang/clang-cross-canadian_git.bb index 33c33c4d443..f327a1275e7 100644 --- a/meta/recipes-devtools/clang/clang-cross-canadian_git.bb +++ b/meta/recipes-devtools/clang/clang-cross-canadian_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)" +SUMMARY = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)" HOMEPAGE = "http://clang.llvm.org/" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" SECTION = "devel" diff --git a/meta/recipes-devtools/clang/clang-cross_git.bb b/meta/recipes-devtools/clang/clang-cross_git.bb index 8aee5cd8628..a0c215e4dfb 100644 --- a/meta/recipes-devtools/clang/clang-cross_git.bb +++ b/meta/recipes-devtools/clang/clang-cross_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "Cross compiler wrappers for LLVM based C/C++ compiler" +SUMMARY = "Cross compiler wrappers for LLVM based C/C++ compiler" HOMEPAGE = "http://clang.llvm.org/" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" SECTION = "devel" diff --git a/meta/recipes-devtools/clang/clang-crosssdk_git.bb b/meta/recipes-devtools/clang/clang-crosssdk_git.bb index e4b521d0d23..913c49ac740 100644 --- a/meta/recipes-devtools/clang/clang-crosssdk_git.bb +++ b/meta/recipes-devtools/clang/clang-crosssdk_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +SUMMARY = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" HOMEPAGE = "http://clang.llvm.org/" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" SECTION = "devel" diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index c2b6f272d8f..1ad40f2fcff 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -1,7 +1,16 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler" +SUMMARY = "LLVM based C/C++ compiler" +DESCRIPTION = "Clang is an LLVM based C/C++/Objective-C compiler, \ + which aims to deliver amazingly fast compiles, \ + extremely useful error and warning messages and \ + to provide a platform for building great source \ + level tools. The Clang Static Analyzer and \ + clang-tidy are tools that automatically find bugs \ + in your code, and are great examples of the sort \ + of tools that can be built using the Clang frontend \ + as a library to parse C/C++ code" HOMEPAGE = "http://clang.llvm.org/" SECTION = "devel" diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index db484683af4..acd5516a8d1 100644 --- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -1,7 +1,9 @@ # Copyright (C) 2021 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler Runtime" +SUMMARY = "LLVM based C/C++ compiler Sanitizers Runtime" +DESCRIPTION = "Runtime libraries that are required \ + to run the code with sanitizer instrumentation" HOMEPAGE = "http://compiler-rt.llvm.org/" SECTION = "base" diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb index a6f6db3cc73..080e53b93d5 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -1,7 +1,11 @@ # Copyright (C) 2015 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler Runtime" +SUMMARY = "LLVM based C/C++ compiler Runtime" +DESCRIPTIOM = "Simple builtin library that provides an \ + implementation of the low-level target-specific \ + hooks required by code generation and other runtime \ + components" HOMEPAGE = "http://compiler-rt.llvm.org/" SECTION = "base" diff --git a/meta/recipes-devtools/clang/libclc_git.bb b/meta/recipes-devtools/clang/libclc_git.bb index 16ab8332138..0d43133281f 100644 --- a/meta/recipes-devtools/clang/libclc_git.bb +++ b/meta/recipes-devtools/clang/libclc_git.bb @@ -1,4 +1,4 @@ -DESCRIPTION = "LLVM based OpenCL runtime support library" +SUMMARY = "Implementation of the library requirements of the OpenCL 1.1+ C programming language" HOMEPAGE = "http://libclc.llvm.org/" SECTION = "libs" diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb index a2a67880a8b..c7f3a77ca94 100644 --- a/meta/recipes-devtools/clang/libcxx_git.bb +++ b/meta/recipes-devtools/clang/libcxx_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2015 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "libc++ is a new implementation of the C++ standard library, targeting C++11" +SUMMARY = "libc++ is a new implementation of the C++ standard library, targeting C++11 and above" HOMEPAGE = "http://libcxx.llvm.org/" SECTION = "base" diff --git a/meta/recipes-devtools/clang/nativesdk-clang-glue.bb b/meta/recipes-devtools/clang/nativesdk-clang-glue.bb index a0b93740845..8e5622f6c18 100644 --- a/meta/recipes-devtools/clang/nativesdk-clang-glue.bb +++ b/meta/recipes-devtools/clang/nativesdk-clang-glue.bb @@ -1,7 +1,7 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +SUMMARY = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" HOMEPAGE = "http://clang.llvm.org/" LICENSE = "Apache-2.0-with-LLVM-exception" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" diff --git a/meta/recipes-devtools/clang/openmp_git.bb b/meta/recipes-devtools/clang/openmp_git.bb index 34f6e4ab9e5..549df0e7684 100644 --- a/meta/recipes-devtools/clang/openmp_git.bb +++ b/meta/recipes-devtools/clang/openmp_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2017 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler Runtime" +SUMMARY = "LLVM OpenMP compiler Runtime" HOMEPAGE = "https://openmp.llvm.org/" SECTION = "libs" From patchwork Tue Nov 5 18:45:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 183BCD33A2B for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.web10.28083.1730832352589393637 for ; Tue, 05 Nov 2024 10:45:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Fh1nBVbh; spf=pass (domain: gmail.com, ip: 209.85.216.49, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2e2bb1efe78so77153a91.1 for ; Tue, 05 Nov 2024 10:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832352; x=1731437152; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WPZMUAzq5xtA38zHOIyK2dT/ynl0SX29dwxZaQ7useE=; b=Fh1nBVbhaXL0kxhP/UEDK7e/dcT2ujAF5nZ9BZIw8CCVksFrCHnPPcoIXGajG+4/MU zXAWuWsW/THbewtpVXZvozfkxnYqr1hsyPOJBZNwbcOt+cM0+HmJCN0PepL/qvlYClDZ s25PqfVifolLctjw/S6ArGSUYPciY1SrSz1s+yx0HRXf6RbEvlmvVZuZRn/PLhqTBa0V bG6azp5CmB5ucH5+DLZiIqVV1i0DkWc+3pRUroClKtAl0uwV/4Bk6d42QTPcHtYSInB+ 9Zslqt3AZ2hZmTull4Wa77UAv3PQIC+EmwLCGUn1rtsRQvf37PtM2bBs7uE6y02c3YNo lOPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832352; x=1731437152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WPZMUAzq5xtA38zHOIyK2dT/ynl0SX29dwxZaQ7useE=; b=KRtYNMBQbgXTzgs8RbDppVOON38qmah+Q/6APl6ysFcRlLPvpAJEugsa/kqUCkvjNB whtPYoGJnA2Rp+Gk7lUElyyK2E+f/e1qfP3r832L0i/l5zI1w/KEmsfdKnWzT/c1rPl8 zNepW00Xe689gIOxNdi3cbb9XWZklP24E/qPFprK6Oa1I8eSNJWSCDXRy0RJ1OcEjLEE mRpYx1h8HXr6GlzjZZLHVERzCeXHfgxjE+WbZ3HJnlG1egDjh5r3u+s259tBjygvZOpJ 7peef3bOe3ku9kZTobMdUiboXj5E1ymM3dR0M+pukvMyxWBvcxwvw8iV/4/nxPx85zWp bMJQ== X-Gm-Message-State: AOJu0Yyu1j177fqCc9bpQjCm/2OH9MYc6TOyjsaYTEFBRXczfQHqVIiM gXEt8gnpX8k8P3366/HwoW72p1VRezISmV/ehLoUaCBeIEf05wd0UP6a8w== X-Google-Smtp-Source: AGHT+IGWF/V6JNlluZG6ILq9DYB3a7fjHkJlZef8CozzVpK84FakpiMoLtNhgGu8dteG3hlSoj6XGQ== X-Received: by 2002:a17:90b:1a8f:b0:2da:82d4:c63c with SMTP id 98e67ed59e1d1-2e94bcb6255mr26008918a91.4.1730832351680; Tue, 05 Nov 2024 10:45:51 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:51 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 09/19] llvm: Delete Date: Tue, 5 Nov 2024 10:45:28 -0800 Message-ID: <20241105184540.3450302-9-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206737 clang recipes would PROVIDE and RPROVIDE llvm Signed-off-by: Khem Raj --- ...r-sort-ClassInfo-lists-by-name-as-we.patch | 31 --- ...-llvm-allow-env-override-of-exe-path.patch | 37 ---- meta/recipes-devtools/llvm/llvm/llvm-config | 51 ----- meta/recipes-devtools/llvm/llvm_19.1.2.bb | 179 ------------------ 4 files changed, 298 deletions(-) delete mode 100644 meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch delete mode 100644 meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch delete mode 100644 meta/recipes-devtools/llvm/llvm/llvm-config delete mode 100644 meta/recipes-devtools/llvm/llvm_19.1.2.bb diff --git a/meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch b/meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch deleted file mode 100644 index a5c53b66574..00000000000 --- a/meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 3b30a9bda88374e8f03bf96e972aee5bd214b98b Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 27 Nov 2020 10:11:08 +0000 -Subject: [PATCH] AsmMatcherEmitter: sort ClassInfo lists by name as well - -Otherwise, there are instances which are identical in -every other field and therefore sort non-reproducibly -(which breaks binary and source reproducibiliy). - -Upstream-Status: Submitted [https://reviews.llvm.org/D97477] -Signed-off-by: Alexander Kanavin ---- - llvm/utils/TableGen/AsmMatcherEmitter.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -index 73724e662f9e..1ca9c73415db 100644 ---- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp -+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -@@ -361,7 +361,10 @@ public: - // name of a class shouldn't be significant. However, some of the backends - // accidentally rely on this behaviour, so it will have to stay like this - // until they are fixed. -- return ValueName < RHS.ValueName; -+ if (ValueName != RHS.ValueName) -+ return ValueName < RHS.ValueName; -+ // All else being equal, we should sort by name, for source and binary reproducibility -+ return Name < RHS.Name; - } - }; - diff --git a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch deleted file mode 100644 index add38b3bb4d..00000000000 --- a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 588a8694c6540e31140c7e242bfb5e279d6ca08c Mon Sep 17 00:00:00 2001 -From: Martin Kelly -Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH] llvm: allow env override of exe and libdir path - -When using a native llvm-config from inside a sysroot, we need llvm-config to -return the libraries, include directories, etc. from inside the sysroot rather -than from the native sysroot. Thus provide an env override for calling -llvm-config from a target sysroot. - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Martin Kelly -Signed-off-by: Khem Raj ---- - llvm/tools/llvm-config/llvm-config.cpp | 25 +++++++++++++++++++------ - 1 file changed, 19 insertions(+), 6 deletions(-) - -diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp -index e86eb2b44b10..7b2abf318dbe 100644 ---- a/llvm/tools/llvm-config/llvm-config.cpp -+++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -246,6 +246,13 @@ Typical components:\n\ - - /// Compute the path to the main executable. - std::string GetExecutablePath(const char *Argv0) { -+ // Hack for Yocto: we need to override the root path when we are using -+ // llvm-config from within a target sysroot. -+ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); -+ if (Sysroot != nullptr) { -+ return Sysroot; -+ } -+ - // This just needs to be some symbol in the binary; C++ doesn't - // allow taking the address of ::main however. - void *P = (void *)(intptr_t)GetExecutablePath; - diff --git a/meta/recipes-devtools/llvm/llvm/llvm-config b/meta/recipes-devtools/llvm/llvm/llvm-config deleted file mode 100644 index 5e4ded2da5b..00000000000 --- a/meta/recipes-devtools/llvm/llvm/llvm-config +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# Copyright OpenEmbedded Contributors -# -# SPDX-License-Identifier: MIT -# -# Wrap llvm-config since the native llvm-config will remap some values correctly -# if placed in the target sysroot but for flags, it would provide the native ones. -# Provide ours from the environment instead. - -NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" -if [[ $# == 0 ]]; then - exec "$NEXT_LLVM_CONFIG" -fi - -remain="" -output="" -for arg in "$@"; do - case "$arg" in - --cppflags) - output="${output} ${CPPFLAGS}" - ;; - --cflags) - output="${output} ${CFLAGS}" - ;; - --cxxflags) - output="${output} ${CXXFLAGS}" - ;; - --ldflags) - output="${output} ${LDFLAGS}" - ;; - --shared-mode) - output="${output} shared" - ;; - --libs) - output="${output} -lLLVM" - ;; - --link-shared) - break - ;; - *) - remain="${remain} ${arg}" - ;; - esac -done - -if [ "${remain}" != "" ]; then - output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) -fi - -echo "${output}" diff --git a/meta/recipes-devtools/llvm/llvm_19.1.2.bb b/meta/recipes-devtools/llvm/llvm_19.1.2.bb deleted file mode 100644 index 7128d1e71ee..00000000000 --- a/meta/recipes-devtools/llvm/llvm_19.1.2.bb +++ /dev/null @@ -1,179 +0,0 @@ -# Copyright (C) 2017 Khem Raj -# Released under the MIT license (see COPYING.MIT for the terms) - -SUMMARY = "The LLVM Compiler Infrastructure" -HOMEPAGE = "http://llvm.org" -LICENSE = "Apache-2.0-with-LLVM-exception" -SECTION = "devel" - -LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe" - -DEPENDS = "libffi libxml2 zlib zstd libedit ninja-native llvm-native" - -RDEPENDS:${PN}:append:class-target = " ncurses-terminfo" - -inherit cmake pkgconfig -# could be 'rcX' or 'git' or empty ( for release ) -VER_SUFFIX = "" - -PV .= "${VER_SUFFIX}" - -MAJOR_VERSION = "${@oe.utils.trim_version("${PV}", 1)}" - -LLVM_RELEASE = "${PV}" - -SRC_URI = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz \ - file://0007-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \ - file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \ - file://llvm-config \ - " -SRC_URI[sha256sum] = "3666f01fc52d8a0b0da83e107d74f208f001717824be0b80007f529453aa1e19" -UPSTREAM_CHECK_URI = "https://github.com/llvm/llvm-project" -UPSTREAM_CHECK_REGEX = "llvmorg-(?P\d+(\.\d+)+)" - -S = "${WORKDIR}/llvm-project-${PV}.src/llvm" - -LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install" - -def get_llvm_arch(bb, d, arch_var): - import re - a = d.getVar(arch_var) - if re.match(r'(i.86|athlon|x86.64)$', a): return 'X86' - elif re.match(r'arm$', a): return 'ARM' - elif re.match(r'armeb$', a): return 'ARM' - elif re.match(r'aarch64$', a): return 'AArch64' - elif re.match(r'aarch64_be$', a): return 'AArch64' - elif re.match(r'mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' - elif re.match(r'riscv(32|64)(eb|)$', a): return 'RISCV' - elif re.match(r'p(pc|owerpc)(|64)', a): return 'PowerPC' - else: - raise bb.parse.SkipRecipe("Cannot map '%s' to a supported LLVM architecture" % a) - -def get_llvm_host_arch(bb, d): - return get_llvm_arch(bb, d, 'HOST_ARCH') - -PACKAGECONFIG ??= "libllvm" -# if optviewer OFF, force the modules to be not found or the ones on the host would be found -PACKAGECONFIG[optviewer] = ",-DPY_PYGMENTS_FOUND=OFF -DPY_PYGMENTS_LEXERS_C_CPP_FOUND=OFF -DPY_YAML_FOUND=OFF,python3-pygments python3-pyyaml,python3-pygments python3-pyyaml" -PACKAGECONFIG[libllvm] = "" - -# -# Default to build all OE-Core supported target arches (user overridable). -# -LLVM_TARGETS ?= "AMDGPU;${@get_llvm_host_arch(bb, d)}" - -ARM_INSTRUCTION_SET:armv5 = "arm" -ARM_INSTRUCTION_SET:armv4t = "arm" - -EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ - -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ - -DLLVM_ENABLE_PIC=ON \ - -DLLVM_BINDINGS_LIST='' \ - -DLLVM_LINK_LLVM_DYLIB=ON \ - -DLLVM_ENABLE_FFI=ON \ - -DLLVM_ENABLE_RTTI=ON \ - -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ - -DLLVM_OPTIMIZED_TABLEGEN=ON \ - -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS}' \ - -DLLVM_VERSION_SUFFIX='${VER_SUFFIX}' \ - -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ - -DCMAKE_BUILD_TYPE=Release \ - " - -EXTRA_OECMAKE:append:class-target = "\ - -DCMAKE_CROSSCOMPILING:BOOL=ON \ - -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \ - -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \ - " - -EXTRA_OECMAKE:append:class-nativesdk = "\ - -DCMAKE_CROSSCOMPILING:BOOL=ON \ - -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \ - -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \ - " - -# patch out build host paths for reproducibility -do_compile:prepend:class-target() { - sed -i -e "s,${WORKDIR},,g" ${B}/tools/llvm-config/BuildVariables.inc -} - -do_compile:prepend:class-nativesdk() { - sed -i -e "s,${WORKDIR},,g" ${B}/tools/llvm-config/BuildVariables.inc -} - -do_compile() { - if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then - ninja -v ${PARALLEL_MAKE} - else - ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen - fi -} - -do_install() { - if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then - DESTDIR=${D} ninja -v install - - # llvm harcodes usr/lib as install path, so this corrects it to actual libdir - mv -T -n ${D}/${prefix}/lib ${D}/${libdir} || true - - # Remove opt-viewer: https://llvm.org/docs/Remarks.html - rm -rf ${D}${datadir}/opt-viewer - rmdir ${D}${datadir} - - # reproducibility - sed -i -e 's,${WORKDIR},,g' ${D}/${libdir}/cmake/llvm/LLVMConfig.cmake - fi -} - -do_install:append:class-native() { - install -D -m 0755 ${B}/bin/llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} - install -D -m 0755 ${B}/bin/llvm-config ${D}${bindir}/llvm-config${PV} - ln -sf llvm-config${PV} ${D}${bindir}/llvm-config -} - -SYSROOT_PREPROCESS_FUNCS:append:class-target = " llvm_sysroot_preprocess" - -llvm_sysroot_preprocess() { - install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ - install -m 0755 ${UNPACKDIR}/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ - ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} -} - -PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-libllvm ${PN}-liboptremarks ${PN}-liblto" - -RRECOMMENDS:${PN}-dev += "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liboptremarks" - -FILES:${PN}-bugpointpasses = "\ - ${libdir}/BugpointPasses.so \ -" - -FILES:${PN}-libllvm = "\ - ${libdir}/libLLVM-${MAJOR_VERSION}.so \ - ${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \ -" - -FILES:${PN}-liblto += "\ - ${libdir}/libLTO.so.* \ -" - -FILES:${PN}-liboptremarks += "\ - ${libdir}/libRemarks.so.* \ -" - -FILES:${PN}-llvmhello = "\ - ${libdir}/LLVMHello.so \ -" - -FILES:${PN}-dev += " \ - ${libdir}/llvm-config \ - ${libdir}/libRemarks.so \ - ${libdir}/libLLVM-${PV}.so \ -" - -FILES:${PN}-staticdev += "\ - ${libdir}/*.a \ -" - -INSANE_SKIP:${PN}-libllvm += "dev-so" - -BBCLASSEXTEND = "native nativesdk" From patchwork Tue Nov 5 18:45:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08DE5D33A28 for ; Tue, 5 Nov 2024 18:45:55 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.web10.28084.1730832353350766130 for ; Tue, 05 Nov 2024 10:45:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pszsnyxk; spf=pass (domain: gmail.com, ip: 209.85.216.54, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2e2b549799eso4424827a91.3 for ; Tue, 05 Nov 2024 10:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832352; x=1731437152; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nbF+xcNQXofFd0whDS0A0m489IPKgOQ+H3AXb4Qolgw=; b=Pszsnyxksfb1jtssUKmxalyxP1qkWwz+wPMuZa21O0/upmu7BvdKnijBWxu9CoLGgA ZJfGK7mQ6davyRmCzjoJNoHdQb3Lu03tRgV6ZtiXqZLzyOOJKMT/1ekR8Q2Ch9OZiD9R 5Ux5PPCF1zvCeyXNNjJrZvLZfGBAzmQajx5bZ7Jvs+ziL/9/4YEFkth2s1A+kvr2eRVB HuQ11zEUdLmZejlMuPhousv2s+OL1wFHEXf3VVMLcTWwJ4cky3neZvj2uiHF7f0pO3N+ 2+QTrLE+HP/uyPafEVxNDypvYNn3zPQwhzrOiCWM8zsnjKUzrbBoel+3CZTjXm1W3Btk CBEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832352; x=1731437152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nbF+xcNQXofFd0whDS0A0m489IPKgOQ+H3AXb4Qolgw=; b=nGiSVUm3f46DlPuPK2GWX5K7I2NtG4ikGQ6STfciONM+klH3IO9YdTvEKxNTIs/BW9 OAOenltCHwPjYP3koOQlu8FUhgzCnRwqVmD41i2fQfv2wXVPzPyheUuYINqOl2aldP1O i0FAOVafNYsdojW49SnTeUbOSnROJoA+O6DNOmJenHja4GxjLG+2ExYlhYb47Dr2hb3w Gs9HhmbFjklOtnnfW8LxtpuwbJBvQ3G5amNj3vNwZZfA7T6iLLg35vURvtvSXG4dvK+6 rfM1/Jq6lZkrqek5+ie8qeSno9WVg2TNqBRgPKpvAf3J74hV74ZCHXuD8OIq+GQWJpiY 9ppQ== X-Gm-Message-State: AOJu0YxvhgMoLpXZeo7w7aEMqgwm7M0b4fYOW3vzAYPpqMar7JL77kQ6 2ZeKOBeeeMIHx7vg8wlZTmq1bv1kLhSTXtrlu+0gTjIe+Q9YpxdxjbZlIg== X-Google-Smtp-Source: AGHT+IFuTymRN1agndj3oJtlbqFHr60ONyRi4KImyy0b1o6paAhv5X3eYDF+VvLjLY8lhHpWycaIeA== X-Received: by 2002:a17:90b:33cf:b0:2e0:f896:9d6d with SMTP id 98e67ed59e1d1-2e94c2b6c6cmr24209338a91.16.1730832352577; Tue, 05 Nov 2024 10:45:52 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:52 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 10/19] spirv-llvm-translator: Add recipe Date: Tue, 5 Nov 2024 10:45:29 -0800 Message-ID: <20241105184540.3450302-10-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206738 Bring it from meta-clang Signed-off-by: Khem Raj --- .../spirv-llvm-translator_git.bb | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 meta/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb diff --git a/meta/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb b/meta/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb new file mode 100644 index 00000000000..204d472dac1 --- /dev/null +++ b/meta/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb @@ -0,0 +1,37 @@ +SUMMARY = "A tool and a library for bi-directional translation between SPIR-V and LLVM IR" +HOMEPAGE = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator" +LICENSE = "NCSA" +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" + +BRANCH = "llvm_release_190" +SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;branch=${BRANCH} \ + git://github.com/KhronosGroup/SPIRV-Headers;protocol=https;destsuffix=git/SPIRV-Headers;name=headers;branch=main \ + " + +PV = "19.1.0+git" +SRCREV = "d65c25a166531b2efb744358ad1dc5283e1cc72f" +SRCREV_headers = "efb6b4099ddb8fa60f62956dee592c4b94ec6a49" + +SRCREV_FORMAT = "default_headers" + +S = "${WORKDIR}/git" + +DEPENDS = "spirv-tools clang" + +inherit cmake pkgconfig python3native + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +# for CMAKE_SHARED_LIBS=OFF see https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1868 +EXTRA_OECMAKE = "\ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_SKIP_RPATH=ON \ + -DLLVM_EXTERNAL_LIT=lit \ + -DLLVM_INCLUDE_TESTS=ON \ + -Wno-dev \ + -DCCACHE_ALLOWED=FALSE \ + -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${S}/SPIRV-Headers \ +" + +BBCLASSEXTEND = "native nativesdk" From patchwork Tue Nov 5 18:45:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEF42D33A23 for ; Tue, 5 Nov 2024 18:45:54 +0000 (UTC) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.web10.28086.1730832354171523727 for ; Tue, 05 Nov 2024 10:45:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lyeiy/pQ; spf=pass (domain: gmail.com, ip: 209.85.214.180, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20c6f492d2dso63638125ad.0 for ; Tue, 05 Nov 2024 10:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832353; x=1731437153; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RHgSRfEPrS6qbRFtmNeKetzbcNp7ENabCVqjtiI3Yzc=; b=lyeiy/pQCspPswGlWH4nkkKD6PkQcf0Gmt0DV6In90Yp4zrQAFXF1FgWeddklrU+vs zQRYhHEBkvwGtvUyTHi8bTxm7882EO6xjjTkJmT+mHCIAJER5fXKFZyKGjvzUkCJbx0D 3UAixNSwSYuR6ZYrvxd7ae3cjbWe289A/glEpNh7v2k2264vgnsWOlsMFylS+Jj5vrhO tL7iSBbr36+AvbohzgULWN0G34q0dp3DZlsOf1UWCw2WsAlj0N0LnT9dQvUwRQiuYFur tq0fUzXLrOqJ8Yp3iRGf8Cx9myB4idxQATmcUikj0banUq3oDuNWDZUPQ+MOHmrL2IyE A82g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832353; x=1731437153; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RHgSRfEPrS6qbRFtmNeKetzbcNp7ENabCVqjtiI3Yzc=; b=YjP76pW1LjZuzCtd+fEzFRU8kiiQ4KP+ZfPphGQvy0QBAyjaAMDKolUbIJOxz7kOdv uK3gsqLgQH7ySK6j2bCWRQTsaKbY4eG/iW5PhK3KWnNQTApICh27atyGp53TzBAZ+mlS cQyND7Ydsl8jZOciDXQgYttfqgvqZoOURZ1ApryRk9TeHj7QL+OIDhdq7aWj33YMaxxL NXTj6ndxP4uSpef7NWZOHFLx+swyMuQnNKFCaVlmD0SbytYZdJJ5iyeSGiPQ3nA+dFkM KrhGdTJM+d3tabjlMQxHd0oWYqajTzVR+20Td23LoALzpPAxgbe1hV5kmJCVIGv9WOlE tx2g== X-Gm-Message-State: AOJu0Yxva3sYiR2YWM8KWgsfaYY9s59N9xQKmMTkORkcUPOwO+A45AdW yahwZ/l0dQxxSn9/sMEfzcW0TAUG2aC0fr5QARy3oiZCOlQDg7nwSNh04w== X-Google-Smtp-Source: AGHT+IFVgrYyKOizBdlK295y1KJxQZpCgzVRQOn+PAn0atpF//5LOxkSVeLgiZiSnnzxop3z3zcQIQ== X-Received: by 2002:a17:90b:52cd:b0:2e2:f04d:9f0d with SMTP id 98e67ed59e1d1-2e94c2c3643mr24427727a91.16.1730832353438; Tue, 05 Nov 2024 10:45:53 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:53 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 11/19] multilib.conf: Add llvm-project-source recipe to NON_MULTILIB_RECIPES Date: Tue, 5 Nov 2024 10:45:30 -0800 Message-ID: <20241105184540.3450302-11-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:45:54 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206739 llvm sourcebase is large and like gcc, it reuses same source tree to build all recipes using clang+llvm sourcebase Signed-off-by: Khem Raj --- meta/conf/multilib.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf index 7bdfcd56aaa..a47eb27458b 100644 --- a/meta/conf/multilib.conf +++ b/meta/conf/multilib.conf @@ -24,4 +24,4 @@ OPKG_ARGS:append = " --force-maintainer --force-overwrite" # These recipes don't need multilib variants, the ${BPN} PROVDES/RPROVDES # ${MLPREFIX}${BPN} -NON_MULTILIB_RECIPES = "grub grub-efi make-mod-scripts ovmf u-boot gcc-source" +NON_MULTILIB_RECIPES = "grub grub-efi make-mod-scripts ovmf u-boot gcc-source llvm-project-source" From patchwork Tue Nov 5 18:45:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51852 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D30ED33A2E for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mx.groups.io with SMTP id smtpd.web10.28089.1730832355155723079 for ; Tue, 05 Nov 2024 10:45:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XzU6xw62; spf=pass (domain: gmail.com, ip: 209.85.215.176, mailfrom: raj.khem@gmail.com) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7f3da2c2cb5so1988438a12.2 for ; Tue, 05 Nov 2024 10:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832354; x=1731437154; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oxXO856R/73eFtivQgy5R1trms5EC6nTeohYXWKV8Sw=; b=XzU6xw62mS334d3CY4We849QJj4nxq/Tv5Fbd3skswQD3K6GPlxOSCjxO8+Qpf+wzv OTyqz/GSzumn7MrSB4B53JCrPdJF8/GSsj/bHbjr/gRf3770rwk3lZ0E7wn05nzdkX7u NsYjslMgrVFR/wGS9SNLtAYhgXt6ltfXWRTcdcVN5nyM3AfVSZEHs09RIBNW9sCJJMC+ FjQeSqDooJdcNJbmkr317caVifNpj8kcuqE6PcV0KUmwFspAmvREfT6YDnnXph6HOz1J 6OGxOnb2qdSyxfqRihzVkRV5ewel0LxhYkQDUvoYr+MdZFbookALXnwmv3URXhEkx3AS k/OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832354; x=1731437154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oxXO856R/73eFtivQgy5R1trms5EC6nTeohYXWKV8Sw=; b=RqMErGdWSlkzF31222PnebJwOVl+hiqMaBT+ad487hDlJbsZNmfkOZXqUCUuX3T2Nu EbLTUs5hlOT5RhVsG6Kd0btxUvt8rcO48yIh9Id2S1mufC5kc4TKabGPvYL3XkEjGgaX vnudSdlkjVouUXBjHg9KzQpRNqwtKYtb/xTxXxjrlT+8oCFqoN5VzFgitCzr3W5Y+OEi n0MqVO/ViSrzFFTpJPavuYCCBX6D7M19mJpVR3JwiORdTR5jKHowGlndASyZAO01PoT8 FEf3Mls6aVy2oNKHg0x0bj3ssr0uwieqCgFyH9XzHljxaHfQkW1B9/8eaSI6aDnyCG7J fBDw== X-Gm-Message-State: AOJu0YwbQ8LWmJ57IkWMGE5lK5hNM4visH50lJMe5ODAY/y0x/Z0H893 RSgcgKORQCvyqibT5AtlZeBHICbFTU8avE7QnMgASsfo1CgiZvtqpkSIpg== X-Google-Smtp-Source: AGHT+IFUUgEaGjeB1PxoIgoc6n16fAzc6HA9mcSm501HWtAm9CkHZL4mD8oeLyDVKvo+DrSN0qM1kw== X-Received: by 2002:a05:6a21:6d9d:b0:1db:f603:4f2a with SMTP id adf61e73a8af0-1dbf6034f46mr3071916637.14.1730832354288; Tue, 05 Nov 2024 10:45:54 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:53 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 12/19] distro/defaultsetup: Inherit clang, nonclangable, and nonscanable Date: Tue, 5 Nov 2024 10:45:31 -0800 Message-ID: <20241105184540.3450302-12-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206740 This ensures that when TOOLCHAIN = "clang" then the right tweaks are added for recipes to either work with clang or fallback to use gcc Signed-off-by: Khem Raj --- meta/conf/distro/defaultsetup.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/conf/distro/defaultsetup.conf b/meta/conf/distro/defaultsetup.conf index e6369dcec4b..7a40efe86ce 100644 --- a/meta/conf/distro/defaultsetup.conf +++ b/meta/conf/distro/defaultsetup.conf @@ -5,6 +5,9 @@ include conf/distro/include/maintainers.inc include conf/distro/include/time64.inc require conf/distro/include/tcmode-${TCMODE}.inc require conf/distro/include/tclibc-${TCLIBC}.inc +require conf/distro/include/clang.inc +require conf/distro/include/nonclangable.inc +require conf/distro/include/nonscanable.inc require conf/distro/include/uninative-flags.inc From patchwork Tue Nov 5 18:45:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69047D33A3E for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mx.groups.io with SMTP id smtpd.web10.28090.1730832355910331922 for ; Tue, 05 Nov 2024 10:45:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XbAonhsM; spf=pass (domain: gmail.com, ip: 209.85.215.172, mailfrom: raj.khem@gmail.com) Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-7ea68af2f62so4407114a12.3 for ; Tue, 05 Nov 2024 10:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832355; x=1731437155; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yIGK07TqJ1B3hW4Ss7rZFNAW8Z49iCU0vVgpneH9XVk=; b=XbAonhsMfOZt849CF0tRfqDDrjhVwyrGafiYD40HgrtZJY9lPRVKfqZYAW1abECzsU yZVGKMBsGgNPqwfpBbL/3m70P6UF/+zLabNTuGFWwwAZ2O1XLCpN5uvDRYwBvIR/75bD RiuvXBkZtCJVLdIclM01aWeKPNsqyPtCtewxd4ryLOlRTVoIHzTRYG3Dkuy9zW6fmW2s zSERHQ68Kkihkf00LJsSwxyBhhknppurjD18aAooir1nVNAOaY7FJa7twzV86goMf/FI I2yQF9UXDNITq/dGmNQRUvQYf+l7xLtfdTwgfp4aCYw3dIt3efX/mmS+YwC/L+SgDZBs 5UPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832355; x=1731437155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yIGK07TqJ1B3hW4Ss7rZFNAW8Z49iCU0vVgpneH9XVk=; b=St0HDhqDqzyce1HfBVmRuWHEhbOpr8O9FyAsn2+DWGTOgi0Xl+PEdyk+8paWra2XSp e03NlL5DEC+JxuhA+T8WojTbnjsv5GDr06tiFHUURsnQfKaXIIp0JgHFNW5QzXSNWE7z lgp9k6HBVORoVcA1hbM2MmflT2hGY1ytrR/LX4M6iTfitmvJjlJ+rqBwYoB5Kr3jmzMD N2yQli+A7mTT0tNNLWla4u12gHJerqTWjI2QEvLdhEyrPDsPeGdfjWSyowBFFWtj9oKM XczswWvHefxoLTk3CXkHBOEksZ/3GzXES/0kZLHoDFZJ+y42DzaSgfiK336QBhe44lIP AINQ== X-Gm-Message-State: AOJu0Yxu4+vPtDPhp62b4636e/+r7vFyC+/JHLKlUTadnBqJ+IsJh8D9 zCM/9TDEfH/8VPDpZal6hVI+jHDyYO3Vv7hJTkL5mwVBWDWUMc3saDiLVg== X-Google-Smtp-Source: AGHT+IHFvl/XrVgb+iLGYyOjbdsTRlwbJP1NcKaK10XbxfDQ4P3HfeRvx64VADmC3iYqK0qb5uy5fw== X-Received: by 2002:a17:90b:5448:b0:2e2:e8a9:a1f with SMTP id 98e67ed59e1d1-2e94c2c30famr25244913a91.13.1730832355145; Tue, 05 Nov 2024 10:45:55 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:54 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 13/19] maintainers.inc: Add myself as maintainer for clang family of recipes Date: Tue, 5 Nov 2024 10:45:32 -0800 Message-ID: <20241105184540.3450302-13-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206741 Signed-off-by: Khem Raj --- meta/conf/distro/include/maintainers.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 7aafa7a2d14..f3ae74423a1 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -96,8 +96,14 @@ RECIPE_MAINTAINER:pn-cantarell-fonts = "Alexander Kanavin X-Patchwork-Id: 51849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44C57D33A29 for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web10.28091.1730832356734716480 for ; Tue, 05 Nov 2024 10:45:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KAofE7Uh; spf=pass (domain: gmail.com, ip: 209.85.216.52, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2e34a089cd3so4622190a91.3 for ; Tue, 05 Nov 2024 10:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832356; x=1731437156; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V8cDWgg+sCChG/Zey9P7FkOxqFdfgPSNUjnlnxB4710=; b=KAofE7UhRsIp6zYZAa5wpAB/J+leSKklQaRqWuff7zrAdr1gSeQdbdlfghP2JCuMzn Kqwkza5ZCGjXtGoc0YLXuh2Bu/zsx0jW8ht1DT4DvXi6dVrrHI/WlNCjaBUYE6o7SMbt 2Gc/sSqaslguqdLtQvIBy9AdNKDaat5Jlc2k/I+5e72UFtAS/vue6h4K6Nk7ikCOLjve S5okcuDFb9UJeJeCrmir7D3wW/7YE3IgrGHFpWQCTtdYWzkBafTTLnGJDA46XZuBt11x pMKoFxxqqneImM4yoJpwCdQOzDb6sFHH6HvLp06bnPzoXbpjh38XNjPM2NF+6a64pxYi hL3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832356; x=1731437156; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V8cDWgg+sCChG/Zey9P7FkOxqFdfgPSNUjnlnxB4710=; b=tMO6L9dah0TuFhpo9Os2dKDZ/aepMWBW6u1cxnIvtffmS5S/P5DywMJeONlOhMnlaX MAtuGaWwc3rlquxHk4cMv1KUJoAN1dg2aO4lNVeIVSQP97QAw90vqtPYvgJMam4xcEmX oqJJjteUZVNNlzfsjJotjgM1rzxXNWsMQESoI2dsIIposlKr3hGBo3ao0GkJKUUxxv+Z KD41dqkyiDL7zp/3pmCYo32i72tb7tytvZ9FGwXY4W9MpUa2jgvd8vXE7R/gy90odMh1 qYJ/jEAHBJdtuPuLYnYsJqwX7G7K5O3CLRZrHPlNngL77ZoqLz6lBxP2Bj7mCBLjhRkE dZ/w== X-Gm-Message-State: AOJu0YzlpRoS2GKj14g+KPGBnREpG5ghITgYrtgpWaPntYV/M0mNwiF9 K2QDNwR1yMCxVT76anfCbbwOfRRT8zJveP0v6fttK+VlK9ys7YCr8G6NfA== X-Google-Smtp-Source: AGHT+IFpOJawOqD02NDfZ6mB+5gJmfsAgjJ3E7tQgswORF4LenouUAL+FXQYluq4SHN1znCFOF3xDg== X-Received: by 2002:a17:90a:d14f:b0:2e2:bb32:73eb with SMTP id 98e67ed59e1d1-2e8f10a72a3mr41305752a91.31.1730832356000; Tue, 05 Nov 2024 10:45:56 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:55 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 14/19] clang: PROVIDE llvm-native and llvm Date: Tue, 5 Nov 2024 10:45:33 -0800 Message-ID: <20241105184540.3450302-14-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206742 Now that clang is providing llvm as well, it should keep existing demands on llvm recipe Signed-off-by: Khem Raj --- meta/recipes-devtools/clang/clang_git.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index 1ad40f2fcff..56b569fa73a 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -303,6 +303,9 @@ do_install:append:class-nativesdk () { sed -i -e 's,${B},,g' ${D}${libdir}/cmake/llvm/LLVMConfig.cmake } +PROVIDES:append:class-native = " llvm-native" +PROVIDES:append:class-target = " llvm" + PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ libclang lldb lldb-server liblldb llvm-linker-tools" From patchwork Tue Nov 5 18:45:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51850 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E69AD33A37 for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web10.28092.1730832357557452627 for ; Tue, 05 Nov 2024 10:45:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=emBa3dTV; spf=pass (domain: gmail.com, ip: 209.85.214.182, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-20cbca51687so55682685ad.1 for ; Tue, 05 Nov 2024 10:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832357; x=1731437157; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AWO7ZYEc+r7G3zn6w0MLPuWBTjXGJZg8ikfEqJkwqjM=; b=emBa3dTVi+fV+zMK3Q2PvxaY/UMIZjvXoHjm9hP1UAhsxHy3gD4GAg58QgP1Ot9MNy np2qnVlaNMKK+jkAHNYr7NIUgwStrUlCOSoCG2W7rP0M8+NIvXNvU98sYgYdDfsbocs1 ZgSSG7mhBGKHxhBZGbEJhxzYFmLAZwtcCaX+wM9HXvbcjcla07L6kQq9SW3qz7HlAsVp cpnatjDYnX/LPO+RuHTUwd8QlJvVD110J0HzfpUSTUko65pTNcFY9MLsyIDyGuVCsqyR rNF++uX38w8r+nsGv1oJ/gcK368Q3GmS/FqvhG1/mL4BiF3dTHkTstcL7RHd1YP2K7WA KACg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832357; x=1731437157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AWO7ZYEc+r7G3zn6w0MLPuWBTjXGJZg8ikfEqJkwqjM=; b=kPw3wuLvq4WCj07TWxXIXcYRQ/FujFf+Hl597QH+4bBkE0mBztTCadsat6KZVmnsLe S14zahHa8FYgfUP8VtQR9vtaESTap7kYpA+N8Vt/a0vtj0Hwlckr9QZGJWrM5nyLFdNu bGnPgnkB8VxBIhR8CMUahju5//WEpflS0McvIBp4Osvsk3xOtW/PFJbFIaIPJxWkrGn5 2RbhkRrOJQp2o4ZqrfheiKd1MaAJEtV1aWIJ6AikNn08GKSlcQ3Q7dmXvRXfgppUhjIe 2ltZNTL07JjPW7OqqR5zfaCxCQbQ6qUHSOJ9i3E90ewHkHJ6h9+Ioq+pg0VqleCgE3Kc VD5g== X-Gm-Message-State: AOJu0YzhGEL3MKzd1ofaovyyYn+NwcthDtd0mVOEoLzw5iTy6GidqCV/ XWL+mqd5p/gV4eLMs29rozyf44SrLe5KCvJVb/mFp+wbqNa7od6leo1GsQ== X-Google-Smtp-Source: AGHT+IFJhM0F1PwCmPtT00/wUu3B4vvFbJexYMxJOt/QpmzUij6GA+DDER8haPsE09bf2sYe/g7sbQ== X-Received: by 2002:a17:902:c94d:b0:20c:92ce:359d with SMTP id d9443c01a7336-2111af5e6f2mr253410465ad.45.1730832356812; Tue, 05 Nov 2024 10:45:56 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:56 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 15/19] rpm: Use gcc to compile always Date: Tue, 5 Nov 2024 10:45:34 -0800 Message-ID: <20241105184540.3450302-15-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206743 openMP is LLVM implementation which is used by clang for openmp runtime but it ends up with reproducibility bug in clang, until its fixed lets always use gcc Signed-off-by: Khem Raj --- meta/recipes-devtools/rpm/rpm_4.19.1.1.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/recipes-devtools/rpm/rpm_4.19.1.1.bb b/meta/recipes-devtools/rpm/rpm_4.19.1.1.bb index 93303237973..d75106aabea 100644 --- a/meta/recipes-devtools/rpm/rpm_4.19.1.1.bb +++ b/meta/recipes-devtools/rpm/rpm_4.19.1.1.bb @@ -49,6 +49,10 @@ S = "${WORKDIR}/git" DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd" DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native" +# clang needs libomp which ends up with buildpaths in binaries debug info +# see https://github.com/llvm/llvm-project/issues/82541 +TOOLCHAIN = "gcc" + EXTRA_OECMAKE:append = " -D__CURL:FILEPATH=curl" EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF -DENABLE_OPENMP=OFF" From patchwork Tue Nov 5 18:45:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55A9CD33A3A for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web10.28094.1730832358479910312 for ; Tue, 05 Nov 2024 10:45:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bkE3wlOV; spf=pass (domain: gmail.com, ip: 209.85.214.179, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-20cbcd71012so67185495ad.3 for ; Tue, 05 Nov 2024 10:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832358; x=1731437158; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XLC++yM0KemcbNPsRQUxlf4rKIqEGLQVKJAVLtZ/sOU=; b=bkE3wlOVnoTKtgCPJ5V/NxLKWa3sBIDSSUO/uh9aoa/krx1EJfoDazp104jKfSSMcU tZgaguVHI3gHA6bCMhhlbMCiS6tM3G9ZTx8R+ghTBPgVjAsVDGjqgesVfKFW5a0f1X9K 7H0Eqx36UFmECNDGTFHPi/f5Kt9f85tImngXjX/NlYX+R/tKj5aUxAk3l4rFJ6k9y0/o +NsJvx3zQNinw6NKpnV0j2/UdZ4F1+ISZRTyVaGG/a5D5n8zfAGi81yB2dEIwVTgoHPF Yb6MM5Gcc9Y+K5jFnWO8ET8Mw0Q4QNK/hv84rOafMNap7vXo/w4cGnTY7ViZQ9sfhACq TrCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832358; x=1731437158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XLC++yM0KemcbNPsRQUxlf4rKIqEGLQVKJAVLtZ/sOU=; b=ViA3KTCCEpJKCFzbDsvW0iXGX0YEvfp/Autna3n1pL2WekkEUYMQE7f2bo0UgjbaT9 chl26ez10hTybH9zpikz8DHkiTm4/MG5m2n7JPW4pFFYXcFnQXsGZIUmERqbFyaRKQdD kynNxey6UfqhJ4UUuF4Gjfh7Rhyj9pRy7vbnOA35QOpwYp+CX9BvZpv/p18NM97tbEEm S3dxy2XAJDRA3ZaREu0140VblO0ONy4ezknOyfwjWHbk4sJ8hklnhueRBXeAjIrOvuJP CRIq8KVm9KEgqHnjQ4myirHDJBV/ZX/fLqftYDmf9WUwwvlHY3lCO05GpMf040S6tbqq PqMA== X-Gm-Message-State: AOJu0YwsoUFNW35l4uUs7HHY2ZgPQdxii5TsdY3WO14NCpmBW2VY0PWB 5J+NgfhgpNRY5efx7K3vYAekFQFX5aWvv74OeJZydL2y8B7IVQVLXrhZQw== X-Google-Smtp-Source: AGHT+IFLL43I0hcZYPSbCLWeozEp0Of8GtavTkhzLRrD7ZYCSaat4NSbHIYJ9/jY2HoqbSTqFfmsGQ== X-Received: by 2002:a17:90b:1649:b0:2cb:5aaf:c12e with SMTP id 98e67ed59e1d1-2e94c53a75emr25465360a91.37.1730832357636; Tue, 05 Nov 2024 10:45:57 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:57 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 16/19] sdks: Add clang toolchain to SDKs Date: Tue, 5 Nov 2024 10:45:35 -0800 Message-ID: <20241105184540.3450302-16-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206744 Use SDK_TOOLCHAINS_LANGS to tether clang toolchain into SDKs Signed-off-by: Khem Raj --- documentation/ref-manual/variables.rst | 2 +- meta/classes-recipe/populate_sdk_base.bbclass | 2 ++ .../packagegroup-clang-cross-canadian.bb | 18 ++++++++++++++++++ .../packagegroup-clang-sdk-target.bb | 15 +++++++++++++++ .../packagegroup-core-buildessential.bb | 5 +++++ .../packagegroups/packagegroup-core-sdk.bb | 1 + 6 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 07ed143ac56..77dbe2814cb 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -7715,7 +7715,7 @@ system and gives an overview of their function and contents. :term:`SDK_TOOLCHAIN_LANGS` Specifies programming languages to support in the SDK, as a - space-separated list. Currently supported items are ``rust`` and ``go``. + space-separated list. Currently supported items are ``clang``, ``rust`` and ``go``. :term:`SDK_UPDATE_URL` An optional URL for an update server for the extensible SDK. If set, diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass index 031c65f05f3..68a772c3bd2 100644 --- a/meta/classes-recipe/populate_sdk_base.bbclass +++ b/meta/classes-recipe/populate_sdk_base.bbclass @@ -64,12 +64,14 @@ SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust" TOOLCHAIN_HOST_TASK ?= " \ nativesdk-packagegroup-sdk-host \ packagegroup-cross-canadian-${MACHINE} \ + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'clang', 'packagegroup-clang-cross-canadian-${MACHINE}', '', d)} \ ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-cross-canadian-${MACHINE}', '', d)} \ ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-cross-canadian-${MACHINE}', '', d)} \ " TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= "" TOOLCHAIN_TARGET_TASK ?= " \ ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \ + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'clang', multilib_pkg_extend(d, 'packagegroup-clang-sdk-target'), '', d)} \ ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', multilib_pkg_extend(d, 'packagegroup-go-sdk-target'), '', d)} \ ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', multilib_pkg_extend(d, 'libstd-rs'), '', d)} \ target-sdk-provides-dummy \ diff --git a/meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb new file mode 100644 index 00000000000..2a6303cc824 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb @@ -0,0 +1,18 @@ +SUMMARY = "Host SDK package for Clang cross canadian toolchain" +PN = "packagegroup-clang-cross-canadian-${MACHINE}" + +inherit cross-canadian packagegroup + +PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" + +CLANG="clang-cross-canadian-${TRANSLATED_TARGET_ARCH}" + +RDEPENDS:${PN} = " \ + ${@all_multilib_tune_values(d, 'CLANG')} \ + nativesdk-binutils \ + nativesdk-clang \ + nativesdk-glibc-dev \ + nativesdk-libgcc-dev \ + nativesdk-compiler-rt-dev \ + nativesdk-libcxx-dev \ +" diff --git a/meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb new file mode 100644 index 00000000000..2b30642427c --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb @@ -0,0 +1,15 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +SUMMARY = "Target packages for the Clang SDK" + +inherit packagegroup + +RDEPENDS:${PN} = " \ + clang \ + libcxx \ + compiler-rt \ +" diff --git a/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb index 2cd67ad05f8..d140f1f54af 100644 --- a/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb +++ b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb @@ -29,3 +29,8 @@ RDEPENDS:packagegroup-core-buildessential = "\ pkgconfig \ " +RDEPENDS:packagegroup-core-buildessential:append:toolchain-clang = "\ + clang \ + libcxx \ + compiler-rt \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb index 84e1a41d9a0..c2385a97b44 100644 --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb @@ -30,6 +30,7 @@ RDEPENDS:packagegroup-core-sdk = "\ tcl \ ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \ ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \ + ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'clang', 'packagegroup-clang-sdk-target', '', d)} \ " SANITIZERS = "libasan-dev libubsan-dev" From patchwork Tue Nov 5 18:45:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E8AFD33A38 for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web10.28095.1730832359252787270 for ; Tue, 05 Nov 2024 10:45:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J+4Y7HGs; spf=pass (domain: gmail.com, ip: 209.85.216.46, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2e2fb304e7dso4631216a91.1 for ; Tue, 05 Nov 2024 10:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832358; x=1731437158; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t865dY0gstbc9bVlcWYKwM9wyM2OAjL1+XgM/yI9MVE=; b=J+4Y7HGsny+WbSoMFg3HiAXC4XpQpl3gUSFj+8gHZmJZlaNnXEe+9TjtAYc2sXmUOI h9HOV9+N6lD7oZ5vb+pGTY1sxSohCmhCoaH+abHzGVH6A+eUcaCif/2e9JR5Tz7XerJC DnBbdoxlKErPbpdALnX3yB7tk/zq+1I2atgnxeZ9RtTa9ho/cxdKt/zZ5VzyMaNUPzuj HJreWUkHsm1GZWnVN7m4l1lT1wvRSywO2AzXtap9InwKtCL1hzRXOAl62EmDj8bQ9xzF hsAGYvsEyHpd+YtUFIOsyBgUDjTiKawL5kTvrxz90MDWkZ9hFSciFZu/L/kHVomRY4c3 +FbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832358; x=1731437158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t865dY0gstbc9bVlcWYKwM9wyM2OAjL1+XgM/yI9MVE=; b=xGLxwfIM5xvtnhsq3dK6jhpe+dtA+oLtUxLCyEpYjgY0q7qUgncYLb1mNid6VTvX8c eICWcYL8iGazM6JPjhG3JwBrmaSG+PtP/Y0nYPvn0OyQ/FCZD0khBA7sxgn2604wvf1S dxWMieFM2OFvpCNTZP7nRk+xNX2s1un/VMvcWCByn7DRVUH47bsYSI4oEf1+PLQ7qXRI C7yG1uG9Cqj/TjwLXTF+SL5LgmTzhlB7u6dQEi+SQ59LxvhSK3/WyyjgcMPrjEo/UJiK r+gsI0jrFysbPSXRNOvJq3Be8zQE7n0lkEskOjn+Q0ENnHE+S27zB+2tfU94fSm+Hc9N /0/g== X-Gm-Message-State: AOJu0YxzCOziL2QvwDwEyxTZ7vV5XB1eFnISX8yyuqqxQrEWS2vYYfHy IQc0wg2EUThQMWkGe1tPnDq1L8ZYm1v+cc/IlKvzprDGRQ/U9l8wKz0y6g== X-Google-Smtp-Source: AGHT+IFpJDrTdvKfFSQCZTrXY+VKUiZKRqNKoqtVk+NlCycdwVm8dJc1F1ubPcsXFD8pDuFo6iKEcg== X-Received: by 2002:a17:90a:b706:b0:2e2:a097:bb02 with SMTP id 98e67ed59e1d1-2e8f105e828mr42355491a91.11.1730832358550; Tue, 05 Nov 2024 10:45:58 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:58 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 17/19] toolchain-scripts.bbclass: Add env variables in SDK to use clang/clang++ Date: Tue, 5 Nov 2024 10:45:36 -0800 Message-ID: <20241105184540.3450302-17-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206745 Make CLANGCC/CLANGCXX/CLANG_TIDY available in SDK Signed-off-by: Khem Raj --- meta/classes-recipe/toolchain-scripts.bbclass | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index b59a295abcc..f17905d5284 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass @@ -11,6 +11,17 @@ inherit toolchain-scripts-base siteinfo kernel-arch REAL_MULTIMACH_TARGET_SYS ?= "${MULTIMACH_TARGET_SYS}" TARGET_CC_ARCH:append:libc-musl = " -mmusl" +# Adjustments for clang in SDK +export TARGET_CLANGCC_ARCH = "${TARGET_CC_ARCH}" +TARGET_CLANGCC_ARCH:remove = "-mthumb-interwork" +TARGET_CLANGCC_ARCH:remove = "-mmusl" +TARGET_CLANGCC_ARCH:remove = "-muclibc" +TARGET_CLANGCC_ARCH:remove = "-meb" +TARGET_CLANGCC_ARCH:remove = "-mel" +TARGET_CLANGCC_ARCH:append = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" +TARGET_CLANGCC_ARCH:remove:powerpc = "-mhard-float" +TARGET_CLANGCC_ARCH:remove:powerpc = "-mno-spe" + # default debug prefix map isn't valid in the SDK DEBUG_PREFIX_MAP = "" @@ -147,7 +158,10 @@ toolchain_shared_env_script () { echo 'export ARCH=${ARCH}' >> $script echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script echo 'export OECORE_TUNE_CCARGS="${TUNE_CCARGS}"' >> $script - + echo 'export CLANGCC="${TARGET_PREFIX}clang --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script + echo 'export CLANGCXX="${TARGET_PREFIX}clang++ --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script + echo 'export CLANGCPP="${TARGET_PREFIX}clang -E --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script + echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script cat >> $script < X-Patchwork-Id: 51856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6791FD33A3D for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mx.groups.io with SMTP id smtpd.web10.28096.1730832360363756622 for ; Tue, 05 Nov 2024 10:46:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X2/iNhej; spf=pass (domain: gmail.com, ip: 209.85.214.174, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-20c9978a221so59660895ad.1 for ; Tue, 05 Nov 2024 10:46:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832359; x=1731437159; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M9FqJA+DlERMXGB8CffAw947cV6HNHOzdUkb/FE4P3Y=; b=X2/iNhejL0+KZl513QcynWxyL12lEh36cSt6YYLLO7qHxK3KM105NkwfekydUlewRm 4MI0fz5OEesoXuqn3kVAar81yAxLIaUec3Vf/6zJY+qsoMIkHXaFiU1GuHRCeVyOolrI 4SYuwbarBrhKzmh+scpZ0BOoOYwLc9kTXtobO/bg8QNNZTOTEoKnurj+8MUMINCnlqUo cwAdDUKsuTySS951lal9Uz2STrjUo4w/SRIsWciydJwr6PY3AbtcFlnSAJVM0vAY3ajw yF6uMaIfqxpLybtUaVCWeamnUJWP5RKruViVHkhd/YjJF21ppKvehDstw/17MEMyJR14 DXRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832359; x=1731437159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M9FqJA+DlERMXGB8CffAw947cV6HNHOzdUkb/FE4P3Y=; b=pVJyj7oANL7c38nMsB9IWqy2K3RoZ8gAL6VeP+LjbztwYMQjN7JpSJLcJx2xIs+cI1 vxnGlVUDvKbeZIstqIpHevc4VD1/84xSJRGIdLh8b4MCRUposzf8pHNz+yjhrwixWgqn kBs+4zPO5v61XGxMmwNwqfL7LWJFXXHO0EUdC+tcmwJLJZ0BYlqJZdu//W5tnaAVWbEk ML6KxX1lxdd9+sV3q07dQJwpcxOzgAau7hNq/mihrCsZwwx+yGs8DBC1phHvZtJinEim dREwqYODstzF+5+K1RZo6goOHvsodWfjcNeF/c9D6Dqa9MAEByuU+kTGwymHC/WDV0UR A77w== X-Gm-Message-State: AOJu0Yycc5/7V0uhbCJgw1XmPnw8q4zejvVaRm+rcfhU2c2AOLV+46aQ tE5JoPuu4prTP55YbjQ2TC8sUOE7iua+y1D7q+wK7Ltmr7uO27QU+lJuTg== X-Google-Smtp-Source: AGHT+IE0NH4toUtMZyNotDq09wTEkWkt5qn4Jb5UKa6WhgpvAWDGfdHvHkLGJmfP5RegmA7yAFoY7g== X-Received: by 2002:a17:902:ce90:b0:20c:9821:699d with SMTP id d9443c01a7336-210c6c9354dmr547920925ad.51.1730832359472; Tue, 05 Nov 2024 10:45:59 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:45:59 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Markus Volk , Khem Raj Subject: [PATCH 18/19] mesa: update 24.0.7 -> 24.2.2 Date: Tue, 5 Nov 2024 10:45:37 -0800 Message-ID: <20241105184540.3450302-18-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206746 From: Markus Volk - Remove patches that have been merged upstream - Remove 0001-Revert-meson-do-not-pull-in-clc-for-clover.patch. Issue was fixed upstream - Update 0001-freedreno-don-t-encode-build-path-into-binaries.patch - Use 'enabled/disabled' for glvnd instead of deprecated 'true/false' - swrast gallium driver has been split into 'softpipe' and 'llvmpipe'. The use of 'swrast' has been deprecated. [https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L171] - Add package for libgallium and install - Add python3-pyyaml-native dependency - Limit intel_clc to x86-64 - Remove OPENCL_NATIVE variable. The according option has been removed from meson_options.txt. - Meanwhile theres an install option for intel_clc. Use it instead of manual install - intel 'iris' and intel 'vulkan' drivers require opencl and thus need meta-clang layer [https://gitlab.freedesktop.org/mesa/mesa/-/issues/11141] - Remove gallium kmsro option. This is set depending on 'system_has_kms_drm' [https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L206] - Add vulkan support for older intel graphics Signed-off-by: Markus Volk Note: 'kmsro' needs to be removed from mesa.bbappend in meta-raspberrypi Signed-off-by: Khem Raj --- ...-meson-do-not-pull-in-clc-for-clover.patch | 53 -------------- ...lude-missing-llvm-IR-header-Module.h.patch | 41 ----------- .../0001-drisw-fix-build-without-dri3.patch | 58 --------------- ...on-t-encode-build-path-into-binaries.patch | 71 +++++++++++++++---- ...on-t-try-zink-if-not-enabled-in-mesa.patch | 42 ----------- meta/recipes-graphics/mesa/mesa.inc | 49 +++++-------- 6 files changed, 77 insertions(+), 237 deletions(-) delete mode 100644 meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch delete mode 100644 meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch delete mode 100644 meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch delete mode 100644 meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch diff --git a/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch b/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch deleted file mode 100644 index 1711e22585a..00000000000 --- a/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 051f41beda540f0ae77b341db01a6de83c9e938a Mon Sep 17 00:00:00 2001 -From: Markus Volk -Date: Fri, 8 Mar 2024 15:53:11 +0100 -Subject: [PATCH] Revert "meson: do not pull in clc for clover" - -This reverts commit 815a6647eb1383e9dc704ffcc266d85f3b13338a. -Upstream-Status: Inappropriate [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27783/diffs?commit_id=a976f2c9f0c07f9e06cc9affd9124b45bc60c2bd] - -Once the merge request above was added, it will only be possible to provide opencl spir-v with gallium-rusticl=true. This is not yet supported in the mesa recipe. -For now reverting this commit allows to still use clover with opencl-spirv, which would otherwise be broken starting from mesa 24.0.2. - -After it was merged, this patch needs to be removed and rusticl support will be required - -Signed-off-by: Markus Volk ---- - meson.build | 3 ++- - src/compiler/meson.build | 2 +- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 2db6185..741b5d1 100644 ---- a/meson.build -+++ b/meson.build -@@ -813,6 +813,7 @@ if _opencl != 'disabled' - error('The Clover OpenCL state tracker requires rtti') - endif - -+ with_clc = true - with_gallium_opencl = true - with_opencl_icd = _opencl == 'icd' - else -@@ -837,7 +838,7 @@ if with_gallium_rusticl - endif - - dep_clc = null_dep --if with_gallium_opencl or with_clc -+if with_clc - dep_clc = dependency('libclc') - endif - -diff --git a/src/compiler/meson.build b/src/compiler/meson.build -index 8d73544..1dae56d 100644 ---- a/src/compiler/meson.build -+++ b/src/compiler/meson.build -@@ -79,7 +79,7 @@ subdir('nir') - - subdir('spirv') - --if with_clc -+if with_opencl_spirv - subdir('clc') - endif - if with_gallium diff --git a/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch b/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted file mode 100644 index 82ad88a079c..00000000000 --- a/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 777d69cf15b80ab1f109a4936d6e4801c4b0e0f3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 1 Jul 2024 23:09:29 -0700 -Subject: [PATCH] amd: Include missing llvm IR header Module.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With LLVM-19, Module.h header is not being pulled, which results in -compile errors e.g. - -src/amd/llvm/ac_llvm_helper.cpp:102:10: error: no matching function for call to ‘unwrap(LLVMOpaqueModule*&)’ - 102 | unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple()); - | ~~~~~~^~~~~~~~ -In file included from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/Type.h:18, - from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/DerivedTypes.h:23, - from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/InstrTypes.h:26, - from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/Analysis/TargetLibraryInfo.h:14, - from ../mesa-24.0.7/src/amd/llvm/ac_llvm_helper.cpp:8: - -Its getting the definition from llvm/IR/Type.h instead of Module.h and caused -confusion to compiler - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29993] -Signed-off-by: Khem Raj ---- - src/amd/llvm/ac_llvm_helper.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp -index 5d065279ad1..af4a50f8409 100644 ---- a/src/amd/llvm/ac_llvm_helper.cpp -+++ b/src/amd/llvm/ac_llvm_helper.cpp -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch b/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted file mode 100644 index ab161520906..00000000000 --- a/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Tue, 6 Feb 2024 09:47:09 +0100 -Subject: [PATCH 1/2] drisw: fix build without dri3 - -commit 1887368df41 ("glx/sw: check for modifier support in the kopper path") -added dri3_priv.h header and dri3_check_multibuffer() function in drisw that -can be build without dri3. - - i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver': - drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer' - collect2: error: ld returned 1 exit status - -Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using -dri3_check_multibuffer(). - -Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path") - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] -Signed-off-by: Romain Naour -Signed-off-by: Khem Raj ---- - src/glx/drisw_glx.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c -index 3d3f752..4b19e2d 100644 ---- a/src/glx/drisw_glx.c -+++ b/src/glx/drisw_glx.c -@@ -32,7 +32,9 @@ - #include - #include "dri_common.h" - #include "drisw_priv.h" -+#ifdef HAVE_DRI3 - #include "dri3_priv.h" -+#endif - #include - #include - #include -@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, - goto handle_error; - } - -+#ifdef HAVE_DRI3 - if (pdpyp->zink) { - bool err; - psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err); -@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, - goto handle_error; - } - } -+#endif - - glx_config_destroy_list(psc->base.configs); - psc->base.configs = configs; --- -2.44.0 - diff --git a/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch index 5975ab4472e..38871b6d11f 100644 --- a/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +++ b/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch @@ -1,4 +1,4 @@ -From 027ac36756cc75eea9ed4fee135a351af30b35fd Mon Sep 17 00:00:00 2001 +From 66d73feaac088d1a588a44a1780f2eaf4335fccf Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Tue, 16 Jul 2024 12:32:47 +0300 Subject: [PATCH] freedreno: don't encode build path into binaries @@ -13,33 +13,76 @@ it manually when running the tests. Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30206] Signed-off-by: Dmitry Baryshkov --- + meson.build | 1 + + meson_options.txt | 7 +++++++ src/freedreno/afuc/meson.build | 4 ++++ src/freedreno/decode/meson.build | 4 +++- - src/freedreno/meson.build | 2 +- - 3 files changed, 8 insertions(+), 2 deletions(-) + src/freedreno/meson.build | 5 ++++- + 5 files changed, 19 insertions(+), 2 deletions(-) +diff --git a/meson.build b/meson.build +index 3bc837813f967..5c94e76649c63 100644 +--- a/meson.build ++++ b/meson.build +@@ -76,6 +76,7 @@ if with_tools.contains('all') + 'imagination', + ] + endif ++with_tools_for_development = get_option('tools-for-development') + + with_any_vulkan_layers = get_option('vulkan-layers').length() != 0 + with_intel_tools = with_tools.contains('intel') or with_tools.contains('intel-ui') +diff --git a/meson_options.txt b/meson_options.txt +index 753bebd961e3f..9bc308b512c13 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -537,6 +537,13 @@ option( + description : 'List of tools to build. (Note: `intel-ui` selects `intel`)', + ) + ++option( ++ 'tools-for-development', ++ type : 'boolean', ++ value : false, ++ description : 'Support running tools from the build tree (for developers)', ++) ++ + option( + 'power8', + type : 'feature', diff --git a/src/freedreno/afuc/meson.build b/src/freedreno/afuc/meson.build -index bb7cebf5a748..351cc31ef2de 100644 +index bb7cebf5a748c..351cc31ef2dec 100644 --- a/src/freedreno/afuc/meson.build +++ b/src/freedreno/afuc/meson.build -@@ -56,6 +56,7 @@ if with_tests +@@ -56,10 +56,12 @@ if with_tests asm_fw = custom_target('afuc_test.fw', output: 'afuc_test.fw', - command: [asm, '-g', '6', files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'], + command: [asm, files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'], ++ env: {'RNN_PATH': rnn_src_path}, + ) + asm_fw_a7xx = custom_target('afuc_test_a7xx.fw', + output: 'afuc_test_a7xx.fw', + command: [asm, files('../.gitlab-ci/traces/afuc_test_a7xx.asm'), '@OUTPUT@'], + env: {'RNN_PATH': rnn_src_path}, ) test('afuc-asm', diff, -@@ -120,6 +122,7 @@ if cc.sizeof('size_t') > 4 +@@ -120,11 +122,13 @@ if cc.sizeof('size_t') > 4 disasm_fw = custom_target('afuc_test.asm', output: 'afuc_test.asm', - command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw'), '-g', '630'], + command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw')], ++ env: {'RNN_PATH': rnn_src_path}, + capture: true + ) + disasm_fw_a7xx = custom_target('afuc_test_a7xx.asm', + output: 'afuc_test_a7xx.asm', + command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test_a7xx.fw')], + env: {'RNN_PATH': rnn_src_path}, capture: true ) test('afuc-disasm', diff --git a/src/freedreno/decode/meson.build b/src/freedreno/decode/meson.build -index 469eeb4eb597..dfa1c12d0d9f 100644 +index 469eeb4eb5975..915ba11af3b33 100644 --- a/src/freedreno/decode/meson.build +++ b/src/freedreno/decode/meson.build @@ -194,6 +194,7 @@ if dep_lua.found() and dep_libarchive.found() @@ -61,18 +104,20 @@ index 469eeb4eb597..dfa1c12d0d9f 100644 test('crashdec-' + name, diff --git a/src/freedreno/meson.build b/src/freedreno/meson.build -index 98e49b8fcf0e..145e72597eb9 100644 +index 98e49b8fcf0e9..f8bdc5299841b 100644 --- a/src/freedreno/meson.build +++ b/src/freedreno/meson.build -@@ -6,7 +6,7 @@ inc_freedreno_rnn = include_directories('rnn') +@@ -6,7 +6,10 @@ inc_freedreno_rnn = include_directories('rnn') rnn_src_path = dir_source_root + '/src/freedreno/registers' rnn_install_path = get_option('datadir') + '/freedreno/registers' -rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path +rnn_path = get_option('prefix') + '/' + rnn_install_path ++if with_tools_for_development ++ rnn_path = rnn_src_path + ':' + rnn_path ++endif dep_lua = dependency('lua54', 'lua53', 'lua52', 'lua', required: false, allow_fallback: true, version: '>=5.2') -- -2.39.2 - +GitLab diff --git a/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch b/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted file mode 100644 index 036a0b49453..00000000000 --- a/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Tue, 6 Feb 2024 09:47:10 +0100 -Subject: [PATCH 2/2] glxext: don't try zink if not enabled in mesa - -Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") -added an automatic zink fallback even when the zink gallium is not -enabled at build time. - -It leads to unexpected error log while loading drisw driver and -zink is not installed on the rootfs: - - MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so - -Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] -Signed-off-by: Romain Naour -Signed-off-by: Khem Raj ---- - src/glx/glxext.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/glx/glxext.c b/src/glx/glxext.c -index 05c825a..7a06aa9 100644 ---- a/src/glx/glxext.c -+++ b/src/glx/glxext.c -@@ -908,9 +908,11 @@ __glXInitialize(Display * dpy) - #endif /* HAVE_DRI3 */ - if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false)) - dpyPriv->dri2Display = dri2CreateDisplay(dpy); -+#if defined(HAVE_ZINK) - if (!dpyPriv->dri3Display && !dpyPriv->dri2Display) - try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && - !getenv("GALLIUM_DRIVER"); -+#endif /* HAVE_ZINK */ - } - #endif /* GLX_USE_DRM */ - if (glx_direct) --- -2.44.0 - diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 9fdf496e8b3..ecea7e94de8 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -16,15 +16,11 @@ PE = "2" SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ - file://0001-drisw-fix-build-without-dri3.patch \ - file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \ - file://0001-Revert-meson-do-not-pull-in-clc-for-clover.patch \ - file://0001-amd-Include-missing-llvm-IR-header-Module.h.patch \ file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\ " -SRC_URI[sha256sum] = "7454425f1ed4a6f1b5b107e1672b30c88b22ea0efea000ae2c7d96db93f6c26a" -PV = "24.0.7" +SRC_URI[sha256sum] = "fd077d3104edbe459e2b8597d2757ec065f9bd2d620b8c0b9cc88c2bf9891d02" +PV = "24.2.2" UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P\d+(\.\d+)+)" @@ -38,7 +34,7 @@ do_install:append() { fi } -DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" +DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native python3-pyyaml-native gettext-native" DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}" EXTRANATIVEPATH += "chrpath-native" PROVIDES = " \ @@ -77,8 +73,8 @@ EXTRA_OEMESON = " \ -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ " -EXTRA_OEMESON:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}" -EXTRA_OEMESON:append:class-native = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled', '', d)}" +EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}" +EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled -Dinstall-intel-clc=true', '', d)}" def strip_comma(s): return s.strip(',') @@ -108,10 +104,10 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence" # Vulkan drivers need dri3 enabled # amd could be enabled as well but requires gallium-llvm with llvm >= 3.9 VULKAN_DRIVERS = "" -VULKAN_DRIVERS:append:x86 = ",intel,amd" -VULKAN_DRIVERS:append:x86-64 = ",intel,amd" +VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains('PACKAGECONFIG', ',opencl', ',intel', '', d)},intel_hasvk,amd" +VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd" # i686 is a 32 bit override for mesa-native -VULKAN_DRIVERS:append:i686 = ",intel,amd" +VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}" @@ -137,7 +133,7 @@ PACKAGECONFIG[freedreno-fdperf] = ",,libconfig" PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}" PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false" -PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd" +PACKAGECONFIG[glvnd] = "-Dglvnd=enabled, -Dglvnd=disabled, libglvnd" # "gles" requires "opengl" PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled" @@ -145,32 +141,30 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2 # "egl" requires "opengl" PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" -# "opencl" requires libclc from meta-clang and spirv-tools from OE-Core -OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}" -PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native" +# "opencl" requires libclc from meta-clang +PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native" PACKAGECONFIG[broadcom] = "" PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native" PACKAGECONFIG[freedreno] = "" -PACKAGECONFIG[kmsro] = "" PACKAGECONFIG[vc4] = "" PACKAGECONFIG[v3d] = "" PACKAGECONFIG[zink] = "" -GALLIUMDRIVERS = "swrast" +GALLIUMDRIVERS = "softpipe${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',llvmpipe', '', d)}" # gallium swrast was found to crash Xorg on startup in x32 qemu GALLIUMDRIVERS:x86-x32 = "" -GALLIUMDRIVERS:append:x86 = ",i915,iris,crocus" -GALLIUMDRIVERS:append:x86-64 = ",i915,iris,crocus" +GALLIUMDRIVERS:append:x86 = ",i915,crocus" +GALLIUMDRIVERS:append:x86-64 = ",i915,crocus" # i686 is a 32 bit override for mesa-native -GALLIUMDRIVERS:append:i686 = ",i915,iris,crocus" +GALLIUMDRIVERS:append:i686 = ",i915,crocus" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" -GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',iris', '', d)}" # radeonsi requires LLVM GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}" @@ -247,7 +241,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \ libopencl-mesa libopencl-mesa-dev \ libxatracker libxatracker-dev \ mesa-megadriver mesa-vulkan-drivers \ - mesa-vdpau-drivers mesa-tools \ + mesa-vdpau-drivers mesa-gallium-drivers mesa-tools \ " do_install:append () { @@ -262,13 +256,6 @@ do_install:append () { rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc } -do_install:append:class-native () { - if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'true', 'false', d)}; then - install -d ${D}${bindir} - install -m0755 ${B}/src/intel/compiler/intel_clc ${D}${bindir} - fi -} - # For the packages that make up the OpenGL interfaces, inject variables so that # they don't get Debian-renamed (which would remove the -mesa suffix), and # RPROVIDEs/RCONFLICTs on the generic libgl name. @@ -339,6 +326,7 @@ FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d" FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${libdir}/libpowervr_rogue.so ${datadir}/vulkan" FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*" FILES:libegl-mesa = "${libdir}/libEGL*.so.* ${datadir}/glvnd/egl_vendor.d" +FILES:mesa-gallium-drivers = "${libdir}/libgallium-*.so" FILES:libgbm = "${libdir}/libgbm.so.*" FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*" FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*" @@ -366,6 +354,7 @@ FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \ # catch all to get all the tools and data FILES:${PN}-tools = "${bindir} ${datadir}" ALLOW_EMPTY:${PN}-tools = "1" +INSANE_SKIP:${PN}-megadriver = "dev-so" # Fix upgrade path from mesa to mesa-megadriver RREPLACES:mesa-megadriver = "mesa" From patchwork Tue Nov 5 18:45:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 51855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CF8DD33A2B for ; Tue, 5 Nov 2024 18:46:05 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mx.groups.io with SMTP id smtpd.web11.27959.1730832361288112320 for ; Tue, 05 Nov 2024 10:46:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LJn1aQQx; spf=pass (domain: gmail.com, ip: 209.85.216.48, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2e56750bb0dso4065251a91.0 for ; Tue, 05 Nov 2024 10:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730832360; x=1731437160; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aFGTtyB0UoXJKfCKm4sPjI3NvpYh9W/Lj62duw7nYvM=; b=LJn1aQQxnyxQ7RBjw46NLxTZWgOTvU2EPYwFWa2ww36DbfxcsK3p5UGy+zKHlwOCc9 hao7L42A8wosCuTnO1Y0l+VhUpvI2LTDkyInafUWiZAhDEzHxc4fMK0T58oYBmhLWjRY UYmdbiI8gh3tQKr5YkOAJB9IBvzUplZ+nKAN3zqG0Qk9WS8SBbBOlbL3MMzVBhP18Q8E rrV8eniXzBxDd+kqZJlADZxa4XnkpPszs1OmKApXa06wDc4h2cMVH2cIdvzrnHO6jjUD JJ0zq+B+r8nj76ylIC1JR5caH1nkl1Ti9WoHhDHWN7DurAaONlLBLdpQcKOB6SBn0i/4 Q5vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730832360; x=1731437160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aFGTtyB0UoXJKfCKm4sPjI3NvpYh9W/Lj62duw7nYvM=; b=lqDsGjxJMKFTy+djRWhZe8SAwdftrzl0V74taXZHxUtvUODNKNm4mOfYtI/+inn4/m nKCu6IUuIVvWH7arhnbo7uwimcC2jsHCY4/p7ymHtrh78J9aBzkNVM02U9iQAXLSM7X/ BKonI1VYahj/dA4FWKVcBxV7KfwQ8OZOfiLX6w6IqWLYbs400ufi37nwjkvsel4Fw6de jaNQjl8+BaWsVmgoRZiMOUFdG3vEVqrZZxIYFcU5QUj6ytV62HDtZBhznl8Y9rvecIhi /BQDEdWEA3CtPoCgUM7Nit3F9x6D12HSsWfyXxFGYH9Fx23y0Bet6Z1l3sudd8XXBFd5 TgOg== X-Gm-Message-State: AOJu0YxMRZ97ODGpOHGjt8nHB8jRlGyHmxzCgflxxDTQziaSVym49y6M A7VHHaeU9ItmWYm/Hm3PIiiGojAtGPHT/9NW3In3BkJLyGDzK3IGuAp0kg== X-Google-Smtp-Source: AGHT+IG3Hu5MhTaanA0xvfoN0Z7Du6yWNI/qw0mB5mUqlq1Ju1Ok6QEWS5oiHD8wxl2BHvdUW2PIZg== X-Received: by 2002:a17:90b:1350:b0:2e0:9a63:9017 with SMTP id 98e67ed59e1d1-2e94c2e2108mr25169511a91.23.1730832360417; Tue, 05 Nov 2024 10:46:00 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::ba3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa0ed5esm12526670a91.2.2024.11.05.10.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 10:46:00 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Markus Volk , Khem Raj Subject: [PATCH 19/19] mesa: add support for rusticl Date: Tue, 5 Nov 2024 10:45:38 -0800 Message-ID: <20241105184540.3450302-19-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com> References: <20241105184540.3450302-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Nov 2024 18:46:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206747 From: Markus Volk Signed-off-by: Markus Volk Signed-off-by: Khem Raj --- ...n.build-workaround-for-rusticl-build.patch | 27 +++++++++++ ...6da9458c9d0348f2390dc0bea67cf140b1a0.patch | 47 +++++++++++++++++++ meta/recipes-graphics/mesa/mesa.inc | 33 +++++++++---- 3 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch create mode 100644 meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch diff --git a/meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch b/meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch new file mode 100644 index 00000000000..9c953f961d0 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch @@ -0,0 +1,27 @@ +From b34ee4014ee9e3466ebafbd53745d9f9a13379da Mon Sep 17 00:00:00 2001 +From: Markus Volk +Date: Thu, 11 Jul 2024 22:52:16 +0200 +Subject: [PATCH] rusticl/meson.build: workaround for rusticl build + +Signed-off-by: Markus Volk + +Upstream-Status: Inappropriate [oe-specific] +--- + src/gallium/frontends/rusticl/meson.build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build +index eef09d8f01e..efac4cab964 100644 +--- a/src/gallium/frontends/rusticl/meson.build ++++ b/src/gallium/frontends/rusticl/meson.build +@@ -211,6 +211,7 @@ rusticl_llvm_bindings_rs = rust.bindgen( + c_args : [ + rusticl_bindgen_c_args, + pre_args, ++ '-I@include@', '-I@include_cpp@', '-I@include_cpp_target_sys@' + ], + dependencies : [ + dep_clang, +-- +2.45.2 + diff --git a/meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch b/meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch new file mode 100644 index 00000000000..9c5c9c75ffb --- /dev/null +++ b/meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch @@ -0,0 +1,47 @@ +From 93e96da9458c9d0348f2390dc0bea67cf140b1a0 Mon Sep 17 00:00:00 2001 +From: Karol Herbst +Date: Sun, 18 Aug 2024 00:08:50 +0200 +Subject: [PATCH] rusticl: do not use CL vector types in bindings and code + +Bindgen seems to miscompile them and I kinda thought I've done this +already in the past, but apparently not. + +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11722 +Part-of: + +Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/93e96da9458c9d0348f2390dc0bea67cf140b1a0] + +Signed-off-by: Markus Volk +--- + src/gallium/frontends/rusticl/api/device.rs | 2 +- + src/gallium/frontends/rusticl/meson.build | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/gallium/frontends/rusticl/api/device.rs b/src/gallium/frontends/rusticl/api/device.rs +index 9793092db5ad4..c1cb7902e0371 100644 +--- a/src/gallium/frontends/rusticl/api/device.rs ++++ b/src/gallium/frontends/rusticl/api/device.rs +@@ -196,7 +196,7 @@ impl CLInfo for cl_device_id { + // TODO proper retrival from devices + CL_DEVICE_MEM_BASE_ADDR_ALIGN => cl_prop::(0x1000), + CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE => { +- cl_prop::(size_of::() as cl_uint) ++ cl_prop::(16 * size_of::() as cl_uint) + } + CL_DEVICE_NAME => cl_prop::<&str>(&dev.screen().name()), + CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR => cl_prop::(1), +diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build +index 612e47bfe88e1..1fe75a611444d 100644 +--- a/src/gallium/frontends/rusticl/meson.build ++++ b/src/gallium/frontends/rusticl/meson.build +@@ -146,6 +146,7 @@ rusticl_opencl_bindings_rs = rust.bindgen( + '--raw-line', 'unsafe impl std::marker::Send for _cl_image_desc {}', + '--raw-line', 'unsafe impl std::marker::Sync for _cl_image_desc {}', + '--allowlist-type', 'cl_.*', ++ '--blocklist-type', '(__)?cl_.*[2348(16)]', + '--allowlist-type', 'cl.*_fn', + '--allowlist-var', 'CL_.*', + # needed for gl_sharing extension +-- +GitLab + diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index ecea7e94de8..04dec3fddc8 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -17,6 +17,8 @@ PE = "2" SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\ + file://0001-rusticl-meson.build-workaround-for-rusticl-build.patch \ + file://93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch \ " SRC_URI[sha256sum] = "fd077d3104edbe459e2b8597d2757ec065f9bd2d620b8c0b9cc88c2bf9891d02" @@ -35,7 +37,7 @@ do_install:append() { } DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native python3-pyyaml-native gettext-native" -DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}" +DEPENDS:append:class-target = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ' mesa-native gcc-runtime', '', d)}" EXTRANATIVEPATH += "chrpath-native" PROVIDES = " \ ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ @@ -46,7 +48,7 @@ PROVIDES = " \ virtual/mesa \ " -inherit meson pkgconfig python3native gettext features_check +inherit rust meson pkgconfig python3native gettext features_check BBCLASSEXTEND = "native nativesdk" @@ -73,8 +75,14 @@ EXTRA_OEMESON = " \ -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ " -EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}" -EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled -Dinstall-intel-clc=true', '', d)}" +EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', '-Dintel-clc=system', '', d)}" +EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', '-Dintel-clc=enabled -Dinstall-intel-clc=true -Dgallium-rusticl=false', '', d)}" + +do_configure:prepend() { + sed -i "s|@include@|${STAGING_INCDIR}|" ${S}/src/gallium/frontends/rusticl/meson.build + sed -i "s|@include_cpp@|${STAGING_INCDIR}\/c++\/14.2.0|" ${S}/src/gallium/frontends/rusticl/meson.build + sed -i "s|@include_cpp_target_sys@|${STAGING_INCDIR}\/c++\/14.2.0\/${TARGET_SYS}|" ${S}/src/gallium/frontends/rusticl/meson.build +} def strip_comma(s): return s.strip(',') @@ -104,10 +112,10 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence" # Vulkan drivers need dri3 enabled # amd could be enabled as well but requires gallium-llvm with llvm >= 3.9 VULKAN_DRIVERS = "" -VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains('PACKAGECONFIG', ',opencl', ',intel', '', d)},intel_hasvk,amd" -VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd" +VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd" +VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd" # i686 is a 32 bit override for mesa-native -VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd" +VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}" @@ -141,8 +149,10 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2 # "egl" requires "opengl" PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" -# "opencl" requires libclc from meta-clang -PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native" +# "opencl-clover" requires libclc from meta-clang +PACKAGECONFIG[opencl-clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native" +# "opencl-rusticl" requires libclc, bindgen-cli and clang from meta-clang +PACKAGECONFIG[opencl-rusticl] = "-Dgallium-rusticl=true,-Dgallium-rusticl=false,libclc bindgen-cli-native python3-ply-native clang" PACKAGECONFIG[broadcom] = "" PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native" @@ -164,7 +174,7 @@ GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',fre GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}" -GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',iris', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',iris', '', d)}" # radeonsi requires LLVM GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}" @@ -239,6 +249,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \ libgles2-mesa libgles2-mesa-dev \ libgles3-mesa libgles3-mesa-dev \ libopencl-mesa libopencl-mesa-dev \ + libopencl-rusticl libopencl-rusticl-dev \ libxatracker libxatracker-dev \ mesa-megadriver mesa-vulkan-drivers \ mesa-vdpau-drivers mesa-gallium-drivers mesa-tools \ @@ -333,6 +344,7 @@ FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*" FILES:libgl-mesa = "${libdir}/libGL.so.*" FILES:libglx-mesa = "${libdir}/libGLX*.so.*" FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd" +FILES:libopencl-rusticl = "${libdir}/libRusticlOpenCL.so.* ${sysconfdir}/OpenCL/vendors/rusticl.icd" FILES:libglapi = "${libdir}/libglapi.so.*" FILES:libosmesa = "${libdir}/libOSMesa.so.*" FILES:libxatracker = "${libdir}/libxatracker.so.*" @@ -347,6 +359,7 @@ FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/p FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" FILES:libgles3-mesa-dev = "${includedir}/GLES3" FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so" +FILES:libopencl-rusticl-dev = "${libdir}/libRusticlOpenCL.so" FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc" FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \ ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \