├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── yoe.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── COPYING.MIT ├── README.md ├── SECURITY ├── _config.yml ├── classes ├── clang-native.bbclass ├── clang.bbclass └── scan-build.bbclass ├── conf ├── layer.conf ├── nonclangable.conf └── nonscanable.conf ├── dynamic-layers ├── meta-python │ └── recipes-devtools │ │ ├── bcc │ │ ├── bcc │ │ │ ├── 0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch │ │ │ ├── 0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch │ │ │ ├── 0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch │ │ │ ├── bpf_stack_id.patch │ │ │ ├── ptest_wrapper.sh │ │ │ └── run-ptest │ │ └── bcc_0.33.0.bb │ │ └── bpftrace │ │ ├── bpftrace │ │ ├── 0001-Fix-build-failures-due-to-missing-location.hh.patch │ │ ├── 0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch │ │ └── run-ptest │ │ └── bpftrace_0.23.0.bb ├── networking-layer │ └── recipes-connectivity │ │ └── samba │ │ ├── files │ │ └── fix_duplicate_pdb_search_init.patch │ │ └── samba_4.%.bbappend ├── openembedded-layer │ ├── recipes-devtools │ │ └── bpftool │ │ │ └── bpftool.bbappend │ └── recipes-kernel │ │ └── kernel-selftest │ │ └── kernel-selftest.bbappend ├── qt5-layer │ └── recipes-qt │ │ └── qt5 │ │ └── qtpdf_%.bbappend └── qt6-layer │ └── recpes-qt │ └── qt6 │ ├── qtbase_%.bbappend │ └── qtwebengine_%.bbappend ├── images └── Yocto_Project™_Badge_Compatible_Web_RGB.png ├── recipes-connectivity └── openssl │ └── openssl_%.bbappend ├── recipes-core ├── busybox │ ├── busybox │ │ └── clang.cfg │ └── busybox_1.%.bbappend ├── glib-2.0 │ ├── glib-2.0 │ │ └── 0001-Ignore-clang-warning-for-function-signature-match.patch │ └── glib-2.0_%.bbappend ├── meta │ ├── clang-environment.inc │ ├── meta-environment-extsdk.bbappend │ └── meta-environment.bbappend ├── musl │ └── musl_%.bbappend ├── ncurses │ └── ncurses_%.bbappend └── packagegroups │ ├── nativesdk-packagegroup-sdk-host.bbappend │ ├── packagegroup-core-buildessential.bbappend │ ├── packagegroup-core-standalone-sdk-target.bbappend │ └── packagegroup-cross-canadian.bbappend ├── recipes-devtools ├── castxml │ └── castxml_0.6.11.bb ├── clang │ └── common.inc ├── gdb │ ├── gdb │ │ └── 0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch │ └── gdb_%.bbappend ├── include-what-you-use │ └── include-what-you-use_0.23.bb ├── python │ ├── python3-cffi_%.bbappend │ └── python3_%.bbappend ├── rpm │ └── rpm_%.bbappend ├── rust │ ├── rust-llvm_%.bbappend │ └── rust_%.bbappend └── valgrind │ └── valgrind_%.bbappend ├── recipes-extended ├── ghostscript │ └── ghostscript_%.bbappend └── mdadm │ └── mdadm_%.bbappend ├── recipes-multimedia ├── ffmpeg │ ├── ffmpeg │ │ └── clang_mips64.patch │ └── ffmpeg_%.bbappend ├── gstreamer │ ├── gstreamer1.0-libav │ │ └── 0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch │ └── gstreamer1.0-libav_%.bbappend └── libvorbis │ └── libvorbis_%.bbappend ├── recipes-support └── libunwind │ └── libunwind_%.bbappend └── scripts └── devtool-clang.sh /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @kraj 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | ### Contributor checklist 3 | 4 | - [ ] Changes have been tested 5 | - [ ] `Signed-off-by` is present 6 | - [ ] The PR complies with the [Open Embedded Commit Patch Message Guidelines](http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines) 7 | 8 | ### Reviewer Guidelines 9 | - When submitting a review, please pick: 10 | - '*Approve*' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved). 11 | - '*Request Changes*' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc). 12 | - '*Comment*' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment) 13 | -------------------------------------------------------------------------------- /.github/workflows/yoe.yml: -------------------------------------------------------------------------------- 1 | name: Yoe Distro CI 2 | 3 | on: 4 | # Trigger the workflow on push or pull request, 5 | # but only for the master branch 6 | push: 7 | branches: 8 | - master 9 | pull_request: 10 | branches: 11 | - master 12 | jobs: 13 | build: 14 | name: Yoe Build 15 | runs-on: [self-hosted, Linux] 16 | timeout-minutes: 720 17 | steps: 18 | - name: Fetch Repo Name 19 | id: repo-name 20 | run: echo "value=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_OUTPUT 21 | - name: Checkout 22 | uses: actions/checkout@v4 23 | with: 24 | fetch-depth: 0 25 | submodules: recursive 26 | - name: checkout yoe 27 | run: | 28 | git clone --recurse-submodules -j8 -b master https://github.com/YoeDistro/yoe-distro.git yoe 29 | cd yoe 30 | git checkout master 31 | git pull 32 | git submodule update --recursive --init 33 | rm -rf sources/${{ steps.repo-name.outputs.value }}/* 34 | rsync -av --progress --exclude="yoe" --exclude=".git" `pwd`/../ sources/${{ steps.repo-name.outputs.value }}/ 35 | - name: Setup 36 | run: | 37 | cd yoe 38 | export DOCKER_REPO=none 39 | export LANG=en_US.UTF-8 40 | export SSTATE_CACHE_DIR=/scratch/sstate-cache 41 | echo export DOCKER_REPO=none > local.sh 42 | echo export LANG=en_US.UTF-8 >> local.sh 43 | echo export SSTATE_CACHE_DIR=/scratch/sstate-cache >> local.sh 44 | cp conf/local.conf.sample conf/local.conf 45 | echo SSTATE_DIR = \"$SSTATE_CACHE_DIR\" >> conf/local.conf 46 | echo IMAGE_CLASSES += \"testimage testsdk\" >> conf/local.conf 47 | echo INHERIT += \"report-error rm_work\" >> conf/local.conf 48 | echo ERR_REPORT_SERVER = \"errors.yoctoproject.org\" >> conf/local.conf 49 | echo ERR_REPORT_PORT = \"80\" >> conf/local.conf 50 | echo ERR_REPORT_USERNAME = \"Yoe Distro CI\" >> conf/local.conf 51 | echo ERR_REPORT_EMAIL = \"info@yoedistro.org\" >> conf/local.conf 52 | echo TOOLCHAIN = \"clang\" >> conf/local.conf 53 | echo BB_NUMBER_THREADS = \"16\" >> conf/local.conf 54 | echo PARALLEL_MAKE = \"-j 32\" >> conf/local.conf 55 | echo ZSTD_THREADS = \"8\" >> conf/local.conf 56 | echo XZ_THREADS = \"8\" >> conf/local.conf 57 | echo XZ_MEMLIMIT = \"20%\" >> conf/local.conf 58 | echo CLANGSDK = \"1\" >> conf/local.conf 59 | echo IMAGE_INSTALL:append = \" clang \" >> conf/local.conf 60 | echo SDKMACHINE = \"aarch64\" >> conf/local.conf 61 | /bin/bash -c "sed -i -e 's/PACKAGE_FEED_URI.*$//' conf/site.conf" 62 | /bin/bash -c "sed -i -e 's/SDK_UPDATE_URL.*$//' conf/site.conf" 63 | - name: Build Image 64 | run: | 65 | cd yoe 66 | /bin/bash -c ". ./envsetup.sh qemuarm64 && bitbake yoe-kiosk-image yoe-sdk-image yoe-debug-image" 67 | - name: Build SDK 68 | run: | 69 | cd yoe 70 | /bin/bash -c ". ./envsetup.sh qemuarm64 && bitbake yoe-debug-image -cpopulate_sdk_ext" 71 | - name: Test Image 72 | run: | 73 | cd yoe 74 | export DISPLAY=":0" 75 | echo TESTIMAGE_AUTO:qemuall = \"1\" >> conf/local.conf 76 | /bin/bash -c ". ./envsetup.sh qemuarm64 && bitbake yoe-sdk-image" 77 | - name: Prepare results 78 | run: | 79 | cd yoe 80 | /bin/bash -c ". ./envsetup.sh qemuarm64 && resulttool report build/tmp/log/oeqa" 81 | - name: Clean shared state 82 | run: | 83 | cd yoe 84 | /bin/bash -c ". ./envsetup.sh qemuarm64 && ./sources/poky/scripts/sstate-cache-management.py -d --remove-orphans -y " 85 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.patch 2 | *.swp 3 | *.orig 4 | *.rej 5 | *~ 6 | 7 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at raj.khem@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing 3 | 4 | You are encouraged to follow Github Pull request workflow 5 | to share changes and following commit message guidelines are recommended [OE patch guidelines](https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines) 6 | 7 | Layer Maintainer: [Khem Raj]() 8 | -------------------------------------------------------------------------------- /COPYING.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Yoe Distro CI](https://github.com/kraj/meta-clang/workflows/Yoe%20Distro%20CI/badge.svg?branch=master)](https://github.com/kraj/meta-clang/actions/workflows/yoe.yml?query=workflow%3AYoe+branch%3Amaster) 2 | 3 | 4 | 6 | 7 |
Yocto Project Layer Compatible
8 | 9 | # meta-clang (C/C++ frontend and LLVM compiler backend) 10 | 11 | This layer provides [clang/llvm](http://clang.llvm.org/) as alternative to system 12 | C/C++ compiler for OpenEmbedded/Yocto Project based distributions. This can cohabit 13 | with GNU compiler and can be used for specific recipes or full system compiler. 14 | 15 | # Getting Started 16 | 17 | ```shell 18 | git clone https://github.com/openembedded/openembedded-core.git 19 | cd openembedded-core 20 | git clone https://github.com/openembedded/bitbake.git 21 | git clone https://github.com/kraj/meta-clang.git 22 | 23 | $ . ./oe-init-build-env 24 | ``` 25 | If using poky ( Yocto project reference Distribution ) 26 | 27 | ```shell 28 | git clone https://git.yoctoproject.org/git/poky 29 | cd poky 30 | git clone https://github.com/kraj/meta-clang.git 31 | 32 | $ . ./oe-init-build-env 33 | ``` 34 | 35 | Add meta-clang overlay 36 | ``` 37 | bitbake-layers add-layer ../meta-clang 38 | ``` 39 | 40 | Check `conf/bblayers.conf` to see that meta-clang is added to layer mix e.g. 41 | 42 | # Default Compiler 43 | 44 | Note that by default gcc will remain the system compiler, however if you wish 45 | clang to be the default compiler then set 46 | 47 | ```shell 48 | TOOLCHAIN ?= "clang" 49 | ``` 50 | 51 | in `local.conf`, this would now switch default cross-compiler to be clang 52 | you can select clang per recipe too by writing bbappends for them containing 53 | 54 | ```shell 55 | TOOLCHAIN = "clang" 56 | ``` 57 | also look at `conf/nonclangable.conf` for list of recipes which do not yet fully 58 | build with clang. 59 | 60 | # Providing LLVM 61 | 62 | clang recipes can provide llvm and related packages too, it might be worth using single 63 | provider for llvm and clang to save some compile time and space, select the knobs 64 | to point to clang, default is to use the version provided by core layer. 65 | 66 | ```shell 67 | PREFERRED_PROVIDER_llvm = "clang" 68 | PREFERRED_PROVIDER_llvm-native = "clang-native" 69 | PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang" 70 | PROVIDES:pn-clang = "llvm" 71 | PROVIDES:pn-clang-native = "llvm-native" 72 | PROVIDES:pn-nativesdk-clang = "nativesdk-llvm" 73 | ``` 74 | # Default Compiler Runtime 75 | 76 | Default is to use GNU runtime `TC_CXX_RUNTIME = "gnu"` which consists of libgcc, libstdc++ to provide C/C++ 77 | runtime support. However it's possible to use LLVM runtime to replace it where 78 | compile-rt, llvm libunwind, and libc++ are used to provide C/C++ runtime, while 79 | GNU runtime works with both GCC and Clang, LLVM runtime is only tested with Clang 80 | compiler, switching to use LLVM runtime is done via a config metadata knob 81 | 82 | ```shell 83 | TC_CXX_RUNTIME = "llvm" 84 | ``` 85 | 86 | TC_CXX_RUNTIME variable influences individual runtime elements and can be set explicitly as well 87 | e.g. `LIBCPLUSPLUS` `COMPILER_RT` and `UNWINDLIB`. 88 | 89 | Please note that this will still use crt files from GNU compiler always, while llvm now 90 | do provide crt files, they have not been yet integrated into the toolchain. 91 | 92 | # Default C++ Standard Library Switch 93 | 94 | Using TC_CXX_RUNTIME variable will select which C++ runtime is used, however it can be overridden 95 | if needed to by modifying `LIBCPLUSPLUS` variable, usually defaults used by `TC_CXX_RUNTIME` are 96 | best fit. e.g. below we select LLVM C++ as default C++ runtime. 97 | 98 | ```shell 99 | LIBCPLUSPLUS = "-stdlib=libc++" 100 | ``` 101 | 102 | in `local.conf`. 103 | You can select libstdc++ per package too by writing bbappends for them containing 104 | 105 | ```shell 106 | LIBCPLUSPLUS:toolchain-clang:pn- = "-stdlib=libc++" 107 | ``` 108 | Defaults are chosen to be GNU for maximum compatibility with existing GNU systems. It's always 109 | good to use single runtime on a system, mixing runtimes can cause complications during 110 | compilation as well as runtime. However, it's up to distribution policies to decide which runtime 111 | to use. 112 | 113 | # Adding clang in generated SDK toolchain 114 | 115 | Clang based cross compiler is not included into the generated SDK using `bitbake meta-toolchain` or 116 | `bitbake -cpopulate_sdk ` if clang is expected to be part of SDK, add `CLANGSDK = "1"` 117 | in `local.conf` 118 | 119 | ```shell 120 | CLANGSDK = "1" 121 | ``` 122 | 123 | # Kernel build with clang 124 | Newer kernels and Android kernels support clang compilation, and even support LTO, The following takes [rockchip](https://github.com/JeffyCN/meta-rockchip)'s kernel as an example to configure clang compilation. x86, arm and arm64 kernel supported full LLVM toolchain, other arch only support clang. more info https://docs.kernel.org/kbuild/llvm.html 125 | 126 | - linux-rockchip_%bbappend 127 | ```shell 128 | TOOLCHAIN:forcevariable = "clang" 129 | 130 | DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}" 131 | KERNEL_CC:toolchain-clang = "${CCACHE}clang ${HOST_CC_KERNEL_ARCH} -fuse-ld=lld ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}" 132 | KERNEL_LD:toolchain-clang = "${CCACHE}ld.lld" 133 | KERNEL_AR:toolchain-clang = "${CCACHE}llvm-ar" 134 | ``` 135 | if you want use LLVM integrated assembler for some older kernel, newer vesion is enabled default. 136 | ```shell 137 | do_compile:prepend:toolchain-clang() { 138 | export LLVM_IAS=1 139 | } 140 | 141 | do_compile_kernelmodules:prepend:toolchain-clang() { 142 | export LLVM_IAS=1 143 | } 144 | ``` 145 | if you want enable LTO, append follow content. 146 | ``` 147 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 148 | SRC_URI:append:toolchain-clang = "\ 149 | file://lto.cfg \ 150 | " 151 | ``` 152 | 153 | `CONFIG_LTO_CLANG`is need for some android based kernel, mainline kernel will do auto detect. 154 | 155 | - lto.cfg 156 | ``` 157 | CONFIG_LTO_CLANG=y 158 | CONFIG_LTO=y 159 | CONFIG_LTO_CLANG_THIN=y 160 | ``` 161 | 162 | 163 | # Building 164 | 165 | Below we build for qemuarm machine as an example 166 | 167 | ```shell 168 | $ MACHINE=qemuarm bitbake core-image-full-cmdline 169 | ``` 170 | # Running 171 | 172 | ```shell 173 | $ runqemu nographic 174 | ``` 175 | 176 | # Limitations 177 | 178 | Few components do not build with clang, if you have a component to add to that list 179 | simply add it to `conf/nonclangable.inc` e.g. 180 | 181 | ```shell 182 | TOOLCHAIN:pn- = "gcc" 183 | ``` 184 | 185 | and OE will start using gcc to cross compile that recipe. 186 | 187 | If a component does not build with libc++, you can add it to `conf/nonclangable.inc` e.g. 188 | 189 | ```shell 190 | CXX:remove:pn-:toolchain-clang = " -stdlib=libc++ " 191 | ``` 192 | 193 | # compiler-rt failing in do_configure with custom TARGET_VENDOR 194 | 195 | If your DISTRO sets its own value of TARGET_VENDOR, then it needs to be added in 196 | CLANG_EXTRA_OE_VENDORS, it should be done automatically, but if compiler-rt fails 197 | like bellow, then check the end of work-shared/llvm-project-source-12.0.0-r0/temp/log.do_patch 198 | it should have a line like: 199 | NOTE: Adding support following TARGET_VENDOR values: foo in 200 | /OE/build/oe-core/tmp-glibc/work-shared/llvm-project-source-12.0.0-r0/git/llvm/lib/Support/Triple.cpp and 201 | /OE/build/oe-core/tmp-glibc/work-shared/llvm-project-source-12.0.0-r0/git/clang/lib/Driver/ToolChains/Gnu.cpp 202 | and check these files if //CLANG_EXTRA_OE_VENDORS* strings were replaced correctly. 203 | Read add_distro_vendor function in recipes-devtools/clang/llvm-project-source.inc for more details. 204 | 205 | http://errors.yoctoproject.org/Errors/Details/574365/ 206 | ```shell 207 | -- Found assembler: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang 208 | -- Detecting C compiler ABI info 209 | -- Detecting C compiler ABI info - failed 210 | -- Check for working C compiler: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang 211 | -- Check for working C compiler: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang - broken 212 | CMake Error at TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message): 213 | The C compiler 214 | 215 | "TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang" 216 | 217 | is not able to compile a simple test program. 218 | 219 | It fails with the following output: 220 | 221 | Change Dir: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/build/CMakeFiles/CMakeTmp 222 | 223 | Run Build Command(s):ninja cmTC_928f4 && [1/2] Building C object CMakeFiles/cmTC_928f4.dir/testCCompiler.c.o 224 | [2/2] Linking C executable cmTC_928f4 225 | ``` 226 | 227 | # Dependencies 228 | 229 | ```shell 230 | URI: https://github.com/openembedded/openembedded-core.git 231 | branch: master 232 | revision: HEAD 233 | 234 | URI: ghttps://github.com/openembedded/bitbake.git 235 | branch: master 236 | revision: HEAD 237 | ``` 238 | # Using Devtool and Upstream Development 239 | 240 | All LLVM based recipes use single llvm source directory, As a LLVM 241 | developer, you might want to work on your own repository to build 242 | related recipes, devtool can we useful in establishing such a workflow 243 | there is a script provided `scripts/devtool-clang.sh` which can assist 244 | in setting up all the recipes to use custom LLVM repository, in order 245 | to setup repository make sure that it has all the needed patches applied 246 | or else it will fail to build. Such a tree is already prepared and kept 247 | in sync at 248 | 249 | https://github.com/kraj/llvm-project 250 | 251 | There are branches under `oe` namespace which carry the needed OE patches 252 | 253 | ``` 254 | cd $TOPDIR/workspace/sources 255 | git clone https://github.com/kraj/llvm-project -b oe/main llvm-project 256 | ``` 257 | 258 | Once project is setup and meta-clang is added, run `devtool-clang.sh` 259 | script which will do the needed for setting up external sources for the 260 | yocto recipes, now yocto will use custom LLVM tree for its needs. 261 | 262 | # Contributing 263 | 264 | You are encouraged to follow Github Pull request workflow 265 | to share changes and following commit message guidelines are recommended: [OE patch guidelines](https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines). 266 | 267 | Layer Maintainer: [Khem Raj]() 268 | -------------------------------------------------------------------------------- /SECURITY: -------------------------------------------------------------------------------- 1 | How to Report a Potential Vulnerability? 2 | ======================================== 3 | 4 | If you would like to report a public issue (for example, one with a released 5 | CVE number), please report it via Github issues: 6 | 7 | https://github.com/kraj/meta-clang/issues/new/choose 8 | 9 | If you are dealing with a not-yet released or urgent issue, please send a 10 | message to one of the maintainers listed in the README. Include as many 11 | details as possible: 12 | - the layer or software module affected 13 | - the recipe and its version 14 | - any example code, if available 15 | 16 | Branches maintained with security fixes 17 | --------------------------------------- 18 | 19 | See https://wiki.yoctoproject.org/wiki/Releases for the list of current 20 | releases. We only accept patches for the LTS releases and the master branch. 21 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /classes/clang-native.bbclass: -------------------------------------------------------------------------------- 1 | # inherit this class if you would like to use clang to compile the native 2 | # version of your recipes instead of system compiler ( which is normally gcc ) 3 | # on build machines 4 | # to use it add 5 | # 6 | # inherit clang-native 7 | # 8 | # to the concerned recipe via a bbappend or directly to recipe file 9 | # 10 | DEPENDS:append:runtime-llvm = " clang-native compiler-rt-native libcxx-native" 11 | # Use libcxx headers for native parts 12 | CXXFLAGS:append:runtime-llvm = " -stdlib=libc++" 13 | BUILD_CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" 14 | # Use libgcc for native parts 15 | LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" 16 | BUILD_LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" 17 | BUILD_CC:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE}" 18 | BUILD_CXX:runtime-llvm = "${CCACHE}clang++ -isysroot=${STAGING_DIR_NATIVE}" 19 | BUILD_CPP:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE} -E" 20 | BUILD_CCLD:runtime-llvm = "${CCACHE}clang" 21 | BUILD_RANLIB:runtime-llvm = "llvm-ranlib" 22 | BUILD_AR:runtime-llvm = "llvm-ar" 23 | BUILD_NM:runtime-llvm = "llvm-nm" 24 | -------------------------------------------------------------------------------- /classes/clang.bbclass: -------------------------------------------------------------------------------- 1 | # Add the necessary override 2 | CCACHE_COMPILERCHECK:toolchain-clang ?= "%compiler% -v" 3 | HOST_CC_ARCH:prepend:toolchain-clang:class-target = "-target ${HOST_SYS} " 4 | HOST_CC_ARCH:prepend:toolchain-clang:class-nativesdk = "-target ${HOST_SYS} " 5 | CC:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 6 | CXX:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 7 | CPP:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E" 8 | CCLD:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 9 | RANLIB:toolchain-clang = "${HOST_PREFIX}llvm-ranlib" 10 | AR:toolchain-clang = "${HOST_PREFIX}llvm-ar" 11 | NM:toolchain-clang = "${HOST_PREFIX}llvm-nm" 12 | OBJDUMP:toolchain-clang = "${HOST_PREFIX}llvm-objdump" 13 | OBJCOPY:toolchain-clang = "${HOST_PREFIX}llvm-objcopy" 14 | STRIP:toolchain-clang = "${HOST_PREFIX}llvm-strip" 15 | STRINGS:toolchain-clang = "${HOST_PREFIX}llvm-strings" 16 | READELF:toolchain-clang = "${HOST_PREFIX}llvm-readelf" 17 | 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)}" 18 | 19 | LTO:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}" 20 | 21 | COMPILER_RT ??= "" 22 | COMPILER_RT:class-native = "-rtlib=libgcc ${UNWINDLIB}" 23 | COMPILER_RT:armeb = "-rtlib=libgcc ${UNWINDLIB}" 24 | COMPILER_RT:libc-klibc = "-rtlib=libgcc ${UNWINDLIB}" 25 | 26 | UNWINDLIB ??= "" 27 | UNWINDLIB:class-native = "--unwindlib=libgcc" 28 | UNWINDLIB:armeb = "--unwindlib=libgcc" 29 | UNWINDLIB_libc-klibc = "--unwindlib=libgcc" 30 | 31 | LIBCPLUSPLUS ??= "" 32 | LIBCPLUSPLUS:armv5 = "-stdlib=libstdc++" 33 | 34 | CXXFLAGS:append:toolchain-clang = " ${LIBCPLUSPLUS}" 35 | LDFLAGS:append:toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}" 36 | 37 | TUNE_CCARGS:remove:toolchain-clang = "-meb" 38 | TUNE_CCARGS:remove:toolchain-clang = "-mel" 39 | TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" 40 | 41 | # Clang does not yet support big.LITTLE performance tunes, so use the LITTLE for tunes 42 | TUNE_CCARGS:remove:toolchain-clang = "\ 43 | -mcpu=cortex-a57.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \ 44 | -mcpu=cortex-a72.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \ 45 | -mcpu=cortex-a15.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \ 46 | -mcpu=cortex-a17.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \ 47 | -mcpu=cortex-a72.cortex-a35${TUNE_CCARGS_MARCH_OPTS} \ 48 | -mcpu=cortex-a73.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \ 49 | -mcpu=cortex-a75.cortex-a55${TUNE_CCARGS_MARCH_OPTS} \ 50 | -mcpu=cortex-a76.cortex-a55${TUNE_CCARGS_MARCH_OPTS}" 51 | 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)}" 52 | TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa15-cortexa7 cortexa17-cortexa7", " -mcpu=cortex-a7${TUNE_CCARGS_MARCH_OPTS}", "", d)}" 53 | TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa35", " -mcpu=cortex-a35${TUNE_CCARGS_MARCH_OPTS}", "", d)}" 54 | TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa75-cortexa55 cortexa76-cortexa55", " -mcpu=cortex-a55${TUNE_CCARGS_MARCH_OPTS}", "", d)}" 55 | 56 | # Workaround for https://github.com/llvm/llvm-project/issues/85699 57 | # needed for 64bit rpi3/rpi4 machines 58 | TUNE_CCARGS_MARCH_OPTS:append:toolchain-clang = "${@bb.utils.contains_any("DEFAULTTUNE", "cortexa72 cortexa53", "+nocrypto", "", d)}" 59 | 60 | # Clang does not support octeontx2 processor 61 | TUNE_CCARGS:remove:toolchain-clang = "-mcpu=octeontx2${TUNE_CCARGS_MARCH_OPTS}" 62 | 63 | # Reconcile some ppc anamolies 64 | TUNE_CCARGS:remove:toolchain-clang:powerpc = "-mhard-float -mno-spe" 65 | TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64 = " -mlong-double-64" 66 | TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64le = " -mlong-double-64" 67 | TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64" 68 | # usrmerge workaround 69 | TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}" 70 | 71 | TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments" 72 | 73 | LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2" 74 | LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2" 75 | LDFLAGS:append:toolchain-clang:class-nativesdk:aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1" 76 | 77 | LDFLAGS:toolchain-clang:class-nativesdk = "${BUILDSDK_LDFLAGS} \ 78 | -Wl,-rpath-link,${STAGING_LIBDIR}/.. \ 79 | -Wl,-rpath,${libdir}/.. " 80 | 81 | # Enable lld globally except for ppc32 where it causes random segfaults in Qemu usermode 82 | LDFLAGS:append:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=lld', '', d)}" 83 | LDFLAGS:remove:toolchain-clang:powerpc = "-fuse-ld=lld" 84 | 85 | # Remove gcc specific -fcanon-prefix-map option, added in gcc-13+ 86 | # clang does not support it yet 87 | DEBUG_PREFIX_MAP:remove:toolchain-clang = "-fcanon-prefix-map" 88 | 89 | # choose between 'gcc' 'clang' an empty '' can be used as well 90 | TOOLCHAIN ??= "gcc" 91 | # choose between 'gnu' 'llvm' 92 | TC_CXX_RUNTIME ??= "gnu" 93 | # Using gcc or llvm runtime is only available when using clang for compiler 94 | #TC_CXX_RUNTIME:toolchain-gcc = "gnu" 95 | TC_CXX_RUNTIME:armeb = "gnu" 96 | TC_CXX_RUNTIME:armv5 = "gnu" 97 | 98 | TOOLCHAIN:class-native = "gcc" 99 | TOOLCHAIN:class-nativesdk = "gcc" 100 | TOOLCHAIN:class-cross-canadian = "gcc" 101 | TOOLCHAIN:class-crosssdk = "gcc" 102 | TOOLCHAIN:class-cross = "gcc" 103 | 104 | OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}" 105 | OVERRIDES =. "${@['', 'runtime-${TC_CXX_RUNTIME}:']['${TC_CXX_RUNTIME}' != '']}" 106 | OVERRIDES[vardepsexclude] += "TOOLCHAIN TC_CXX_RUNTIME" 107 | 108 | YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config" 109 | YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}" 110 | 111 | #YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target[export] = "1" 112 | #YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target[export] = "1" 113 | 114 | #DEPENDS:append:toolchain-clang:class-target = " clang-cross-${TARGET_ARCH} " 115 | #DEPENDS:remove:toolchain-clang:allarch = "clang-cross-${TARGET_ARCH}" 116 | 117 | def clang_base_deps(d): 118 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): 119 | if not oe.utils.inherits(d, 'allarch') : 120 | ret = " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc " 121 | if (d.getVar('TC_CXX_RUNTIME').find('android') != -1): 122 | ret += " libcxx" 123 | return ret 124 | if (d.getVar('TC_CXX_RUNTIME').find('llvm') != -1): 125 | ret += " compiler-rt" 126 | elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): 127 | ret += " compiler-rt " 128 | else: 129 | ret += " libgcc " 130 | if (d.getVar('TC_CXX_RUNTIME').find('llvm') != -1): 131 | ret += " libcxx" 132 | elif (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): 133 | ret += " libcxx " 134 | elif (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1): 135 | ret += " libcxx " 136 | else: 137 | ret += " virtual/${MLPREFIX}compilerlibs " 138 | return ret 139 | return "" 140 | 141 | BASE_DEFAULT_DEPS:append:class-target:toolchain-clang:class-target = " ${@clang_base_deps(d)}" 142 | BASE_DEFAULT_DEPS:append:class-native:toolchain-clang:runtime-llvm = " libcxx-native compiler-rt-native" 143 | BASE_DEFAULT_DEPS:append:class-nativesdk:toolchain-clang:runtime-llvm = " clang-native nativesdk-libcxx nativesdk-compiler-rt" 144 | 145 | # do_populate_sysroot needs STRIP 146 | POPULATESYSROOTDEPS:toolchain-clang:class-target = "${MLPREFIX}clang-cross-${TARGET_ARCH}:do_populate_sysroot" 147 | 148 | cmake_do_generate_toolchain_file:append:toolchain-clang () { 149 | cat >> ${WORKDIR}/toolchain.cmake < 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | EXTRA_ANALYZER_OPTIONS += "-analyze-headers" 5 | EXTRA_ANALYZER_OPTIONS += "--force-analyze-debug-code" 6 | SCAN_BUILD ??= "1" 7 | SCAN_BUILD:class-native = "" 8 | SCAN_BUILD:class-nativesdk = "" 9 | SCAN_BUILD:class-cross = "" 10 | SCAN_BUILD:class-crosssdk = "" 11 | SCAN_BUILD:class-cross-canadian = "" 12 | 13 | CLANG_SCAN_SERVER_IP ??= "0.0.0.0" 14 | CLANG_SCAN_PORT ??= "8181" 15 | SCAN_RESULTS_DIR ?= "${TMPDIR}/static-scan/${PN}" 16 | 17 | CCSCAN ?= "${HOST_PREFIX}${TOOLCHAIN}" 18 | CXXSCAN:toolchain-clang ?= "${HOST_PREFIX}clang++" 19 | CXXSCAN:toolchain-gcc ?= "${HOST_PREFIX}g++" 20 | 21 | do_scanbuild() { 22 | rm -rf ${SCAN_RESULTS_DIR} 23 | 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} 24 | } 25 | 26 | do_scanview() { 27 | bbplain "================================================================" 28 | bbplain "Starting scan-view server at: http://${CLANG_SCAN_SERVER_IP}:${CLANG_SCAN_PORT}" 29 | bbplain "Use Ctrl-C to exit" 30 | bbplain "================================================================" 31 | scan-view --host ${CLANG_SCAN_SERVER_IP} --port ${CLANG_SCAN_PORT} --allow-all-hosts --no-browser ${SCAN_RESULTS_DIR}/*/ 32 | } 33 | 34 | do_scanview[depends] += "${PN}:do_scanbuild" 35 | do_scanbuild[depends] += "clang-native:do_populate_sysroot" 36 | #do_scanbuild[cleandirs] += "${SCAN_RESULTS_DIR}" 37 | do_scanbuild[dirs] += "${B}" 38 | do_scanview[dirs] += "${SCAN_RESULTS_DIR}" 39 | #do_build[recrdeptask] += "do_scanbuild" 40 | 41 | do_scanbuild[doc] = "Build and scan static analysis data using clang" 42 | do_scanview[doc] = "Start a webserver to visualize static analysis data" 43 | 44 | addtask scanbuild after do_configure before do_compile 45 | addtask scanview after do_scanbuild 46 | python () { 47 | # Remove scanbuild task when scanning is not enabled or recipe does not have do_configure 48 | if not(d.getVar('SCAN_BUILD') == "1") or not(d.getVar('TOOLCHAIN') == "clang") or oe.utils.inherits(d, 'allarch'): 49 | for i in ['do_scanbuild', 'do_scanview']: 50 | bb.build.deltask(i, d) 51 | else: 52 | cflags = d.getVar('CFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False) 53 | cxxflags = d.getVar('CXXFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False) 54 | d.setVar('CFLAGS', cflags) 55 | d.setVar('CXXFLAGS', cxxflags) 56 | if oe.utils.inherits(d, 'autotools'): 57 | cachedvar = d.getVar('CACHED_CONFIGUREVARS', False) 58 | cachedvar = cachedvar + " scan-build " + " --analyzer-target " + d.getVar('HOST_SYS', False) + " --use-cc " + d.getVar('CCSCAN', False) + " --use-c++ " + d.getVar('CXXSCAN', False) 59 | d.setVar('CACHED_CONFIGUREVARS', cachedvar) 60 | } 61 | -------------------------------------------------------------------------------- /conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, append to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have a recipes directory, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" 6 | 7 | BBFILE_COLLECTIONS += "clang-layer" 8 | BBFILE_PATTERN_clang-layer := "^${LAYERDIR}/" 9 | BBFILE_PRIORITY_clang-layer = "7" 10 | LAYERSERIES_COMPAT_clang-layer = "scarthgap styhead walnascar" 11 | LAYERDEPENDS_clang-layer = "core" 12 | 13 | BBFILES_DYNAMIC += " \ 14 | browser-layer:${LAYERDIR}/dynamic-layers/browser-layer/*/*.bb \ 15 | browser-layer:${LAYERDIR}/dynamic-layers/browser-layer/*/*.bbappend \ 16 | openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bb \ 17 | openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bbappend \ 18 | networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bb \ 19 | networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bbappend \ 20 | meta-python:${LAYERDIR}/dynamic-layers/meta-python/*/*/*.bb \ 21 | meta-python:${LAYERDIR}/dynamic-layers/meta-python/*/*/*.bbappend \ 22 | qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bb \ 23 | qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bbappend \ 24 | qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/*/*/*.bb \ 25 | qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/*/*/*.bbappend \ 26 | " 27 | 28 | PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial" 29 | #PREFERRED_PROVIDER_virtual/${MLPREFIX}compilerlibs:forcevariable = "libcxx" 30 | PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("TC_CXX_RUNTIME", "llvm android", "libcxx", "libunwind", d)}" 31 | INHERIT += "clang" 32 | 33 | # Do not include clang in SDK unless user wants to 34 | CLANGSDK ??= "0" 35 | 36 | LLVMVERSION = "20.1.2" 37 | 38 | NON_MULTILIB_RECIPES:append = " llvm-project-source" 39 | 40 | require conf/nonclangable.conf 41 | require conf/nonscanable.conf 42 | -------------------------------------------------------------------------------- /conf/nonclangable.conf: -------------------------------------------------------------------------------- 1 | 2 | TUNE_CCARGS:remove:toolchain-clang = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '-mbranch-protection=standard', '', d)}" 3 | 4 | # https://github.com/llvm/llvm-project/issues/78337 5 | TOOLCHAIN:pn-kernel-selftest = "gcc" 6 | 7 | # x86_64/musl build fails with 8 | # gtk4/4.12.5/build/gtk/libgtk-4.so.1: unsupported relocation type 37 9 | TOOLCHAIN:pn-gtk4:libc-musl:x86-64 = "gcc" 10 | 11 | TOOLCHAIN:pn-cpufrequtils = "gcc" 12 | 13 | TOOLCHAIN:pn-grub:genericx86-64 = "gcc" 14 | # | grub-mkimage: error: relocation 0x2b is not implemented yet. 15 | TOOLCHAIN:pn-grub-efi:aarch64 = "gcc" 16 | TOOLCHAIN:pn-grub-efi:riscv32 = "gcc" 17 | # clang-15 crashes 18 | TOOLCHAIN:pn-grub-efi:riscv64 = "gcc" 19 | TOOLCHAIN:pn-grub:riscv64 = "gcc" 20 | # | build-grub-module-verifier: error: search_label: unsupported relocation 0x108. 21 | TOOLCHAIN:pn-grub:aarch64 = "gcc" 22 | # crash embeds version of gdb which is not buildable with clang 23 | TOOLCHAIN:pn-crash = "gcc" 24 | # See https://github.com/llvm/llvm-project/issues/71925 25 | LIBCPLUSPLUS:pn-elfutils:toolchain-clang = "-stdlib=libstdc++" 26 | #| erl_bits.c:(.text+0xc2a): undefined reference to `__extendhfsf2' 27 | #| erl_bits.c:(.text+0x1bfa): undefined reference to `__truncsfhf2' 28 | #| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) 29 | # both riscv64 and x86-64 30 | TOOLCHAIN:pn-erlang = "gcc" 31 | 32 | # /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' 33 | # __ai uint8x16_t vabdq_u8(uint8x16_t __p0, uint8x16_t __p1) { 34 | TOOLCHAIN:pn-firefox = "gcc" 35 | TOOLCHAIN:pn-gcc = "gcc" 36 | TOOLCHAIN:pn-gcc-runtime = "gcc" 37 | TOOLCHAIN:pn-gcc-sanitizers = "gcc" 38 | TOOLCHAIN:pn-glibc = "gcc" 39 | TOOLCHAIN:pn-glibc-initial = "gcc" 40 | TOOLCHAIN:pn-glibc-locale = "gcc" 41 | TOOLCHAIN:pn-glibc-mtrace = "gcc" 42 | TOOLCHAIN:pn-glibc-scripts = "gcc" 43 | TOOLCHAIN:pn-glibc-testsuite = "gcc" 44 | TOOLCHAIN:pn-glibc-y2038-tests = "gcc" 45 | 46 | #| prelink-rtld: error while loading shared libraries: ld.so.1 47 | #| /lib64/ld.so.1: No such file or directory 48 | TOOLCHAIN:pn-gobject-intospection:mips64 = "gcc" 49 | TOOLCHAIN:pn-avahi:mips64 = "gcc" 50 | 51 | # VLAs 52 | #| control.c:286:19: error: fields must have a constant size: 'variable length array in structure' extension will never be supported 53 | #| __u32 buffer[cam->max_response_quads]; 54 | #| ^ 55 | #| 1 error generated. 56 | TOOLCHAIN:pn-libdc1394 = "gcc" 57 | 58 | # error: return address can be determined only for current frame 59 | TOOLCHAIN:pn-libexecinfo:mipsarch = "gcc" 60 | TOOLCHAIN:pn-libgcc = "gcc" 61 | TOOLCHAIN:pn-libgcc-initial = "gcc" 62 | TOOLCHAIN:pn-libgfortran = "gcc" 63 | TOOLCHAIN:pn-libssp-nonshared = "gcc" 64 | 65 | TOOLCHAIN:pn-m4:powerpc = "gcc" 66 | # clang does not have 64bit atomics on ppc 67 | TOOLCHAIN:pn-mesa:powerpc = "gcc" 68 | # recipe-sysroot//usr/lib/libGLESv2.so.2: unsupported relocation type 12 69 | TOOLCHAIN:pn-mesa:riscv32 = "gcc" 70 | # usr/lib/libgallium-25.0.2.so: unexpected reloc type 0x0c 71 | TOOLCHAIN:pn-mesa:riscv64 = "gcc" 72 | # clang fails with db.c:(.text+0x188): unsupported bss-plt -fPIC ifunc mmio_write64_be 73 | TOOLCHAIN:pn-rdma-core:powerpc = "gcc" 74 | # usermode qemu crashes when running binaries from clang + rust compiler on ppc32 75 | TOOLCHAIN:pn-librsvg:powerpc = "gcc" 76 | # variant-impl.hpp:309:36: error: 'is_variant' does not name a template but is followed by template arguments 77 | TOOLCHAIN:pn-omxplayer = "gcc" 78 | # error: return address can be determined only for current frame 79 | TOOLCHAIN:pn-openflow:mipsarch = "gcc" 80 | TOOLCHAIN:pn-openjdk-8 = "gcc" 81 | TOOLCHAIN:pn-openjre-8 = "gcc" 82 | TOOLCHAIN:pn-syslinux = "gcc" 83 | TOOLCHAIN:pn-systemtap = "gcc" 84 | # v4l-utils uses nested functions 85 | TOOLCHAIN:pn-v4l-utils = "gcc" 86 | # https://bugs.kde.org/show_bug.cgi?id=369723 87 | TOOLCHAIN:pn-valgrind = "gcc" 88 | 89 | TOOLCHAIN:pn-vboxguestdrivers = "gcc" 90 | # uses C++ which clang does not like 91 | TOOLCHAIN:pn-wvstreams = "gcc" 92 | TOOLCHAIN:pn-wvdial = "gcc" 93 | # 94 | #../../lib/libicui18n.so: undefined reference to `__atomic_fetch_sub_4' 95 | #../../lib/libicui18n.so: undefined reference to `__atomic_load_4' 96 | #../../lib/libicui18n.so: undefined reference to `__atomic_store_4' 97 | #../../lib/libicui18n.so: undefined reference to `__atomic_fetch_add_4' 98 | # 99 | TOOLCHAIN:pn-icu:armv4 = "gcc" 100 | TOOLCHAIN:pn-icu:armv5 = "gcc" 101 | 102 | #../../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 103 | TOOLCHAIN:pn-libgcrypt:mips64 = "gcc" 104 | 105 | #recipe-sysroot/usr/include/mozjs-60/mozilla/Span.h:634:5: error: statement not allowed in constexpr function 106 | #| MOZ_RELEASE_ASSERT(aStart <= len && (aLength == dynamic_extent || 107 | #| ^ 108 | TOOLCHAIN:pn-polkit = "gcc" 109 | 110 | # ppp uses nested functions and gcc specific option e.g. --print-sysroot 111 | # 112 | TOOLCHAIN:pn-ppp = "gcc" 113 | 114 | #| ./ports/linux/pseudo_wrappers.c:80:14: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] 115 | #| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); 116 | #| ^ 117 | #| ./ports/linux/pseudo_wrappers.c:80:57: error: use of unknown builtin '__builtin_apply_args' [-Wimplicit-function-declaration] 118 | #| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); 119 | TOOLCHAIN:pn-pseudo = "gcc" 120 | 121 | # mix_neon.c:179:9: error: invalid operand in inline asm: 'vld1.s32 ${0:h}, [$2] 122 | # vld1.s32 ${1:h}, [$3] ' 123 | TOOLCHAIN:pn-pulseaudio:armv7ve = "gcc" 124 | TOOLCHAIN:pn-pulseaudio:armv7a = "gcc" 125 | 126 | #| ./dsp/v4f_IIR2.h:554:12: error: no matching function for call to 'v4f_map' 127 | #| a[5] = v4f_map<__builtin_cosf> (f); 128 | #| ^~~~~~~~~~~~~~~~~~~~~~~ 129 | TOOLCHAIN:pn-caps = "gcc" 130 | 131 | #| ../libffi-3.3-rc0/src/arm/sysv.S: Assembler messages: 132 | #| ../libffi-3.3-rc0/src/arm/sysv.S:131: Error: selected processor does not support `vldrle d0,[sp]' in ARM mode 133 | #| ../libffi-3.3-rc0/src/arm/sysv.S:132: Error: selected processor does not support `vldmgt sp,{d0-d7}' in ARM mode 134 | TOOLCHAIN:pn-libffi:armeb = "gcc" 135 | 136 | # rocksdb/rocksdb/util/crc32c_ppc_asm.S:9:10: fatal error: 'ppc-asm.h' file not found 137 | # #include 138 | # This header is only available with gcc-cross 139 | TOOLCHAIN:pn-mariadb:powerpc64le = "gcc" 140 | 141 | # OpenCV does not compile for ppc64 with clang due to VSX clashes with altivec.h from clang 142 | TOOLCHAIN:pn-opencv:powerpc64le = "gcc" 143 | # Ade is used by openCV and shared C++ runtime so we can not mix libstdc++ and libc++ 144 | TOOLCHAIN:pn-ade:powerpc64le = "gcc" 145 | 146 | #| error: return address can be determined only for current frame 147 | #| error: return address can be determined only for current frame 148 | #| error: return address can be determined only for current frame 149 | TOOLCHAIN:pn-gcompat:mips = "gcc" 150 | 151 | # Fixes Clang induced linker crashes when using glibc 2.35+ 152 | # mips-yoe-linux/mips-yoe-linux-ld: DWARF error: invalid or unhandled FORM value: 0x22 153 | # mips-yoe-linux-ld: Zend/asm/make_mips32_o32_elf_gas.o: CALL16 reloc at 0x28 not against global symbol 154 | # mips-yoe-linux/mips-yoe-linux-ld: BFD (GNU Binutils) 2.37.20210721 assertion fail ../../bfd/elfxx-mips.c:3614 155 | TOOLCHAIN:pn-php:mips = "gcc" 156 | 157 | # Workaround oe-core patching problem temporarily 158 | TOOLCHAIN:pn-rsync = "gcc" 159 | 160 | TOOLCHAIN:pn-u-boot-at91 = "gcc" 161 | TOOLCHAIN:pn-u-boot-fslc-mfgtool = "gcc" 162 | TOOLCHAIN:pn-u-boot-fslc-mxsboot = "gcc" 163 | TOOLCHAIN:pn-u-boot-fslc = "gcc" 164 | TOOLCHAIN:pn-u-boot-imx-mfgtool = "gcc" 165 | TOOLCHAIN:pn-u-boot-imx = "gcc" 166 | TOOLCHAIN:pn-u-boot-qoriq = "gcc" 167 | TOOLCHAIN:pn-u-boot-boundary = "gcc" 168 | TOOLCHAIN:pn-u-boot-script-boundary = "gcc" 169 | TOOLCHAIN:pn-u-boot-script-qoriq = "gcc" 170 | TOOLCHAIN:pn-u-boot-script-toradex = "gcc" 171 | TOOLCHAIN:pn-u-boot-kontron = "gcc" 172 | TOOLCHAIN:pn-u-boot-variscite = "gcc" 173 | TOOLCHAIN:pn-u-boot-toradex = "gcc" 174 | TOOLCHAIN:pn-u-boot-hardkernel = "gcc" 175 | TOOLCHAIN:pn-u-boot-starfive = "gcc" 176 | TOOLCHAIN:pn-u-boot-hardkernel = "gcc" 177 | TOOLCHAIN:pn-u-boot-nezha = "gcc" 178 | TOOLCHAIN:pn-u-boot-ti-mainline = "gcc" 179 | TOOLCHAIN:pn-u-boot-ti-staging = "gcc" 180 | TOOLCHAIN:pn-u-boot-splash = "gcc" 181 | TOOLCHAIN:pn-u-boot-coral = "gcc" 182 | 183 | # See https://github.com/kraj/meta-clang/issues/696 184 | TOOLCHAIN:pn-pixman:aarch64 = "gcc" 185 | # libomp needs to link in libatomic after itself when -fopenmp is used 186 | TOOLCHAIN:pn-pixman:mipsarcho32 = "gcc" 187 | # See https://github.com/llvm/llvm-project/issues/61412 188 | TOOLCHAIN:pn-frr:riscv64 = "gcc" 189 | TOOLCHAIN:pn-frr:riscv32 = "gcc" 190 | 191 | # Tegra stuff 192 | TOOLCHAIN:pn-standalone-mm-optee-tegra:tegra = "gcc" 193 | TOOLCHAIN:pn-edk2-firmware-tegra:tegra = "gcc" 194 | TOOLCHAIN:pn-optee-os-tadevkit:tegra = "gcc" 195 | TOOLCHAIN:pn-optee-nvsamples:tegra = "gcc" 196 | TOOLCHAIN:pn-optee-os:tegra = "gcc" 197 | TOOLCHAIN:pn-libgcc-for-nvcc:tegra = "gcc" 198 | TOOLCHAIN:pn-gcc-for-nvcc-runtime:tegra = "gcc" 199 | 200 | # Does not compile with clang 18 201 | #| core/arch/arm/include/arm64.h:392:1: error: expected writable system register or pstate 202 | #| 392 | DEFINE_U32_REG_READWRITE_FUNCS(fpcr) 203 | #| | ^ 204 | TOOLCHAIN:pn-optee-os:imx-nxp-bsp = "gcc" 205 | 206 | # Fails with clang-19+ 207 | # Poco/PriorityDelegate.h:203:10: error: no member named '_pTarget' in 'PriorityDelegate' 208 | TOOLCHAIN:pn-poco = "gcc" 209 | TOOLCHAIN:pn-netdata = "gcc" 210 | # Needs OMP and with clang openmp is not ported to rv32 yet 211 | TOOLCHAIN:pn-python3-drgn:riscv32 = "gcc" 212 | 213 | # Clang-20 issue - https://github.com/llvm/llvm-project/issues/132322 214 | TOOLCHAIN:pn-webkitgtk:arm = "gcc" 215 | TOOLCHAIN:pn-webkitgtk3:arm = "gcc" 216 | 217 | # Disable clang on rv64 for now. see - https://bugs.webkit.org/show_bug.cgi?id=290243 218 | TOOLCHAIN:pn-webkitgtk:riscv64 = "gcc" 219 | TOOLCHAIN:pn-webkitgtk3:riscv64 = "gcc" 220 | 221 | # Clang can not compile vulkan-samples because fmt version is old 222 | # see - https://github.com/KhronosGroup/Vulkan-Samples/pull/1315 223 | TOOLCHAIN:pn-vulkan-samples = "gcc" 224 | 225 | CFLAGS:append:pn-liboil:toolchain-clang:x86-64 = " -fheinous-gnu-extensions " 226 | 227 | # 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 228 | # .section .init_array, "aM", @init_array 229 | # ^ 230 | CFLAGS:append:pn-gnu-efi:toolchain-clang = " -no-integrated-as" 231 | 232 | #../libffi-3.2.1/src/arm/sysv.S:363:2: error: invalid instruction, did you mean: fldmiax? 233 | # fldmiadgt ip, {d0-d7} 234 | CFLAGS:append:pn-libffi:mips64:toolchain-clang = " -no-integrated-as" 235 | 236 | # ../db-5.3.28/src/mutex/mut_tas.c:150:34: error: unknown directive 237 | #:9:2: note: instantiated into assembly here 238 | # .force_thumb 239 | # ^ 240 | #CFLAGS:append:pn-db:toolchain-clang = " -no-integrated-as" 241 | # 242 | #| ../../../DirectFB-1.7.7/lib/direct/armasm_memcpy.S:63:2: error: invalid instruction 243 | #| ldmgeia r1!, {r3, r4, r12, lr} 244 | #| ^ 245 | CFLAGS:append:pn-directfb:toolchain-clang:arm = " -no-integrated-as" 246 | 247 | #| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free' 248 | EXTRA_OECONF:pn-openssl:toolchain-clang:x86 = "-latomic" 249 | 250 | CFLAGS:append:pn-userland:toolchain-clang = " -no-integrated-as" 251 | 252 | # libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S 253 | # :13:5: error: invalid token in expression 254 | # .if $17 != 0 255 | # ^ 256 | CFLAGS:append:pn-libjpeg-turbo:toolchain-clang:mipsarch = " -no-integrated-as" 257 | 258 | # :1:41: error: expected '%' or "" 259 | # 1 | .pushsection ".debug_gdb_scripts", "MS",@progbits,1 260 | # | ^ 261 | # :318:12: error: .popsection without corresponding .pushsection 262 | # 318 | .popsection 263 | # | ^ 264 | CXXFLAGS:append:pn-boost:toolchain-clang:arm = " -no-integrated-as" 265 | 266 | #| /tmp/x86-sse2-cdb148.s:207:9: error: ambiguous operand size for instruction 'sub' 267 | #| sub SIZE, 64 268 | #| ^~~~ 269 | CFLAGS:append:pn-tinymembench:toolchain-clang:x86-64 = " -no-integrated-as" 270 | CFLAGS:append:pn-tinymembench:toolchain-clang:x86 = " -no-integrated-as" 271 | CFLAGS:append:pn-tinymembench:toolchain-clang:mipsarch = " -no-integrated-as" 272 | 273 | CFLAGS:append:pn-ne10:toolchain-clang:arm = " -no-integrated-as" 274 | CFLAGS:append:pn-libde265:toolchain-clang:arm = " -no-integrated-as" 275 | 276 | #2816:2: error: changed section type for .debug_frame, expected: 0x7000001E 277 | # .section .debug_frame,"",@progbits 278 | # ^ 279 | #lj_vm.S:2890:2: error: changed section flags for .eh_frame, expected: 0x2 280 | # .section .eh_frame,"aw",@progbits 281 | # ^ 282 | CFLAGS:append:pn-luajit:toolchain-clang:mips = " -no-integrated-as" 283 | 284 | # uftrace/0.15.2/git/arch/aarch64/dynamic.S:92:2: error: instruction requires: fp-armv8 285 | CFLAGS:append:pn-uftrace:toolchain-clang:aarch64 = " -no-integrated-as" 286 | 287 | #FAILED: libucontext_posix.so.1 288 | #clang-13: error: unable to execute command: Segmentation fault (core dumped) 289 | #clang-13: error: linker command failed due to signal (use -v to see invocation) 290 | CFLAGS:append:pn-libucontext:toolchain-clang:powerpc64le = " -no-integrated-as" 291 | 292 | # Generated asm file can not be compiled with clang assembler due to presence of .0 label 293 | # and its references 294 | #| aes-decrypt-internal-2.s:368:1: error: unexpected token at start of statement 295 | #| .0: 296 | #| ^ 297 | CFLAGS:append:pn-nettle:toolchain-clang:powerpc64le = " -no-integrated-as" 298 | 299 | # include/gcc/arm/ck_pr.h:201:1: error: instruction requires: arm-mode 300 | #| CK_PR_DOUBLE_STORE(uint64_t, 64) 301 | #| ^ 302 | #include/gcc/arm/ck_pr.h:192:6: note: expanded from macro 'CK_PR_DOUBLE_STORE' 303 | #| "strexd %1, %3, [%2]\n" \ 304 | #| ^ 305 | CFLAGS:append:pn-concurrencykit:toolchain-clang:arm = " -no-integrated-as" 306 | CFLAGS:append:pn-sysbench:toolchain-clang:arm = " -no-integrated-as" 307 | #error: expected absolute expression 308 | #.elseif (bpp == 24) && (numpix == 8) 309 | # ^ 310 | #:50:5: note: while in macro instantiation 311 | # pixld chunk_size, mask_bpp, mask_basereg, MASK 312 | # ^ 313 | CFLAGS:append:pn-qtbase:toolchain-clang:arm = " -no-integrated-as" 314 | 315 | #../git/common/connection.c:154:55: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare] 316 | # for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) { 317 | # ^~~~~~~~~~~~~~~~~~~~~~ 318 | CFLAGS:append:pn-seatd:toolchain-clang = " -Wno-error=sign-compare" 319 | CXXFLAGS:append:pn-ot-br-posix:toolchain-clang = " -Wno-error=sign-compare" 320 | 321 | # -fno-tree-vrp is gcc specific 322 | CXXFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" 323 | CFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" 324 | 325 | CFLAGS:append:pn-ffmpeg:riscv64 = " -march=rv64gczbb" 326 | CFLAGS:append:pn-ffmpeg:riscv32 = " -march=rv32gczbb" 327 | 328 | # python3-lxml_5.0.0 onwards need this option with clang until the functions are fixes 329 | # | 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 (* 330 | #)(void *, struct _xmlError *)') [-Wincompatible-function-pointer-types] 331 | #| 246911 | xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); 332 | #| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 333 | CFLAGS:append:pn-python3-lxml:toolchain-clang = " -Wno-error=incompatible-function-pointer-types" 334 | # https://lists.openembedded.org/g/openembedded-devel/topic/103542151#108198 335 | CFLAGS:append:pn-python3-kivy:toolchain-clang = " -Wno-error=incompatible-function-pointer-types" 336 | 337 | # otherwise systemd efi fails to build 338 | # error: the 'sse' unit is not supported with this instruction set 339 | TUNE_CCARGS:remove:pn-systemd:toolchain-clang = "-mfpmath=sse" 340 | TUNE_CCARGS:remove:pn-systemd-boot:toolchain-clang = "-mfpmath=sse" 341 | 342 | TUNE_CCARGS:remove:pn-omxplayer:toolchain-clang = "-no-integrated-as" 343 | TUNE_CCARGS:remove:pn-nfs-utils:toolchain-clang = "-Qunused-arguments" 344 | 345 | # We want to error out when -msse option is used otherwise it enables sse on non-x86 arches 346 | TUNE_CCARGS:remove:pn-pipewire:toolchain-clang = "-Qunused-arguments" 347 | TUNE_CCARGS:remove:pn-tesseract:toolchain-clang = "-Qunused-arguments" 348 | TUNE_CCARGS:remove:pn-pulseaudio:toolchain-clang = "-Qunused-arguments" 349 | TUNE_CCARGS:remove:pn-btrfs-tools:toolchain-clang = "-Qunused-arguments" 350 | TUNE_CCARGS:append:pn-btrfs-tools:toolchain-clang = " -Werror=unused-command-line-argument" 351 | TUNE_CCARGS:remove:pn-gimp:toolchain-clang = "-Qunused-arguments" 352 | 353 | # Disable altivec on ppc32 354 | #/usr/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h:1345:32: error: use of undeclared identifier 'vec_sqrt'; did you mean 'vec_rsqrt'? 355 | # BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a); 356 | # ^~~~~~~~ 357 | # vec_rsqrt 358 | TUNE_CCARGS:append:pn-ceres-solver:toolchain-clang:powerpc = " -mno-altivec" 359 | TUNE_CCARGS:append:pn-opencv:toolchain-clang:powerpc = " -mno-altivec" 360 | CXXFLAGS:append:pn-libeigen:toolchain-clang:powerpc = " -DEIGEN_ALTIVEC_DISABLE_MMA" 361 | 362 | # external/amber/src/src/amber.cc:53:41: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage] 363 | # vk-wrappers-1-0.inc:74:34: error: cast from 'PFN_vkVoidFunction' (aka 'void (*)()') to 'PFN_vkCmdEndRenderPass' 364 | # (aka 'void (*)(VkCommandBuffer_T *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] 365 | CXXFLAGS:append:pn-opengl-es-cts:toolchain-clang = " -Wno-error=unsafe-buffer-usage -Wno-error=cast-function-type-strict" 366 | CXXFLAGS:append:pn-vulkan-cts:toolchain-clang = " -Wno-error=unsafe-buffer-usage -Wno-error=cast-function-type-strict" 367 | # Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/6033 368 | CFLAGS:append:pn-gtk4:toolchain-clang = " -Wno-error=int-conversion" 369 | 370 | # usr/include/glib-2.0/glib/glib-autocleanups.h:49:1: error: cast from 'void (*)(void)' to 'GDestroyNotify' 371 | # (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] 372 | CFLAGS:append:pn-pidgin-sipe:toolchain-clang = " -Wno-error=cast-function-type-strict" 373 | 374 | # 32bit builds of nodejs needs this warning to be disabled with clang16 until 375 | # v8 engine in nodejs moved beyong this commit 376 | # https://github.com/v8/v8/commit/d15d49b09dc7aef9edcc4cf6a0cb2b77a0db203f 377 | CXXFLAGS:append:pn-nodejs:toolchain-clang = " -Wno-error=enum-constexpr-conversion" 378 | # 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] 379 | CXXFLAGS:append:pn-doxygen:toolchain-clang = " -Wno-error=missing-template-arg-list-after-template-kw" 380 | 381 | # Finds this extra warning with clang20+ 382 | CXXFLAGS:append:pn-fmt:toolchain-clang = " -Wno-error=invalid-specialization" 383 | 384 | #| /usr/src/debug/ruby/2.5.1-r0/build/../ruby-2.5.1/process.c:7073: undefined reference to `__mulodi4' 385 | #| clang-7: error: linker command failed with exit code 1 (use -v to see invocation) 386 | COMPILER_RT:pn-ruby:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 387 | COMPILER_RT:pn-python3:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 388 | COMPILER_RT:pn-m4:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 389 | COMPILER_RT:pn-cpio:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 390 | COMPILER_RT:pn-openssh:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 391 | COMPILER_RT:pn-webkitgtk:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 392 | COMPILER_RT:pn-wpewebkit:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 393 | COMPILER_RT:pn-python3-numpy:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 394 | COMPILER_RT:pn-mongodb:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" 395 | COMPILER_RT:remove:pn-m4:powerpc = "-rtlib=compiler-rt" 396 | COMPILER_RT:remove:pn-ruby:powerpc = "-rtlib=compiler-rt" 397 | COMPILER_RT:remove:pn-webkitgtk:powerpc = "-rtlib=compiler-rt" 398 | COMPILER_RT:remove:pn-m4:armeb = "-rtlib=compiler-rt" 399 | COMPILER_RT:remove:pn-ruby:armeb = "-rtlib=compiler-rt" 400 | COMPILER_RT:remove:pn-webkitgtk:armeb = "-rtlib=compiler-rt" 401 | # build/lib/libQt5Widgets.so: undefined reference to `__lshrti3' 402 | # __lshrti3 is missing in libgcc 403 | COMPILER_RT:pn-qtbase:toolchain-clang:riscv32 = "-rtlib=compiler-rt ${UNWINDLIB}" 404 | 405 | LDFLAGS:append:pn-qtwebengine:toolchain-clang:runtime-gnu:x86 = " -latomic" 406 | 407 | # | i686-yoe-linux-ld.lld: error: undefined symbol: __atomic_store 408 | LDFLAGS:append:pn-lttng-tools:toolchain-clang:x86 = " -latomic" 409 | 410 | LDFLAGS:append:pn-qemu:toolchain-clang:x86 = " -latomic" 411 | # warning: has a LOAD segment with RWX permissions 412 | LDFLAGS:append:pn-ruby:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}" 413 | LDFLAGS:append:pn-cairo:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}" 414 | LDFLAGS:append:pn-systemd:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}" 415 | 416 | # glibc is built with gcc and hence encodes some libgcc specific builtins which are not found 417 | # when doing static linking with clang using compiler-rt, so use libgcc 418 | # undefined reference to `__unordtf2' 419 | COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" 420 | COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" 421 | COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" 422 | COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" 423 | COMPILER_RT:pn-fmt:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" 424 | COMPILER_RT:pn-fmt:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 425 | COMPILER_RT:pn-mybw:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" 426 | COMPILER_RT:pn-mybw:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 427 | COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 428 | COMPILER_RT:pn-mpich:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 429 | COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 430 | COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 431 | COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 432 | # | 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': 433 | # | /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__unordtf2' 434 | # | 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' 435 | # | 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' 436 | # | 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': 437 | # | /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__unordtf2' 438 | # | 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' 439 | # | 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' 440 | # | 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 441 | COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" 442 | COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" 443 | 444 | #(unwind.o): in function `__pthread_unwind': 445 | #/usr/src/debug/glibc/2.29-r0/git/nptl/unwind.c:121: undefined reference to `_Unwind_ForcedUnwind' 446 | #clang-8: error: linker command failed with exit code 1 (use -v to see invocation) 447 | COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" 448 | 449 | # Does not compile with libc++ from clang 17+ anymore see 450 | # https://github.com/llvm/llvm-project/issues/63743 451 | LIBCPLUSPLUS:pn-apt:toolchain-clang = "-stdlib=libstdc++" 452 | 453 | # All following need to use libstdc++ with clang-19 454 | # see https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals 455 | LIBCPLUSPLUS:pn-pbzip2:toolchain-clang = "-stdlib=libstdc++" 456 | LIBCPLUSPLUS:pn-nlohmann-json:toolchain-clang = "-stdlib=libstdc++" 457 | LIBCPLUSPLUS:pn-paho-mqtt-cpp:toolchain-clang = "-stdlib=libstdc++" 458 | LIBCPLUSPLUS:pn-poco:toolchain-clang = "-stdlib=libstdc++" 459 | LIBCPLUSPLUS:pn-netdata:toolchain-clang = "-stdlib=libstdc++" 460 | LIBCPLUSPLUS:pn-cpp-netlib:toolchain-clang = "-stdlib=libstdc++" 461 | LIBCPLUSPLUS:pn-cpprest:toolchain-clang = "-stdlib=libstdc++" 462 | # See https://lists.openembedded.org/g/openembedded-devel/topic/meta_oe_patch_2_3/108964413 463 | LIBCPLUSPLUS:pn-tomlplusplus:toolchain-clang = "-stdlib=libstdc++" 464 | LIBCPLUSPLUS:pn-doxygen:toolchain-clang = "-stdlib=libstdc++" 465 | # https://www.mail-archive.com/freebsd-pkg-fallout@freebsd.org/msg2394451.html 466 | LIBCPLUSPLUS:pn-snort3:toolchain-clang = "-stdlib=libstdc++" 467 | LIBCPLUSPLUS:pn-libdaq:toolchain-clang = "-stdlib=libstdc++" 468 | 469 | # Uses gcc for native tools, e.g. nsinstall and passes clang options which fails so 470 | # let same compiler ( gcc or clang) be native/cross compiler 471 | # | gcc: error: unrecognized command line option ‘-Qunused-arguments’ 472 | BUILD_CC:pn-nss:toolchain-clang = "clang -rtlib=libgcc -unwindlib=none" 473 | 474 | # LTO 475 | # Seems to use symver ASMs see https://stackoverflow.com/questions/46304742/how-to-combine-lto-with-symbol-versioning 476 | # lib/puny_encode.c:136: multiple definition of `_idn2_punycode_encode' 477 | LTO:pn-libidn2:toolchain-clang = "" 478 | 479 | #libcairo.so: undefined reference to pthread_mutexattr_init [--no-allow-shlib-undefined] 480 | LTO:pn-cairo:toolchain-clang = "" 481 | 482 | # This works with gcc-ranlib wrapper only which expands $@ shell array, 483 | # but it will fail if RANLIB was set to -ranlib or 484 | # -llvn-ranlib has same behaviour 485 | RANLIB:append:pn-tcf-agent:toolchain-clang = " $@" 486 | 487 | # Subprocess output:mips-yoe-linux-llvm-objcopy: error: Link field value 22 in section .rel.dyn is not a symbol table 488 | # also seen on riscv64 and x86-64 489 | OBJCOPY:pn-linux-yocto:toolchain-clang = "${HOST_PREFIX}objcopy" 490 | OBJCOPY:pn-linux-yocto-dev:toolchain-clang = "${HOST_PREFIX}objcopy" 491 | OBJCOPY:pn-linux-yocto-rt:toolchain-clang = "${HOST_PREFIX}objcopy" 492 | OBJCOPY:pn-linux-variscite:toolchain-clang = "${HOST_PREFIX}objcopy" 493 | OBJCOPY:pn-linux-ti-staging:toolchain-clang = "${HOST_PREFIX}objcopy" 494 | OBJCOPY:pn-linux-raspberrypi:toolchain-clang = "${HOST_PREFIX}objcopy" 495 | OBJCOPY:pn-linux-starfive-dev:toolchain-clang = "${HOST_PREFIX}objcopy" 496 | OBJCOPY:pn-linux-nezha-dev:toolchain-clang = "${HOST_PREFIX}objcopy" 497 | OBJCOPY:pn-linux-hardkernel:toolchain-clang = "${HOST_PREFIX}objcopy" 498 | OBJCOPY:pn-linux-imx:toolchain-clang = "${HOST_PREFIX}objcopy" 499 | OBJCOPY:pn-linux-fslc:toolchain-clang = "${HOST_PREFIX}objcopy" 500 | OBJCOPY:pn-linux-fslc-imx:toolchain-clang = "${HOST_PREFIX}objcopy" 501 | OBJCOPY:pn-linux-fslc-lts:toolchain-clang = "${HOST_PREFIX}objcopy" 502 | OBJCOPY:pn-linux-at91:toolchain-clang = "${HOST_PREFIX}objcopy" 503 | OBJCOPY:pn-linux-linaro-qcomlt:toolchain-clang = "${HOST_PREFIX}objcopy" 504 | OBJCOPY:pn-linux-intel:toolchain-clang = "${HOST_PREFIX}objcopy" 505 | 506 | # see https://github.com/llvm/llvm-project/issues/53948 507 | OBJCOPY:pn-opensbi:toolchain-clang = "${HOST_PREFIX}objcopy" 508 | OBJCOPY:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}objcopy" 509 | STRIP:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}strip" 510 | OBJCOPY:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}objcopy" 511 | STRIP:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}strip" 512 | 513 | # Depend on GNU objcopy option missing in llvm-objcopy 514 | # llvm-objcopy: error: unknown argument '--section-alignment=512' 515 | OBJCOPY:pn-systemd-boot:toolchain-clang = "${HOST_PREFIX}objcopy" 516 | 517 | # See https://github.com/llvm/llvm-project/issues/53999 518 | STRIP:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}strip" 519 | OBJCOPY:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}objcopy" 520 | STRIP:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}strip" 521 | OBJCOPY:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}objcopy" 522 | 523 | # e.g. mips-yoe-linux-llvm-objcopy: error: Link field value 42 in section .rel.dyn is not a symbol table 524 | # e.g. aarch64-yoe-linux-llvm-objcopy: error: Link field value 35 in section .rela.plt is not a symbol table 525 | OBJCOPY:pn-mybw:toolchain-clang = "${HOST_PREFIX}objcopy" 526 | 527 | # Fails with llvm strip 528 | # i686-yoe-linux-llvm-strip: error: SHT_STRTAB string table section [index 9] is non-null terminated 529 | STRIP:pn-minio:toolchain-clang = "${HOST_PREFIX}strip" 530 | OBJCOPY:pn-minio:toolchain-clang = "${HOST_PREFIX}objcopy" 531 | 532 | # | aarch64-yoe-linux-llvm-objcopy: error: invalid output format: 'efi-app-aarch64' 533 | OBJCOPY:pn-gnu-efi:toolchain-clang = "${HOST_PREFIX}objcopy" 534 | 535 | # see https://github.com/llvm/llvm-project/issues/54213 536 | # Generates a bad libbsd.so linker stub and apps like bluelsa, mg, netcat-openbsd, android-tools 537 | # fails to link with libbsd 538 | OBJDUMP:pn-libbsd:mips:toolchain-clang = "${HOST_PREFIX}objdump" 539 | 540 | # With clang/lld it builds objects which gnu strip complains about 541 | # 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 542 | STRIP:pn-python3-matplotlib:toolchain-clang:riscv64 = "${HOST_PREFIX}llvm-strip" 543 | STRIP:pn-python3-matplotlib:toolchain-clang:riscv32 = "${HOST_PREFIX}llvm-strip" 544 | 545 | # Need OBJDUMP during do_package_qa which is set to llvm-objdump with meta-clang 546 | # it might work with GNU objdump since it falls back to one from build host 547 | DEPENDS:append:pn-linux-firmware:toolchain-clang = " clang-native" 548 | 549 | # Needs for solving fopenmp issues 550 | DEPENDS:append:pn-pixman:mips:toolchain-clang = " openmp" 551 | #| ../pixman-0.40.0/pixman/pixman-arm-neon-asm.S:3625:1: note: while in macro instantiation 552 | #| generate_bilinear_scanline_func pixman_scaled_bilinear_scanline_0565_0565_SRC_asm_neon, 0565, 0565, 1, 1, 28, BILINEAR_FLAG_UNROLL_4 553 | #| ^ 554 | #| :134:1: error: unknown directive 555 | #| .endfunc 556 | #| ^ 557 | CFLAGS:append:pn-pixman:arm:toolchain-clang = " -no-integrated-as" 558 | # :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] 559 | # vsetvli zero, zero, e16, m1 560 | CFLAGS:append:pn-dav1d:riscv64:toolchain-clang = " -no-integrated-as" 561 | 562 | # ../numpy-2.2.3/numpy/_core/src/highway/hwy/ops/rvv-inl.h:644:17: error: use of undeclared identifier '__riscv_vsetvl_e8mf8' 563 | # This only happens with clang with rv64gc 564 | TOOLCHAIN_OPTIONS:append:pn-python3-numpy:riscv64:toolchain-clang = " -march=rv64gcv" 565 | TOOLCHAIN_OPTIONS:append:pn-python3-numpy:riscv32:toolchain-clang = " -march=rv32gcv" 566 | 567 | # git/lib/simdutf-amalgamation-5.5.0/src/simdutf/simdutf.cpp:4941:57: error: RISC-V type 'vuint16m1_t' (aka '__rvv_uint16m1_t') requires the 'zve32x' extension 568 | # return __riscv_vmacc_vx_u16m1(__riscv_vsrl_vx_u16m1(v, 8, vl), 0x100, v, vl); 569 | TOOLCHAIN_OPTIONS:append:pn-fluentbit:riscv64:toolchain-clang = " -march=rv64gcv" 570 | 571 | # test_connectx segfaults with this option set to -fstack-protector-strong 572 | SECURITY_STACK_PROTECTOR:pn-lksctp-tools:toolchain-clang = "" 573 | 574 | # 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 575 | INSANE_SKIP:append:pn-babeltrace2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' textrel', '', d)}" 576 | 577 | LDFLAGS:append:pn-libidn2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 578 | LDFLAGS:append:pn-alsa-lib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 579 | LDFLAGS:append:pn-libmd:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 580 | LDFLAGS:append:pn-libbsd:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 581 | LDFLAGS:append:pn-slang:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 582 | LDFLAGS:append:pn-libgcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 583 | LDFLAGS:append:pn-libxml2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 584 | LDFLAGS:append:pn-binutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 585 | LDFLAGS:append:pn-libnss-mdns:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 586 | LDFLAGS:append:pn-pulseaudio:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 587 | LDFLAGS:append:pn-mesa:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 588 | LDFLAGS:append:pn-mesa-gl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 589 | LDFLAGS:append:pn-mesa-pvr:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 590 | LDFLAGS:append:pn-libnsl2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 591 | LDFLAGS:append:pn-libnl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 592 | LDFLAGS:append:pn-libnftnl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 593 | LDFLAGS:append:pn-libtirpc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 594 | LDFLAGS:append:pn-ndctl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 595 | 596 | LDFLAGS:append:pn-zlib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd -Wl,--undefined-version', '', d)}" 597 | LDFLAGS:remove:pn-zlib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" 598 | 599 | LDFLAGS:append:pn-qtbase:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 600 | # | aarch64-yoe-linux-ld.lld: error: version script assignment of 'Qt_6.5' to symbol 'qt_version_tag' failed: symbol not defined 601 | LDFLAGS:append:pn-qtlanguageserver:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 602 | LDFLAGS:append:pn-qtserialport:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 603 | LDFLAGS:append:pn-qtimageformats:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 604 | LDFLAGS:append:pn-qtnetworkauth:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 605 | LDFLAGS:append:pn-qtsvg:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 606 | LDFLAGS:append:pn-qtshadertools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 607 | LDFLAGS:append:pn-qtdeclarative:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 608 | LDFLAGS:append:pn-qtserialbus:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 609 | LDFLAGS:append:pn-qtwebsockets:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 610 | LDFLAGS:append:pn-qtlottie:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 611 | LDFLAGS:append:pn-qtspeech:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 612 | LDFLAGS:append:pn-qtcoap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 613 | LDFLAGS:append:pn-qtsensors:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 614 | LDFLAGS:append:pn-qtquickdesigner-components:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 615 | LDFLAGS:append:pn-qtquicktimeline:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 616 | LDFLAGS:append:pn-qt5compat:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 617 | LDFLAGS:append:pn-qt3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 618 | LDFLAGS:append:pn-qtvirtualkeyboard:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 619 | LDFLAGS:append:pn-qtscxml:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 620 | LDFLAGS:append:pn-qtpositioning:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 621 | LDFLAGS:append:pn-qtdatavis3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 622 | LDFLAGS:append:pn-qtremoteobjects:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 623 | LDFLAGS:append:pn-qtopcua:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 624 | LDFLAGS:append:pn-qtcharts:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 625 | LDFLAGS:append:pn-qtconnectivity:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 626 | LDFLAGS:append:pn-qtwayland:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 627 | LDFLAGS:append:pn-qtgrpc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 628 | LDFLAGS:append:pn-qthttpserver:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 629 | LDFLAGS:append:pn-qtmqtt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 630 | LDFLAGS:append:pn-qtwebchannel:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 631 | LDFLAGS:append:pn-qtquick3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 632 | LDFLAGS:append:pn-qtlocation:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 633 | LDFLAGS:append:pn-qtwebengine:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 634 | LDFLAGS:append:pn-qtwebview:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 635 | LDFLAGS:append:pn-qtmultimedia:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 636 | LDFLAGS:append:pn-qtquick3dphysics:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 637 | LDFLAGS:append:pn-qtinterfaceframework:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 638 | LDFLAGS:append:pn-qttools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 639 | LDFLAGS:append:pn-qtdeviceutilities:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 640 | LDFLAGS:append:pn-qtpdf:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 641 | LDFLAGS:append:pn-libxcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 642 | LDFLAGS:append:pn-popt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 643 | LDFLAGS:append:pn-json-c:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 644 | LDFLAGS:append:pn-libtalloc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 645 | LDFLAGS:append:pn-libdevmapper:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 646 | LDFLAGS:append:pn-libtdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 647 | LDFLAGS:append:pn-libtevent:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 648 | LDFLAGS:append:pn-cryptsetup:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 649 | LDFLAGS:append:pn-libgphoto2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 650 | LDFLAGS:append:pn-libxklavier:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 651 | LDFLAGS:append:pn-lame:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 652 | LDFLAGS:append:pn-keyutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 653 | LDFLAGS:append:pn-libcdio:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 654 | LDFLAGS:append:pn-libva:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 655 | LDFLAGS:append:pn-libbpf:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 656 | LDFLAGS:append:pn-npth:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 657 | LDFLAGS:append:pn-tbb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 658 | LDFLAGS:append:pn-corosync:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 659 | LDFLAGS:append:pn-libnetfilter-cttimeout:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 660 | LDFLAGS:append:pn-fuse3:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 661 | LDFLAGS:append:pn-tremor:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 662 | LDFLAGS:append:pn-flashrom:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 663 | LDFLAGS:append:pn-ipset:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 664 | LDFLAGS:append:pn-rdma-core:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 665 | LDFLAGS:append:pn-apitrace:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 666 | LDFLAGS:append:pn-libkcapi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 667 | LDFLAGS:append:pn-gtk-vnc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 668 | LDFLAGS:append:pn-libnss-nis:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 669 | LDFLAGS:append:pn-libva-initial:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 670 | LDFLAGS:append:pn-dante:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 671 | LDFLAGS:append:pn-basu:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 672 | LDFLAGS:append:pn-passwdqc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 673 | LDFLAGS:append:pn-pcp:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 674 | LDFLAGS:append:pn-multipath-tools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 675 | LDFLAGS:append:pn-renderdoc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 676 | LDFLAGS:append:pn-libldb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 677 | LDFLAGS:append:pn-samba:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 678 | LDFLAGS:append:pn-libnvme:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 679 | LDFLAGS:append:pn-gnu-efi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 680 | LDFLAGS:append:pn-libffi:x86:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 681 | LDFLAGS:append:pn-libffi:arm:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 682 | LDFLAGS:append:pn-elfutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 683 | LDFLAGS:append:pn-pmdk:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 684 | LDFLAGS:append:pn-libcgroup:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld sysvinit', ' -Wl,--undefined-version', '', d)}" 685 | LDFLAGS:append:pn-kernel-selftest:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 686 | LDFLAGS:append:pn-openldap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 687 | LDFLAGS:append:pn-liburing:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 688 | LDFLAGS:append:pn-frame:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 689 | # | x86_64-yoe-linux-musl-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined 690 | LDFLAGS:append:pn-wtmpdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 691 | # arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined 692 | LDFLAGS:append:pn-util-linux:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 693 | LDFLAGS:append:pn-util-linux-libuuid:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 694 | # riscv64-yoe-linux-musl-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined 695 | LDFLAGS:append:pn-libpam:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 696 | # i686-yoe-linux-ld.lld: error: version script assignment of 'SLIRP_4.0' to symbol 'slirp_add_exec' failed: symbol not defined 697 | LDFLAGS:append:pn-libslirp:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 698 | # x86_64-yoe-linux-ld.lld: error: version script assignment of 'NSSMDNS_0' to symbol '_nss_mdns_gethostbyaddr_r' failed: symbol not defined 699 | LDFLAGS:append:pn-avahi-libnss-mdns:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 700 | TUNE_CCARGS:remove:pn-kernel-selftest:toolchain-clang = "-mfpmath=sse" 701 | 702 | # Avoid's go linker crash as reported in https://github.com/golang/go/issues/61872 703 | # it happens when libstd.so is linked with lld for aarch64 704 | LDFLAGS:append:pn-go-runtime:toolchain-clang:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" 705 | LDFLAGS:remove:pn-go-runtime:toolchain-clang:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" 706 | LDFLAGS:append:pn-go-runtime:toolchain-clang:x86-64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" 707 | LDFLAGS:remove:pn-go-runtime:toolchain-clang:x86-64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" 708 | # See https://github.com/llvm/llvm-project/issues/65017 709 | LDFLAGS:append:pn-libfaketime:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" 710 | LDFLAGS:remove:pn-libfaketime:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" 711 | # arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'readdir' failed: symbol not defined 712 | #| arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'readdir_r' failed: symbol not defined 713 | #| arm-yoe-linux-gnueabi-clang: error: linker command failed with exit code 1 (use -v to see invocation) 714 | LDFLAGS:append:pn-aufs-util:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" 715 | LDFLAGS:remove:pn-aufs-util:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" 716 | # | arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined 717 | LDFLAGS:append:pn-lastlog2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" 718 | LDFLAGS:remove:pn-lastlog2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" 719 | LDFLAGS:remove:pn-python3-bcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', '-fuse-ld=lld', '', d)}" 720 | LDFLAGS:remove:pn-bluez5:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}" 721 | LDFLAGS:append:pn-bluez5:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" 722 | # lld ends up with unsupported relocation type 12 with clang-20 on mesa 25 723 | 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)}" 724 | LD:pn-libhugetlbfs:toolchain-clang = "${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}" 725 | LD:pn-libunix-statgrab:toolchain-clang = "${CC}" 726 | 727 | TOOLCHAIN:pn-perf = "gcc" 728 | 729 | # See https://github.com/llvm/llvm-project/issues/108262 730 | SELECTED_OPTIMIZATION:remove:pn-libjxl:arm:toolchain-clang = "-O2" 731 | SELECTED_OPTIMIZATION:append:pn-libjxl:arm:toolchain-clang = " -Og" 732 | 733 | # qemu usermode crashes when using clang as system compiler but works with gcc 734 | # see https://patchwork.yoctoproject.org/project/oe-core/patch/20240923234336.3978188-1-raj.khem@gmail.com/ 735 | GI_DATA_ENABLED:pn-vte:toolchain-clang:armv7ve = "False" 736 | 737 | # in following 4 recipes g-i fails to parse glibc 2.41 headers with clang on x86 arches 738 | GI_DATA_ENABLED:pn-libmodulemd:toolchain-clang:x86 = "False" 739 | GI_DATA_ENABLED:pn-libblockdev:toolchain-clang:x86 = "False" 740 | GI_DATA_ENABLED:pn-webkitgtk3:toolchain-clang:x86 = "False" 741 | GI_DATA_ENABLED:pn-webkitgtk:toolchain-clang:x86 = "False" 742 | GI_DATA_ENABLED:pn-libmodulemd:toolchain-clang:x86-64 = "False" 743 | GI_DATA_ENABLED:pn-libblockdev:toolchain-clang:x86-64 = "False" 744 | GI_DATA_ENABLED:pn-webkitgtk3:toolchain-clang:x86-64 = "False" 745 | GI_DATA_ENABLED:pn-webkitgtk:toolchain-clang:x86-64 = "False" 746 | -------------------------------------------------------------------------------- /conf/nonscanable.conf: -------------------------------------------------------------------------------- 1 | SCAN_BUILD:pn-linux-libc-headers = "" 2 | SCAN_BUILD:pn-update-rc.d = "" 3 | SCAN_BUILD:pn-initscripts = "" 4 | SCAN_BUILD:pn-base-files = "" 5 | SCAN_BUILD:pn-os-release = "" 6 | SCAN_BUILD:pn-wireless-regdb = "" 7 | SCAN_BUILD:pn-tzdata = "" 8 | SCAN_BUILD:pn-qemuwrapper-cross = "" 9 | SCAN_BUILD:pn-depmodwrapper-cross = "" 10 | SCAN_BUILD:pn-bluez-firmware-rpidistro = "" 11 | SCAN_BUILD:pn-udev-rules-rpi = "" 12 | SCAN_BUILD:pn-shadow-securetty = "" 13 | SCAN_BUILD:pn-96boards-tools = "" 14 | SCAN_BUILD:pn-run-postinsts = "" 15 | SCAN_BUILD:pn-keymaps = "" 16 | SCAN_BUILD:pn-sysvinit-inittab = "" 17 | SCAN_BUILD:pn-pi-bluetooth = "" 18 | SCAN_BUILD:pn-rpi-config = "" 19 | SCAN_BUILD:pn-bcm2835-bootfiles = "" 20 | SCAN_BUILD:pn-autoconf-archive = "" 21 | SCAN_BUILD:pn-compiler-rt = "" 22 | SCAN_BUILD:pn-libcxx = "" 23 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch: -------------------------------------------------------------------------------- 1 | From 9ee5d9ca2e1ea709571613326b81e8e651fa9f00 Mon Sep 17 00:00:00 2001 2 | From: Martin Jansa 3 | Date: Thu, 7 Sep 2023 11:43:25 +0200 4 | Subject: [PATCH] CMakeLists.txt: don't modify .gitconfig on build host nor try 5 | to update git submodules 6 | 7 | * bitbake fetcher will correctly handle safe.directory issues and 8 | blazesym or libbpf submodules are managed by gitsm:// fetcher 9 | we don't want to call git from CMake in do_configure 10 | 11 | Upstream-Status: Pending 12 | Signed-off-by: Martin Jansa 13 | --- 14 | CMakeLists.txt | 62 -------------------------------------------------- 15 | 1 file changed, 62 deletions(-) 16 | 17 | diff --git a/CMakeLists.txt b/CMakeLists.txt 18 | index dfed06e5..ffd88043 100644 19 | --- a/CMakeLists.txt 20 | +++ b/CMakeLists.txt 21 | @@ -26,68 +26,6 @@ endif() 22 | 23 | enable_testing() 24 | 25 | -execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR} 26 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 27 | - RESULT_VARIABLE CONFIG_RESULT) 28 | -if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) 29 | - message(WARNING "Failed to add root source directory to safe.directory") 30 | -endif() 31 | - 32 | -# populate submodule blazesym 33 | -if(NOT NO_BLAZESYM) 34 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/blazesym 35 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 36 | - RESULT_VARIABLE CONFIG_RESULT) 37 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) 38 | - message(WARNING "Failed to add blazesym source directory to safe.directory") 39 | - endif() 40 | - 41 | - execute_process(COMMAND git submodule update --init --recursive -- libbpf-tools/blazesym 42 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 43 | - RESULT_VARIABLE UPDATE_RESULT) 44 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) 45 | - message(WARNING "Failed to update submodule blazesym") 46 | - endif() 47 | -endif() 48 | - 49 | -# populate submodules (libbpf) 50 | -if(NOT CMAKE_USE_LIBBPF_PACKAGE) 51 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf 52 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 53 | - RESULT_VARIABLE CONFIG_RESULT) 54 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) 55 | - message(WARNING "Failed to add libbpf source directory to safe.directory") 56 | - endif() 57 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/bpftool 58 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 59 | - RESULT_VARIABLE CONFIG_RESULT) 60 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) 61 | - message(WARNING "Failed to add bpftool source directory to safe.directory") 62 | - endif() 63 | - 64 | - if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) 65 | - execute_process(COMMAND git submodule update --init --recursive 66 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 67 | - RESULT_VARIABLE UPDATE_RESULT) 68 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) 69 | - message(WARNING "Failed to update submodule libbpf") 70 | - endif() 71 | - else() 72 | - execute_process(COMMAND git diff --shortstat ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/ 73 | - OUTPUT_VARIABLE DIFF_STATUS) 74 | - if("${DIFF_STATUS}" STREQUAL "") 75 | - execute_process(COMMAND git submodule update --init --recursive 76 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 77 | - RESULT_VARIABLE UPDATE_RESULT) 78 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) 79 | - message(WARNING "Failed to update submodule libbpf") 80 | - endif() 81 | - else() 82 | - message(WARNING "submodule libbpf dirty, so no sync") 83 | - endif() 84 | - endif() 85 | -endif() 86 | - 87 | # It's possible to use other kernel headers with 88 | # KERNEL_INCLUDE_DIRS build variable, like: 89 | # $ cd 90 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch: -------------------------------------------------------------------------------- 1 | From 4f64ed40e1ffea7ea278627f30a01018e57dcbcf Mon Sep 17 00:00:00 2001 2 | From: Mingli Yu 3 | Date: Wed, 9 Sep 2020 05:48:19 +0000 4 | Subject: [PATCH] CMakeLists.txt: override the PY_CMD_ESCAPED 5 | 6 | Override the PY_CMD_ESCAPED as the PY_CMD_ESCAPED is constructed by 7 | the full path of the python3. In some cases, the path is so long and 8 | result in the PY_CMD_ESCAPED exceeds 255 characters and comes below 9 | do_configure error: 10 | | CMake Error at src/python/CMakeLists.txt:18 (configure_file): 11 | | configure_file Problem configuring file 12 | | 13 | | CMake Error: Could not open file for write in copy operation /buildarea1/test/wr_build/wr1020_20200909_bcc/bcc_long_Kernel/auto-standalone_next/200827/lxbuilds/Intel-Snow-Ridge-NS_platform_up/intel-x86-64-standard-glibc-std/wrlinux/build/tmp-glibc/work/corei7-64-wrs-linux/bcc/0.15.0-r0/build/src/python/bcc--buildarea1-test-wr_build-wr1020_20200909_bcc-bcc_long_Kernel-auto-standalone_next-200827-lxbuilds-Intel-Snow-Ridge-NS_platform_up-intel-x86-64-standard-glibc-std-wrlinux-build-tmp-glibc-work-corei7-64-wrs-linux-bcc-0.15.0-r0-recipe-sysroot-native-usr-bin-python3-native-python3/bcc/version.py.tmp 14 | 15 | Upstream-Status: Pending 16 | 17 | Signed-off-by: Mingli Yu 18 | --- 19 | src/python/CMakeLists.txt | 4 ++-- 20 | 1 file changed, 2 insertions(+), 2 deletions(-) 21 | 22 | --- a/src/python/CMakeLists.txt 23 | +++ b/src/python/CMakeLists.txt 24 | @@ -16,7 +16,7 @@ file(GLOB_RECURSE PYTHON_INCLUDES RELATI 25 | 26 | foreach(PY_CMD ${PYTHON_CMD}) 27 | string(REPLACE "/" "-" PY_CMD_ESCAPED ${PY_CMD}) 28 | - set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-${PY_CMD_ESCAPED}) 29 | + set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-python3) 30 | 31 | foreach(PY_SRC ${PYTHON_SOURCES}) 32 | configure_file(${PY_SRC} ${PY_DIRECTORY}/${PY_SRC} COPYONLY) 33 | @@ -35,7 +35,7 @@ foreach(PY_CMD ${PYTHON_CMD}) 34 | DEPENDS ${PYTHON_SOURCES} ${PYTHON_INCLUDES} 35 | COMMENT "Building sdist for ${PY_CMD}" 36 | ) 37 | - add_custom_target(bcc_py_${PY_CMD_ESCAPED} ALL DEPENDS ${PIP_INSTALLABLE}) 38 | + add_custom_target(bcc_py_python3 ALL DEPENDS ${PIP_INSTALLABLE}) 39 | 40 | if(NOT PYTHON_PREFIX) 41 | set(PYTHON_PREFIX ${CMAKE_INSTALL_PREFIX}) 42 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch: -------------------------------------------------------------------------------- 1 | From 6cffc195eca6b53a12865d325ff97e7b5ba8f22b Mon Sep 17 00:00:00 2001 2 | From: Daniel Thompson 3 | Date: Thu, 19 May 2022 09:14:20 +0000 4 | Subject: [PATCH] Vendor just enough extra headers to allow libbpf to be 5 | de-vendored 6 | 7 | Currently it is not possible to build the bcc recipe when we de-vendor 8 | libbpf and adopt the packaged version. Ironically this is due to the 9 | deliberate vendoring of some depreciated btf code that is being removed 10 | upstream because bcc was the only user! In other words the vendored code 11 | doesn't work the de-vendored libbpf because also ends up de-vendoring 12 | one of the Linux uapi headers. 13 | 14 | This is obviously an OE specific issue (due to the current combination 15 | of linux headers, libbpf and bcc). It's a bit of a mess and the right 16 | solution is probably to update the system UAPI headers but I am committing 17 | this for now simply so I can easily show why we must de-vendor libbpf in 18 | the first place! 19 | 20 | Upstream-Status: Inappropriate [other] 21 | 22 | Signed-off-by: Daniel Thompson 23 | --- 24 | src/cc/bcc_btf.cc | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 25 | 1 file changed, 87 insertions(+) 26 | 27 | diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc 28 | index 7f551ae8..cca3c6c3 100644 29 | --- a/src/cc/bcc_btf.cc 30 | +++ b/src/cc/bcc_btf.cc 31 | @@ -33,6 +33,93 @@ 32 | 33 | namespace btf_ext_vendored { 34 | 35 | +#ifdef HAVE_EXTERNAL_LIBBPF 36 | +/* 37 | + * When we de-vendor libbpf we end up picking up an older version of 38 | + * [uapi/]linux/bpf.h which misses out some of the data structures needed 39 | + * to compile this file. Annoyingly the code that doesn't compile it 40 | + * a result of de-vendoring 41 | + * 42 | + * This section is a minimized re-vendoring to fix that. It is not robust 43 | + * against version skew: When the system linux/bpf.h is updated then this 44 | + * will break the build and the patch can be dropped. 45 | + */ 46 | + 47 | +/* bpf_core_relo_kind encodes which aspect of captured field/type/enum value 48 | + * has to be adjusted by relocations. It is emitted by llvm and passed to 49 | + * libbpf and later to the kernel. 50 | + */ 51 | +enum bpf_core_relo_kind { 52 | + BPF_CORE_FIELD_BYTE_OFFSET = 0, /* field byte offset */ 53 | + BPF_CORE_FIELD_BYTE_SIZE = 1, /* field size in bytes */ 54 | + BPF_CORE_FIELD_EXISTS = 2, /* field existence in target kernel */ 55 | + BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */ 56 | + BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */ 57 | + BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */ 58 | + BPF_CORE_TYPE_ID_LOCAL = 6, /* type ID in local BPF object */ 59 | + BPF_CORE_TYPE_ID_TARGET = 7, /* type ID in target kernel */ 60 | + BPF_CORE_TYPE_EXISTS = 8, /* type existence in target kernel */ 61 | + BPF_CORE_TYPE_SIZE = 9, /* type size in bytes */ 62 | + BPF_CORE_ENUMVAL_EXISTS = 10, /* enum value existence in target kernel */ 63 | + BPF_CORE_ENUMVAL_VALUE = 11, /* enum value integer value */ 64 | +}; 65 | + 66 | +/* 67 | + * "struct bpf_core_relo" is used to pass relocation data form LLVM to libbpf 68 | + * and from libbpf to the kernel. 69 | + * 70 | + * CO-RE relocation captures the following data: 71 | + * - insn_off - instruction offset (in bytes) within a BPF program that needs 72 | + * its insn->imm field to be relocated with actual field info; 73 | + * - type_id - BTF type ID of the "root" (containing) entity of a relocatable 74 | + * type or field; 75 | + * - access_str_off - offset into corresponding .BTF string section. String 76 | + * interpretation depends on specific relocation kind: 77 | + * - for field-based relocations, string encodes an accessed field using 78 | + * a sequence of field and array indices, separated by colon (:). It's 79 | + * conceptually very close to LLVM's getelementptr ([0]) instruction's 80 | + * arguments for identifying offset to a field. 81 | + * - for type-based relocations, strings is expected to be just "0"; 82 | + * - for enum value-based relocations, string contains an index of enum 83 | + * value within its enum type; 84 | + * - kind - one of enum bpf_core_relo_kind; 85 | + * 86 | + * Example: 87 | + * struct sample { 88 | + * int a; 89 | + * struct { 90 | + * int b[10]; 91 | + * }; 92 | + * }; 93 | + * 94 | + * struct sample *s = ...; 95 | + * int *x = &s->a; // encoded as "0:0" (a is field #0) 96 | + * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1, 97 | + * // b is field #0 inside anon struct, accessing elem #5) 98 | + * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array) 99 | + * 100 | + * type_id for all relocs in this example will capture BTF type id of 101 | + * `struct sample`. 102 | + * 103 | + * Such relocation is emitted when using __builtin_preserve_access_index() 104 | + * Clang built-in, passing expression that captures field address, e.g.: 105 | + * 106 | + * bpf_probe_read(&dst, sizeof(dst), 107 | + * __builtin_preserve_access_index(&src->a.b.c)); 108 | + * 109 | + * In this case Clang will emit field relocation recording necessary data to 110 | + * be able to find offset of embedded `a.b.c` field within `src` struct. 111 | + * 112 | + * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction 113 | + */ 114 | +struct bpf_core_relo { 115 | + __u32 insn_off; 116 | + __u32 type_id; 117 | + __u32 access_str_off; 118 | + enum bpf_core_relo_kind kind; 119 | +}; 120 | +#endif /* HAVE_EXTERNAL_LIBBPF */ 121 | + 122 | /* The minimum bpf_func_info checked by the loader */ 123 | struct bpf_func_info_min { 124 | uint32_t insn_off; 125 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bcc/bcc/bpf_stack_id.patch: -------------------------------------------------------------------------------- 1 | Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5292] 2 | Signed-off-by: Harish Sadineni 3 | 4 | --- a/tests/cc/test_bpf_table.cc 5 | +++ b/tests/cc/test_bpf_table.cc 6 | @@ -260,6 +260,7 @@ 7 | /* libc locations on different distributions are added below*/ 8 | bpf.add_module("/lib/x86_64-linux-gnu/libc.so.6"); //Location of libc in ubuntu 9 | bpf.add_module("/lib64/libc.so.6"); //Location of libc fedora machine 10 | + bpf.add_module("/lib/libc.so.6");//location of libc in image 11 | 12 | int stack_id = id[0]; 13 | REQUIRE(stack_id >= 0); 14 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bcc/bcc/ptest_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Simple OE specific wrapper for bcc python tests 3 | 4 | name=$1 5 | kind=$2 6 | cmd=$3 7 | shift 3 8 | 9 | case $kind in 10 | simple|sudo) 11 | $cmd "$@" 12 | ;; 13 | *) 14 | echo "Invalid kind $kind of test $name" 15 | exit 1 16 | esac 17 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bcc/bcc/run-ptest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd tests || exit 1 4 | 5 | PASS_CNT=0 6 | FAIL_CNT=0 7 | FAILED="" 8 | 9 | print_test_result() { 10 | if [ $? -eq 0 ]; then 11 | echo PASS: "$1" 12 | PASS_CNT=$((PASS_CNT + 1)) 13 | else 14 | echo FAIL: "$1" 15 | FAIL_CNT=$((FAIL_CNT + 1)) 16 | FAILED="$FAILED $1;" 17 | fi 18 | } 19 | 20 | # Run CC tests, set IFS as test names have spaces 21 | IFS=$(printf '\n\t') 22 | for test_name in $(./cc/test_libbcc_no_libbpf --list-test-names-only); do 23 | ./cc/test_libbcc_no_libbpf "$test_name" > /dev/null 2>&1 24 | print_test_result "cc $test_name" 25 | done 26 | unset IFS 27 | 28 | # Run python tests, skip namespace tests as they currently don't work 29 | if cmake -DCMAKE_TESTING_ENABLED=ON -DTEST_WRAPPER="$(pwd)/ptest_wrapper.sh" python > /dev/null 2>&1; then 30 | for test_name in $(awk -F '[( ]' '/^add_test/ && !/namespace/ {print $2}' CTestTestfile.cmake); do 31 | ctest -Q -R "$test_name" 32 | print_test_result "python $test_name" 33 | done 34 | else 35 | print_test_result "cmake error, couldn't start python tests" 36 | fi 37 | 38 | echo "#### bcc tests summary ####" 39 | echo "# TOTAL: $((PASS_CNT + FAIL_CNT))" 40 | echo "# PASS: $PASS_CNT" 41 | echo "# FAIL: $FAIL_CNT ($FAILED)" 42 | echo "###########################" 43 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.33.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "BPF Compiler Collection (BCC)" 2 | HOMEPAGE = "https://github.com/iovisor/bcc" 3 | LICENSE = "Apache-2.0" 4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" 5 | 6 | inherit cmake python3native manpages ptest 7 | 8 | DEPENDS += "bison-native \ 9 | flex-native \ 10 | zip-native \ 11 | flex \ 12 | elfutils \ 13 | clang \ 14 | libbpf \ 15 | python3-setuptools-native \ 16 | " 17 | 18 | RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" 19 | RDEPENDS:${PN}-ptest = "kernel-devsrc packagegroup-core-buildessential cmake python3 python3-netaddr python3-pyroute2" 20 | 21 | SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ 22 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ 23 | file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ 24 | file://0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch \ 25 | file://run-ptest \ 26 | file://ptest_wrapper.sh \ 27 | file://bpf_stack_id.patch \ 28 | " 29 | 30 | SRCREV = "92e32ff8a06616779f3a3191b75da6881d59fd17" 31 | 32 | PV .= "+git" 33 | 34 | S = "${WORKDIR}/git" 35 | 36 | PACKAGECONFIG ??= "examples" 37 | PACKAGECONFIG:remove:libc-musl = "examples" 38 | 39 | PACKAGECONFIG[manpages] = "-DENABLE_MAN=ON,-DENABLE_MAN=OFF," 40 | PACKAGECONFIG[examples] = "-DENABLE_EXAMPLES=ON,-DENABLE_EXAMPLES=OFF," 41 | 42 | EXTRA_OECMAKE = " \ 43 | -DREVISION='${PV}' \ 44 | -DCMAKE_USE_LIBBPF_PACKAGE=ON \ 45 | -DENABLE_LLVM_SHARED=ON \ 46 | -DENABLE_CLANG_JIT=ON \ 47 | -DPY_SKIP_DEB_LAYOUT=ON \ 48 | -DPYTHON_CMD=${PYTHON} \ 49 | -DPYTHON_FLAGS=--install-lib=${PYTHON_SITEPACKAGES_DIR} \ 50 | " 51 | 52 | # Avoid stripping debuginfo.so to fix some tests. 53 | INHIBIT_PACKAGE_STRIP = "1" 54 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" 55 | 56 | do_install:append() { 57 | sed -e 's@#!/usr/bin/env python@#!/usr/bin/env python3@g' \ 58 | -i $(find ${D}${datadir}/${PN} -type f) 59 | sed -e 's@#!/usr/bin/python.*@#!/usr/bin/env python3@g' \ 60 | -i $(find ${D}${datadir}/${PN} -type f) 61 | rm -rf ${D}${datadir}/bcc/examples/lua 62 | } 63 | 64 | do_install_ptest() { 65 | install -d ${D}${PTEST_PATH}/tests/cc 66 | # ptest searches for shared libs and archive files in the build folder. 67 | # Hence, these files are copied to the image to fix these tests. 68 | install -d ${D}${B}/tests/cc 69 | install ${B}/tests/cc/archive.zip ${B}/tests/cc/libdebuginfo_test_lib.so ${B}/tests/cc/with_gnu_debuglink.so ${B}/tests/cc/with_gnu_debugdata.so ${B}/tests/cc/debuginfo.so ${D}${B}/tests/cc 70 | install -d ${D}/opt 71 | install ${B}/tests/cc/test_libbcc_no_libbpf ${B}/tests/cc/libusdt_test_lib.so ${D}${PTEST_PATH}/tests/cc 72 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python 73 | install ${UNPACKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests 74 | install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python 75 | } 76 | 77 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" 78 | FILES:${PN} += "${B}/tests/cc" 79 | FILES:${PN}-ptest += "/opt/" 80 | FILES:${PN}-doc += "${datadir}/${PN}/man" 81 | 82 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" 83 | 84 | # WARNING: bcc-0.30.0+git-r0 do_package_qa: QA Issue: File /usr/lib/bcc/ptest/tests/cc/test_libbcc_no_libbpf in package bcc-ptest contains reference to TMPDIR [buildpaths] 85 | # this one is difficult to resolve, because the tests use CMAKE_CURRENT_BINARY_DIR directly in .cc e.g.: 86 | # https://github.com/iovisor/bcc/commit/7271bfc946a19413761be2e3c60c48bf72c5eea1#diff-233a0bfa490f3d7466c49935b64c86dd93956bbc0461f5af703b344cf6601461 87 | # we would probably need to use separate variable for "runtime" path for test assets from the standard CMAKE_CURRENT_BINARY_DIR variable or use relative 88 | # path from the test binary 89 | WARN_QA:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' buildpaths', '', d)}" 90 | ERROR_QA:remove = "${@bb.utils.contains('PTEST_ENABLED', '1', 'buildpaths', '', d)}" 91 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Fix-build-failures-due-to-missing-location.hh.patch: -------------------------------------------------------------------------------- 1 | From 24421ba92c69f1abaadaff01270621917616a2b8 Mon Sep 17 00:00:00 2001 2 | From: Changqing Li 3 | Date: Thu, 17 Apr 2025 10:38:50 +0800 4 | Subject: [PATCH] Fix build failures due to missing location.hh 5 | 6 | ast/location.h does `#include "location.hh"` and location.hh is 7 | generated by the parser so any CMake target whose source includes 8 | ast/location.h needs to have a dependency on the `parser` target, 9 | otherwise the compilation may fail due to incorrect ordering of build 10 | targets. This also applies to targets which include ast/location.h 11 | transitively via other headers. 12 | 13 | To avoid such errors, do 2 things: 14 | - drop includes of ast/location.h where unused 15 | - for CMake targets including ast/location.h, add an explicit dependency 16 | on the `parser` target 17 | 18 | Signed-off-by: Viktor Malik 19 | 20 | Upstream-Status: Backport [https://github.com/bpftrace/bpftrace/commit/743cb9c88c25fb9737d714f4d4ac853f05bb6481] 21 | 22 | Signed-off-by: Changqing Li 23 | --- 24 | src/CMakeLists.txt | 1 + 25 | src/ast/CMakeLists.txt | 1 + 26 | 2 files changed, 2 insertions(+) 27 | 28 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 29 | index e04ee429..13a51040 100644 30 | --- a/src/CMakeLists.txt 31 | +++ b/src/CMakeLists.txt 32 | @@ -21,6 +21,7 @@ add_library(compiler_core STATIC 33 | struct.cpp 34 | types.cpp 35 | ) 36 | +add_dependencies(compiler_core parser) 37 | 38 | add_library(runtime STATIC 39 | attached_probe.cpp 40 | diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt 41 | index 92231f85..7230cf71 100644 42 | --- a/src/ast/CMakeLists.txt 43 | +++ b/src/ast/CMakeLists.txt 44 | @@ -22,6 +22,7 @@ add_library(ast STATIC 45 | passes/return_path_analyser.cpp 46 | ) 47 | 48 | +add_dependencies(ast parser) 49 | target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS}) 50 | target_link_libraries(ast PUBLIC ast_defs arch compiler_core parser) 51 | 52 | -- 53 | 2.34.1 54 | 55 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch: -------------------------------------------------------------------------------- 1 | From ce5d908bb1256ede680fbfd521f087060a567dca Mon Sep 17 00:00:00 2001 2 | From: Martin Jansa 3 | Date: Tue, 3 Sep 2024 14:17:51 +0200 4 | Subject: [PATCH] CMakeLists.txt: allow to set BISON_FLAGS like -l 5 | 6 | Signed-off-by: Martin Jansa 7 | 8 | Upstream-Status: Pending 9 | --- 10 | CMakeLists.txt | 10 +++++++--- 11 | 1 file changed, 7 insertions(+), 3 deletions(-) 12 | 13 | --- a/CMakeLists.txt 14 | +++ b/CMakeLists.txt 15 | @@ -100,16 +100,20 @@ include_directories(SYSTEM ${LIBCEREAL_I 16 | 17 | find_package(BISON REQUIRED) 18 | find_package(FLEX REQUIRED) 19 | + 20 | +# avoid buildpaths in generated #line statements and allow to pass --file-prefix-map=OLD=NEW 21 | +set(BISON_FLAGS "${BISON_FLAGS} -l") 22 | +set(FLEX_FLAGS "${FLEX_FLAGS} -L") 23 | # `parser_class_name` is deprecated and generates warnings in bison >= 3.3. 24 | # But `api.parser.class` is not supported in bison < 3.3. So we must inject 25 | # the %define based on the bison version here. 26 | if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.3) 27 | - set(BISON_FLAGS "-Dapi.parser.class={Parser}") 28 | + set(BISON_FLAGS "${BISON_FLAGS} -Dapi.parser.class={Parser}") 29 | else() 30 | - set(BISON_FLAGS "-Dparser_class_name={Parser}") 31 | + set(BISON_FLAGS "${BISON_FLAGS} -Dparser_class_name={Parser}") 32 | endif() 33 | bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc COMPILE_FLAGS ${BISON_FLAGS} VERBOSE) 34 | -flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) 35 | +flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc COMPILE_FLAGS ${FLEX_FLAGS}) 36 | add_flex_bison_dependency(flex_lexer bison_parser) 37 | add_library(parser STATIC ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) 38 | target_compile_options(parser PRIVATE "-w") 39 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/run-ptest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # The whole test suite may take up to 40 minutes to run, so setting -t 2400 4 | # parameter in ptest-runner is necessary to not kill it before completion 5 | 6 | cd tests || exit 1 7 | export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin/bpftrace 8 | export BPFTRACE_AOT_RUNTIME_TEST_EXECUTABLE=/usr/bin/bpftrace-aotrt 9 | 10 | PASS_CNT=0 11 | FAIL_CNT=0 12 | SKIP_CNT=0 13 | FAILED="" 14 | 15 | print_test_result() { 16 | if [ $? -eq 0 ]; then 17 | echo "PASS: $1" 18 | PASS_CNT=$((PASS_CNT + 1)) 19 | else 20 | echo "FAIL: $1" 21 | FAIL_CNT=$((FAIL_CNT + 1)) 22 | FAILED="${FAILED:+$FAILED }$1;" 23 | fi 24 | } 25 | 26 | IFS=$(printf '\n\t') 27 | # Start unit tests 28 | for test_name in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do 29 | ./bpftrace_test --gtest_filter="${test_name}*" > /dev/null 2>&1 30 | print_test_result "unit:$test_name" 31 | done 32 | 33 | # Start runtime tests 34 | for test_name in $(ls runtime); do 35 | # Ignore test cases that hang the suite forever (bpftrace v0.16.0) 36 | if [ "$test_name" = "signals" ] || [ "$test_name" = "watchpoint" ]; then 37 | echo "SKIP: runtime:$test_name" 38 | SKIP_CNT=$((SKIP_CNT + 1)) 39 | continue 40 | fi 41 | python3 runtime/engine/main.py --filter="${test_name}.*" > /dev/null 2>&1 42 | print_test_result "runtime:$test_name" 43 | done 44 | unset IFS 45 | 46 | echo "#### bpftrace tests summary ####" 47 | echo "# TOTAL: $((PASS_CNT + FAIL_CNT + SKIP_CNT))" 48 | echo "# PASS: $PASS_CNT" 49 | echo "# FAIL: $FAIL_CNT ($FAILED)" 50 | echo "# SKIP: $SKIP_CNT" 51 | echo "################################" 52 | -------------------------------------------------------------------------------- /dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "bpftrace" 2 | HOMEPAGE = "https://github.com/iovisor/bpftrace" 3 | LICENSE = "Apache-2.0" 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" 5 | 6 | DEPENDS += "bison-native \ 7 | flex-native \ 8 | gzip-native \ 9 | elfutils \ 10 | bcc \ 11 | systemtap \ 12 | libcereal \ 13 | libbpf \ 14 | " 15 | DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'pahole-native llvm-native', '', d)}" 16 | 17 | RDEPENDS:${PN} += "bash python3 xz" 18 | 19 | PV .= "+git" 20 | 21 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=release/0.23.x;protocol=https \ 22 | file://run-ptest \ 23 | file://0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch \ 24 | file://0001-Fix-build-failures-due-to-missing-location.hh.patch \ 25 | " 26 | SRCREV = "01e806d24c61f996f1809e1e991646311499db4f" 27 | 28 | S = "${WORKDIR}/git" 29 | 30 | inherit bash-completion cmake ptest pkgconfig 31 | 32 | PACKAGECONFIG ?= " \ 33 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \ 34 | ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)} \ 35 | " 36 | 37 | PACKAGECONFIG[tests] = "-DBUILD_TESTING=ON,-DBUILD_TESTING=OFF,gtest xxd-native" 38 | PACKAGECONFIG[systemd] = "-DENABLE_SYSTEMD=ON,-DENABLE_SYSTEMD=OFF,systemd" 39 | 40 | do_install_ptest() { 41 | if [ -e ${B}/tests/bpftrace_test ]; then 42 | install -Dm 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests/bpftrace_test 43 | cp -rf ${B}/tests/runtime ${D}${PTEST_PATH}/tests 44 | cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests 45 | fi 46 | } 47 | 48 | EXTRA_OECMAKE = " \ 49 | -DCMAKE_ENABLE_EXPORTS=1 \ 50 | -DCMAKE_BUILD_TYPE=Release \ 51 | -DUSE_SYSTEM_BPF_BCC=ON \ 52 | -DENABLE_MAN=OFF \ 53 | -DBISON_FLAGS='--file-prefix-map=${WORKDIR}=' \ 54 | " 55 | 56 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" 57 | COMPATIBLE_HOST:libc-musl = "null" 58 | 59 | INHIBIT_PACKAGE_STRIP_FILES += "\ 60 | ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \ 61 | " 62 | 63 | WARN_QA:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' buildpaths', '', d)}" 64 | ERROR_QA:remove = "${@bb.utils.contains('PTEST_ENABLED', '1', 'buildpaths', '', d)}" 65 | -------------------------------------------------------------------------------- /dynamic-layers/networking-layer/recipes-connectivity/samba/files/fix_duplicate_pdb_search_init.patch: -------------------------------------------------------------------------------- 1 | Do not match pdb init files 2 | 3 | Upstream-Status: Inappropriate [ Clang Specific ] 4 | Signed-off-by: Khem Raj 5 | --- a/source3/wscript_build 2019-03-14 09:03:29.498617250 +0100 6 | +++ b/source3/wscript_build 2019-03-14 09:06:19.824949694 +0100 7 | @@ -124,7 +124,6 @@ 8 | '!get_attr_list'] 9 | private_pdb_match.append('!pdb_nds_*') 10 | private_pdb_match.append('!pdb_ldapsam_init*') 11 | -private_pdb_match.append('!pdb_*_init') 12 | private_pdb_match = private_pdb_match + ldapsam_pdb_match 13 | 14 | bld.SAMBA3_LIBRARY('samba-passdb', 15 | -------------------------------------------------------------------------------- /dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://fix_duplicate_pdb_search_init.patch " 4 | -------------------------------------------------------------------------------- /dynamic-layers/openembedded-layer/recipes-devtools/bpftool/bpftool.bbappend: -------------------------------------------------------------------------------- 1 | RDEPENDS:${PN}:append:toolchain-clang = " clang-libllvm" 2 | -------------------------------------------------------------------------------- /dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend: -------------------------------------------------------------------------------- 1 | DEPENDS:append = " clang-native" 2 | DEPENDS:remove = "llvm-native" 3 | 4 | EXCLUDE_FROM_WORLD:forcevariable = "" 5 | -------------------------------------------------------------------------------- /dynamic-layers/qt5-layer/recipes-qt/qt5/qtpdf_%.bbappend: -------------------------------------------------------------------------------- 1 | # its needed to build gn-native which is embedded into 2 | # qtpdf directly 3 | inherit clang-native 4 | -------------------------------------------------------------------------------- /dynamic-layers/qt6-layer/recpes-qt/qt6/qtbase_%.bbappend: -------------------------------------------------------------------------------- 1 | PACKAGECONFIG:append:toolchain-clang = " use-lld-linker" 2 | -------------------------------------------------------------------------------- /dynamic-layers/qt6-layer/recpes-qt/qt6/qtwebengine_%.bbappend: -------------------------------------------------------------------------------- 1 | inherit clang-native 2 | -------------------------------------------------------------------------------- /images/Yocto_Project™_Badge_Compatible_Web_RGB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraj/meta-clang/02e254ba1fb4937530d94a154b4c713c904c2d06/images/Yocto_Project™_Badge_Compatible_Web_RGB.png -------------------------------------------------------------------------------- /recipes-connectivity/openssl/openssl_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | LDFLAGS:append:toolchain-clang:riscv32 = " -Wl,--no-relax" 4 | -------------------------------------------------------------------------------- /recipes-core/busybox/busybox/clang.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_EXTRA_CFLAGS="-DBB_GLOBAL_CONST=''" 2 | -------------------------------------------------------------------------------- /recipes-core/busybox/busybox_1.%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append:toolchain-clang = " file://clang.cfg" 4 | -------------------------------------------------------------------------------- /recipes-core/glib-2.0/glib-2.0/0001-Ignore-clang-warning-for-function-signature-match.patch: -------------------------------------------------------------------------------- 1 | From 591e8f449e81ae5cb69575eb2e09787b5e0e25cf Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Thu, 23 Feb 2023 14:23:28 -0800 4 | Subject: [PATCH] Ignore clang warning for function signature match 5 | 6 | vala generated code emits GTestDataFunc with gpointer and not 7 | gconstpointer and newer compilers e.g. clang16 can now find out 8 | incompatible-function-pointer-types, which makes code not compile 9 | 10 | Fixes 11 | test-vala-lang.c:1166:51: error: incompatible function pointer types passing 'void (gpointer)' (aka 'void (void *)') to parameter of type 'GTestDataFunc' (aka 'v 12 | oid (*)(const void *)') [-Wincompatible-function-pointer-types] 13 | | g_test_add_data_func ("/vala/lookup/sync", NULL, _test_lookup_sync_gtest_data_func); 14 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | 16 | Upstream-Status: Pending 17 | Signed-off-by: Khem Raj 18 | --- 19 | glib/gtestutils.h | 5 ++++- 20 | 1 file changed, 4 insertions(+), 1 deletion(-) 21 | 22 | diff --git a/glib/gtestutils.h b/glib/gtestutils.h 23 | index 86ee4e521..cc237b3f0 100644 24 | --- a/glib/gtestutils.h 25 | +++ b/glib/gtestutils.h 26 | @@ -34,7 +34,10 @@ 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | - 31 | +// TODO: This should really be fixed in vala perhaps see 32 | +// https://gitlab.gnome.org/GNOME/vala/-/issues/1413 33 | +// but it impacts almost 20 packages so workaround it here for now 34 | +#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types" 35 | typedef struct GTestCase GTestCase; 36 | typedef struct GTestSuite GTestSuite; 37 | typedef void (*GTestFunc) (void); 38 | -- 39 | 2.39.2 40 | 41 | -------------------------------------------------------------------------------- /recipes-core/glib-2.0/glib-2.0_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" 2 | 3 | SRC_URI:append:toolchain-clang = " file://0001-Ignore-clang-warning-for-function-signature-match.patch" 4 | 5 | CFLAGS:append:libc-musl = " -Wno-format-nonliteral" 6 | -------------------------------------------------------------------------------- /recipes-core/meta/clang-environment.inc: -------------------------------------------------------------------------------- 1 | export TARGET_CLANGCC_ARCH = "${TARGET_CC_ARCH}" 2 | TARGET_CLANGCC_ARCH:remove = "-mthumb-interwork" 3 | TARGET_CLANGCC_ARCH:remove = "-mmusl" 4 | TARGET_CLANGCC_ARCH:remove = "-muclibc" 5 | TARGET_CLANGCC_ARCH:remove = "-meb" 6 | TARGET_CLANGCC_ARCH:remove = "-mel" 7 | TARGET_CLANGCC_ARCH:append = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" 8 | TARGET_CLANGCC_ARCH:remove:powerpc = "-mhard-float" 9 | TARGET_CLANGCC_ARCH:remove:powerpc = "-mno-spe" 10 | 11 | create_sdk_files:append() { 12 | script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} 13 | if ${@bb.utils.contains('CLANGSDK', '1', 'true', 'false', d)}; then 14 | echo 'export CLANGCC="${TARGET_PREFIX}clang --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 15 | echo 'export CLANGCXX="${TARGET_PREFIX}clang++ --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 16 | echo 'export CLANGCPP="${TARGET_PREFIX}clang -E --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 17 | echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script 18 | fi 19 | } 20 | -------------------------------------------------------------------------------- /recipes-core/meta/meta-environment-extsdk.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | require clang-environment.inc 4 | -------------------------------------------------------------------------------- /recipes-core/meta/meta-environment.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | require clang-environment.inc 4 | -------------------------------------------------------------------------------- /recipes-core/musl/musl_%.bbappend: -------------------------------------------------------------------------------- 1 | DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}" 2 | DEPENDS:remove:toolchain-clang = "virtual/cross-cc" 3 | TOOLCHAIN:x86-x32 = "gcc" 4 | 5 | # crashes seen in malloc@plt 6 | # Dump of assembler code for function malloc@got.plt: 7 | # => 0x3f7fc2e8 <+0>: addis r27,r20,-22264 8 | 9 | TOOLCHAIN:powerpc = "gcc" 10 | -------------------------------------------------------------------------------- /recipes-core/ncurses/ncurses_%.bbappend: -------------------------------------------------------------------------------- 1 | CACHED_CONFIGUREVARS:append:toolchain-clang = " cf_cv_prog_CC_c_o=yes cf_cv_prog_CXX_c_o=yes" 2 | -------------------------------------------------------------------------------- /recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend: -------------------------------------------------------------------------------- 1 | RDEPENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang', '', d)}" 2 | -------------------------------------------------------------------------------- /recipes-core/packagegroups/packagegroup-core-buildessential.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | RDEPENDS:packagegroup-core-buildessential:append:toolchain-clang = " clang " 4 | -------------------------------------------------------------------------------- /recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend: -------------------------------------------------------------------------------- 1 | RRECOMMENDS:${PN}:append:toolchain-clang = "${@bb.utils.contains('CLANGSDK', '1', ' libcxx-dev libcxx-staticdev compiler-rt-dev compiler-rt-staticdev', '', d)}" 2 | -------------------------------------------------------------------------------- /recipes-core/packagegroups/packagegroup-cross-canadian.bbappend: -------------------------------------------------------------------------------- 1 | CLANGCROSSCANADIAN = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}" 2 | CLANGCROSSCANADIANDEPS += "${@all_multilib_tune_values(d, 'CLANGCROSSCANADIAN')}" 3 | RDEPENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', '${CLANGCROSSCANADIANDEPS}', '', d)}" 4 | -------------------------------------------------------------------------------- /recipes-devtools/castxml/castxml_0.6.11.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "C-family abstract syntax tree XML output tool." 2 | LICENSE = "Apache-2.0" 3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" 4 | 5 | SRC_URI = "git://github.com/CastXML/CastXML;protocol=https;branch=master" 6 | 7 | SRCREV = "f38c024b395187814f14f77974d8f5240bb2e71f" 8 | 9 | S = "${WORKDIR}/git" 10 | 11 | DEPENDS = "clang" 12 | inherit cmake pkgconfig python3native 13 | 14 | BBCLASSEXTEND = "native nativesdk" 15 | -------------------------------------------------------------------------------- /recipes-devtools/clang/common.inc: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/clang:" 2 | 3 | LIC_FILES_CHKSUM = "file://llvm/LICENSE.TXT;md5=${LLVMMD5SUM} \ 4 | file://clang/LICENSE.TXT;md5=${CLANGMD5SUM} \ 5 | " 6 | LICENSE = "Apache-2.0-with-LLVM-exception" 7 | 8 | # Snapshot 9 | #RELEASE ?= "a69568efe6c4972e71af295c6577b3412dd57c22" 10 | #BASEURI ?= "https://api.github.com/repos/llvm/llvm-project/tarball/${RELEASE};downloadfilename=llvm-${PV}-${RELEASE}.tar.gz" 11 | #SOURCEDIR ?= "llvm-llvm-project-${@'${RELEASE}'[0:7]}" 12 | #SRC_URI[sha256sum] = "aed4f66cd72867b36cc55a0588436933c3d58d3e61ca782b6bf57605d3fdcb09" 13 | 14 | # GA Release 15 | RELEASE ?= "${PV}" 16 | BASEURI ?= "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz" 17 | SOURCEDIR ?= "llvm-project-${PV}.src" 18 | SRC_URI[sha256sum] = "f0a4a240aabc9b056142d14d5478bb6d962aeac549cbd75b809f5499240a8b38" 19 | 20 | SRC_URI = "\ 21 | ${BASEURI} \ 22 | file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ 23 | file://0002-compiler-rt-support-a-new-embedded-linux-target.patch \ 24 | file://0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ 25 | file://0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ 26 | file://0005-llvm-allow-env-override-of-exe-and-libdir-path.patch \ 27 | file://0006-clang-driver-Check-sysroot-for-ldso-path.patch \ 28 | file://0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ 29 | file://0008-clang-Prepend-trailing-to-sysroot.patch \ 30 | file://0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ 31 | file://0010-clang-Define-releative-gcc-installation-dir.patch \ 32 | file://0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ 33 | file://0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ 34 | file://0013-Check-for-atomic-double-intrinsics.patch \ 35 | file://0014-cmake-Fix-configure-for-packages-using-find_package.patch \ 36 | file://0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ 37 | file://0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ 38 | file://0017-clang-Use-python3-in-python-scripts.patch \ 39 | file://0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ 40 | file://0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ 41 | file://0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ 42 | file://0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ 43 | file://0022-libunwind-Added-unw_backtrace-method.patch \ 44 | file://0023-clang-Do-not-use-install-relative-libc-headers.patch \ 45 | file://0024-Fix-lib-paths-for-OpenEmbedded-Host.patch \ 46 | file://0025-Correct-library-search-path-for-OpenEmbedded-Host.patch \ 47 | file://0026-lldb-Link-with-libatomic-on-x86.patch \ 48 | file://0027-compiler-rt-Enable-__int128-for-ppc32.patch \ 49 | file://0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ 50 | file://0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \ 51 | file://0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ 52 | file://0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ 53 | file://0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \ 54 | file://0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \ 55 | file://0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \ 56 | file://0035-compiler-rt-Do-not-pass-target-to-clang-compiler.patch \ 57 | file://0036-Fix-build-on-ppc64-musl.patch \ 58 | file://0037-clangd-Add-a-build-option-to-disable-building-dexp.patch \ 59 | file://0001-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch \ 60 | " 61 | # Fallback to no-PIE if not set 62 | GCCPIE ??= "" 63 | 64 | S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/${SOURCEDIR}" 65 | B ?= "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" 66 | 67 | # We need to ensure that for the shared work directory, the do_patch signatures match 68 | # The real WORKDIR location isn't a dependency for the shared workdir. 69 | src_patches[vardepsexclude] = "WORKDIR" 70 | should_apply[vardepsexclude] += "PN" 71 | 72 | BPN = "clang" 73 | -------------------------------------------------------------------------------- /recipes-devtools/gdb/gdb/0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch: -------------------------------------------------------------------------------- 1 | From 23ad5c62e3586a0ea734c191cbcbe71261747758 Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Mon, 19 Aug 2019 21:47:49 -0700 4 | Subject: [PATCH] gdb: Link with -latomic for riscv/clang alone 5 | 6 | Upstream-Status: Inappropriate [ meta-clang specific ] 7 | Signed-off-by: Khem Raj 8 | --- 9 | gdb/Makefile.in | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/gdb/Makefile.in b/gdb/Makefile.in 13 | index 762b32b..6e2a271 100644 14 | --- a/gdb/Makefile.in 15 | +++ b/gdb/Makefile.in 16 | @@ -1889,7 +1889,7 @@ gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(CDEPS) $(TDEPLIBS) 17 | $(SILENCE) rm -f gdb$(EXEEXT) 18 | $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ 19 | -o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \ 20 | - $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) 21 | + $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) -latomic $(LOADLIBES) 22 | ifneq ($(CODESIGN_CERT),) 23 | $(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT) 24 | endif 25 | -- 26 | 2.23.0 27 | 28 | -------------------------------------------------------------------------------- /recipes-devtools/gdb/gdb_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append:toolchain-clang:riscv64 = " file://0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch " 4 | -------------------------------------------------------------------------------- /recipes-devtools/include-what-you-use/include-what-you-use_0.23.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Include What You Use (IWYU) - Clang based checker for C/C++ header includes" 2 | DESCRIPTION = "For every symbol (type, function, variable, or macro) that you \ 3 | use in foo.cc (or foo.cpp), either foo.cc or foo.h should \ 4 | include a .h file that exports the declaration of that symbol." 5 | HOMEPAGE = "https://include-what-you-use.org" 6 | BUGTRACKER = "https://github.com/include-what-you-use/include-what-you-use/issues" 7 | LICENSE = "NCSA" 8 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=3bb66a14534286912cd6f26649b5c60a \ 9 | file://iwyu-check-license-header.py;md5=7bdb749831163fbe9232b3cb7186116f" 10 | 11 | DEPENDS = "clang" 12 | 13 | SRC_URI = "git://github.com/include-what-you-use/include-what-you-use.git;protocol=https;branch=master" 14 | SRCREV = "fa1094c0b3848f82244778bc6153cc84f8a890f6" 15 | 16 | PV .= "+git" 17 | 18 | S = "${WORKDIR}/git" 19 | 20 | inherit cmake python3native 21 | 22 | EXTRA_OECMAKE = "-DIWYU_RESOURCE_RELATIVE_TO=iwyu" 23 | 24 | FILES:${PN} += "${datadir}/${BPN}" 25 | 26 | BBCLASSEXTEND = "nativesdk" 27 | -------------------------------------------------------------------------------- /recipes-devtools/python/python3-cffi_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | # tests need compiler on target and they need the compiler which was 4 | # used to build python 5 | RDEPENDS:${PN}-ptest:append:toolchain-clang = " clang" 6 | -------------------------------------------------------------------------------- /recipes-devtools/python/python3_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | # tests need compiler on target and they need the compiler which was 4 | # used to build python 5 | RDEPENDS:${PN}-ptest:append:toolchain-clang = " clang" 6 | 7 | do_configure:prepend:class-target:toolchain-clang() { 8 | # We do not need --print-multiarch with clang since it prints wrong value 9 | sed -i -e 's#\[MULTIARCH=$($CC --print-multiarch 2>/dev/null)\]#\[MULTIARCH=""\]#g' ${S}/configure.ac 10 | } 11 | 12 | -------------------------------------------------------------------------------- /recipes-devtools/rpm/rpm_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | # Set until https://github.com/llvm/llvm-project/issues/82541 is fixed 4 | #DEPENDS:append:toolchain-clang = " openmp" 5 | DEPENDS:remove:toolchain-clang:riscv32 = "openmp" 6 | DEPENDS:remove:toolchain-clang:mipsarch = "openmp" 7 | DEPENDS:remove:toolchain-clang:powerpc = "openmp" 8 | 9 | # rpm needs OMP 10 | TOOLCHAIN:riscv32 = "gcc" 11 | TOOLCHAIN:mipsarch = "gcc" 12 | TOOLCHAIN:powerpc = "gcc" 13 | # Set until https://github.com/llvm/llvm-project/issues/82541 is fixed 14 | TOOLCHAIN = "gcc" 15 | LDFLAGS:remove = "-fuse-ld=lld" 16 | -------------------------------------------------------------------------------- /recipes-devtools/rust/rust-llvm_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | inherit clang-native 4 | -------------------------------------------------------------------------------- /recipes-devtools/rust/rust_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | inherit clang-native 4 | 5 | -------------------------------------------------------------------------------- /recipes-devtools/valgrind/valgrind_%.bbappend: -------------------------------------------------------------------------------- 1 | 2 | # Remove tests when using clang since, clang generates debug info 3 | # for asm files too, like freebsd outputs but we are on linux 4 | # and valgrind tests think its always using gcc on linux 5 | do_install_ptest:append:toolchain-clang () { 6 | if [ "${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'True', 'False', d)}" ] 7 | then 8 | rm ${D}${PTEST_PATH}/memcheck/tests/gone_abrt_xml.vgtest 9 | rm ${D}${PTEST_PATH}/memcheck/tests/threadname_xml.vgtest 10 | rm ${D}${PTEST_PATH}/drd/tests/annotate_barrier_xml.vgtest 11 | rm ${D}${PTEST_PATH}/none/tests/fdleak_cmsg.vgtest 12 | fi 13 | } 14 | -------------------------------------------------------------------------------- /recipes-extended/ghostscript/ghostscript_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | do_configure:prepend:toolchain-clang () { 4 | if ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'true', 'false', d)}; then 5 | sed -i -e "s|-stdlib=libstdc++|-stdlib=libc++|g" ${S}/configure.ac 6 | fi 7 | } 8 | -------------------------------------------------------------------------------- /recipes-extended/mdadm/mdadm_%.bbappend: -------------------------------------------------------------------------------- 1 | # Fix errors like 2 | # | super-intel.c:1673:23: error: taking address of packed member 'size_high' of class or structure 'imsm_dev' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] 3 | # | &dev->size_low, &dev->size_high); 4 | # | ^~~~~~~~~~~~~~ 5 | 6 | CFLAGS:append:toolchain-clang = " -Wno-error=address-of-packed-member" 7 | -------------------------------------------------------------------------------- /recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch: -------------------------------------------------------------------------------- 1 | Disable fpu using code when using clang/mips64 combo 2 | it works around clang's inline asm error 3 | 4 | error: couldn't allocate output register for constraint 'r' 5 | 6 | Upstream-Status: Pending 7 | Signed-off-by: Khem Raj 8 | 9 | --- a/libavcodec/mips/aacdec_mips.c 10 | +++ b/libavcodec/mips/aacdec_mips.c 11 | @@ -282,7 +282,7 @@ static void apply_ltp_mips(AACContext *a 12 | } 13 | } 14 | 15 | -#if HAVE_MIPSFPU 16 | +#if HAVE_MIPSFPU && !defined(__clang__) 17 | static av_always_inline void fmul_and_reverse(float *dst, const float *src0, const float *src1, int count) 18 | { 19 | /* Multiply 'count' floats in src0 by src1 and store the results in dst in reverse */ 20 | @@ -435,7 +435,7 @@ void ff_aacdec_init_mips(AACContext *c) 21 | #if HAVE_INLINE_ASM 22 | c->imdct_and_windowing = imdct_and_windowing_mips; 23 | c->apply_ltp = apply_ltp_mips; 24 | -#if HAVE_MIPSFPU 25 | +#if HAVE_MIPSFPU && !defined(__clang__) 26 | c->update_ltp = update_ltp_mips; 27 | #endif /* HAVE_MIPSFPU */ 28 | #endif /* HAVE_INLINE_ASM */ 29 | -------------------------------------------------------------------------------- /recipes-multimedia/ffmpeg/ffmpeg_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append:toolchain-clang:mips64 = " file://clang_mips64.patch" 4 | -------------------------------------------------------------------------------- /recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch: -------------------------------------------------------------------------------- 1 | From 91c980d4cf88b0c12fe5971fe16c7b97b5a942af Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Tue, 17 Dec 2019 14:57:55 -0800 4 | Subject: [PATCH] Disable fpu using code when using clang/mips64 combo 5 | 6 | it works around clang's inline asm error 7 | 8 | error: couldn't allocate output register for constraint 'r' 9 | 10 | Upstream-Status: Pending 11 | Signed-off-by: Khem Raj 12 | --- 13 | gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c | 4 ++-- 14 | 1 file changed, 2 insertions(+), 2 deletions(-) 15 | 16 | diff --git a/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c b/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c 17 | index 253cdeb..df4f25d 100644 18 | --- a/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c 19 | +++ b/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c 20 | @@ -282,7 +282,7 @@ static void apply_ltp_mips(AACContext *ac, SingleChannelElement *sce) 21 | } 22 | } 23 | 24 | -#if HAVE_MIPSFPU 25 | +#if HAVE_MIPSFPU && !defined(__clang__) 26 | static av_always_inline void fmul_and_reverse(float *dst, const float *src0, const float *src1, int count) 27 | { 28 | /* Multiply 'count' floats in src0 by src1 and store the results in dst in reverse */ 29 | @@ -435,7 +435,7 @@ void ff_aacdec_init_mips(AACContext *c) 30 | #if HAVE_INLINE_ASM 31 | c->imdct_and_windowing = imdct_and_windowing_mips; 32 | c->apply_ltp = apply_ltp_mips; 33 | -#if HAVE_MIPSFPU 34 | +#if HAVE_MIPSFPU && !defined(__clang__) 35 | c->update_ltp = update_ltp_mips; 36 | #endif /* HAVE_MIPSFPU */ 37 | #endif /* HAVE_INLINE_ASM */ 38 | -- 39 | 2.24.1 40 | 41 | -------------------------------------------------------------------------------- /recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append:toolchain-clang:mips64 = " file://0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch" 4 | 5 | -------------------------------------------------------------------------------- /recipes-multimedia/libvorbis/libvorbis_%.bbappend: -------------------------------------------------------------------------------- 1 | # | clang-7: error: unknown argument: '-mfused-madd' 2 | do_configure:prepend:toolchain-clang() { 3 | sed -i -e "s/-mfused-madd//g" ${S}/configure.ac 4 | } 5 | -------------------------------------------------------------------------------- /recipes-support/libunwind/libunwind_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | COMPATIBLE_HOST:runtime-llvm = "null" 4 | -------------------------------------------------------------------------------- /scripts/devtool-clang.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Clone the repository first if not already done locally 3 | # git clone https://github.com/kraj/llvm-project -b oe/main /mnt/b/yoe/master/workspace/sources/llvm-project 4 | # 5 | # if local repository exists then make a clone/copy 6 | # git clone /home/kraj/work/llvm-project /mnt/b/yoe/master/workspace/sources/llvm-project 7 | # 8 | layerloc="$(dirname "$0")/../conf/layer.conf" 9 | workspace="$(dirname "$0")/../../../workspace" 10 | 11 | # Change target and SDK host as needed 12 | target=riscv64 13 | sdkhost=x86_64 14 | 15 | origver=$(grep "LLVMVERSION =" < "$layerloc" | awk '{print $3}' | tr -d '"') 16 | 17 | major=$(grep -e "set(LLVM_VERSION_MAJOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//") 18 | minor=$(grep -e "set(LLVM_VERSION_MINOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//") 19 | patch=$(grep -e "set(LLVM_VERSION_PATCH [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//") 20 | 21 | recipes="\ 22 | llvm-project-source-$origver \ 23 | clang \ 24 | clang-cross-$target \ 25 | clang-crosssdk-$sdkhost \ 26 | clang-cross-canadian-$target \ 27 | nativesdk-clang-glue \ 28 | compiler-rt \ 29 | compiler-rt-sanitizers \ 30 | libclc \ 31 | libcxx \ 32 | openmp \ 33 | " 34 | 35 | for recipe in $recipes; do 36 | devtool modify -n "$recipe" "$workspace/sources/llvm-project" 37 | sed -i "/pn-$recipe /p;s/pn-$recipe /pn-nativesdk-$recipe /g" "$workspace"/appends/"$recipe"*.bbappend 38 | sed -i "/pn-$recipe /p;s/pn-$recipe /pn-$recipe-native /g" "$workspace"/appends/"$recipe"*.bbappend 39 | done 40 | 41 | for f in "$workspace"/appends/*.bbappend; do 42 | { echo "MAJOR_VER = \"$major\"" ; echo "MINOR_VER = \"$minor\"" ; echo "PATCH_VER = \"$patch\"" ; } >> "$f" 43 | done 44 | 45 | sed -i -e "s/$origver/$major.$minor.$patch/g" "$workspace"/appends/llvm-project-source.bbappend 46 | sed -i -e "s/:pn-clang-cross-$target//g" "$workspace"/appends/clang-cross_git.bbappend 47 | sed -i -e "s/:pn-clang-cross-canadian-$target//g" "$workspace"/appends/clang-cross-canadian_git.bbappend 48 | sed -i -e "s/:pn-clang-crosssdk-$sdkhost//g" "$workspace"/appends/clang-crosssdk_git.bbappend 49 | --------------------------------------------------------------------------------