diff --git a/.github/workflows/yoe.yml b/.github/workflows/yoe.yml index ca2885b0..133f74bf 100644 --- a/.github/workflows/yoe.yml +++ b/.github/workflows/yoe.yml @@ -50,7 +50,7 @@ jobs: echo BB_NUMBER_THREADS = \"16\" >> conf/local.conf echo PARALLEL_MAKE = \"-j 32\" >> conf/local.conf echo CLANGSDK = \"1\" >> conf/local.conf - echo IMAGE_INSTALL_append = \" clang \" >> conf/local.conf + echo IMAGE_INSTALL:append = \" clang \" >> conf/local.conf echo XZ_DEFAULTS = \"--threads=8\" >> conf/local.conf echo SDKMACHINE = \"aarch64\" >> conf/local.conf /bin/bash -c "sed -i -e 's/PACKAGE_FEED_URI.*$//' conf/site.conf" @@ -67,7 +67,7 @@ jobs: run: | cd yoe export DISPLAY=":0" - echo TESTIMAGE_AUTO_qemuall = \"1\" >> conf/local.conf + echo TESTIMAGE_AUTO:qemuall = \"1\" >> conf/local.conf /bin/bash -c ". ./qemuarm64-envsetup.sh && bitbake yoe-sdk-image" - name: Prepare results run: | diff --git a/README.md b/README.md index eddf5484..61dffaf3 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ in `local.conf`. You can select libstdc++ per package too by writing bbappends for them containing ```shell -LIBCPLUSPLUS_toolchain-clang_pn- = "-stdlibc=libc++" +LIBCPLUSPLUS:toolchain-clang:pn- = "-stdlibc=libc++" ``` Defaults are chosen to be GNU for maximum compatibility with existing GNU systems. Its always good to use single runtime on a system, mixing runtimes can cause complications during @@ -119,7 +119,7 @@ Few components do not build with clang, if you have a component to add to that l simply add it to `conf/nonclangable.inc` e.g. ```shell -TOOLCHAIN_pn- = "gcc" +TOOLCHAIN:pn- = "gcc" ``` and OE will start using gcc to cross compile that recipe. @@ -127,7 +127,7 @@ and OE will start using gcc to cross compile that recipe. if a component does not build with libc++, you can add it to `conf/nonclangable.inc` e.g. ```shell -CXX_remove_pn-_toolchain-clang = " -stdlib=libc++ " +CXX:remove:pn-:toolchain-clang = " -stdlib=libc++ " ``` # compiler-rt failing in do_configure with custom TARGET_VENDOR diff --git a/classes/clang.bbclass b/classes/clang.bbclass index e6090612..74226089 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass @@ -1,115 +1,155 @@ # Add the necessary override -CCACHE_COMPILERCHECK_toolchain-clang ?= "%compiler% -v" -HOST_CC_ARCH_prepend_toolchain-clang = "-target ${HOST_SYS} " -CC_toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" -CXX_toolchain-clang = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" -CPP_toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E" -CCLD_toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" -RANLIB_toolchain-clang = "${HOST_PREFIX}llvm-ranlib" -AR_toolchain-clang = "${HOST_PREFIX}llvm-ar" -NM_toolchain-clang = "${HOST_PREFIX}llvm-nm" - -LTO_toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}" -PACKAGE_DEBUG_SPLIT_STYLE_toolchain-clang = "debug-without-src" - -COMPILER_RT ??= "${@bb.utils.contains("RUNTIME", "llvm", "-rtlib=compiler-rt ${UNWINDLIB}", "", d)}" -COMPILER_RT_powerpc = "-rtlib=libgcc ${UNWINDLIB}" -COMPILER_RT_armeb = "-rtlib=libgcc ${UNWINDLIB}" - -UNWINDLIB ??= "${@bb.utils.contains("RUNTIME", "llvm", "--unwindlib=libgcc", "", d)}" -UNWINDLIB_riscv64 = "--unwindlib=libgcc" -UNWINDLIB_riscv32 = "--unwindlib=libgcc" -UNWINDLIB_powerpc = "--unwindlib=libgcc" -UNWINDLIB_armeb = "--unwindlib=libgcc" - -LIBCPLUSPLUS ??= "${@bb.utils.contains("RUNTIME", "llvm", "-stdlib=libc++", "", d)}" - -TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}" -TUNE_CCARGS_append_toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}" - -TUNE_CCARGS_remove_toolchain-clang = "-meb" -TUNE_CCARGS_remove_toolchain-clang = "-mel" -TUNE_CCARGS_append_toolchain-clang = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" +CCACHE_COMPILERCHECK:toolchain-clang ?= "%compiler% -v" +HOST_CC_ARCH:prepend:toolchain-clang = "-target ${HOST_SYS} " +CC:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +CXX:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +CPP:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E" +CCLD:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +RANLIB:toolchain-clang = "${HOST_PREFIX}llvm-ranlib" +AR:toolchain-clang = "${HOST_PREFIX}llvm-ar" +NM:toolchain-clang = "${HOST_PREFIX}llvm-nm" +OBJDUMP:toolchain-clang = "${HOST_PREFIX}llvm-objdump" +OBJCOPY:toolchain-clang = "${HOST_PREFIX}llvm-objcopy" +STRIP:toolchain-clang = "${HOST_PREFIX}llvm-strip" +STRINGS:toolchain-clang = "${HOST_PREFIX}llvm-strings" +READELF:toolchain-clang = "${HOST_PREFIX}llvm-readelf" +# see https://github.com/llvm/llvm-project/issues/53996 +OBJDUMP:mips:toolchain-clang = "${HOST_PREFIX}objdump" +OBJDUMP:mipsel:toolchain-clang = "${HOST_PREFIX}objdump" + +LTO:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}" +PACKAGE_DEBUG_SPLIT_STYLE:toolchain-clang = "debug-without-src" + +COMPILER_RT ??= "" +COMPILER_RT:class-native = "-rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT:armeb = "-rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT:libc-klibc = "-rtlib=libgcc ${UNWINDLIB}" + +UNWINDLIB ??= "" +UNWINDLIB:class-native = "--unwindlib=libgcc" +UNWINDLIB:armeb = "--unwindlib=libgcc" +UNWINDLIB_libc-klibc = "--unwindlib=libgcc" + +LIBCPLUSPLUS ??= "" +LIBCPLUSPLUS:armv5 = "-stdlib=libstdc++" + +CXXFLAGS:append:toolchain-clang = " ${LIBCPLUSPLUS}" +LDFLAGS:append:toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}" + +TUNE_CCARGS:remove:toolchain-clang = "-meb" +TUNE_CCARGS:remove:toolchain-clang = "-mel" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" # Clang does not yet support big.LITTLE performance tunes, so use the LITTLE for tunes -TUNE_CCARGS_remove_toolchain-clang = "-mtune=cortex-a57.cortex-a53 -mtune=cortex-a72.cortex-a53 -mtune=cortex-a15.cortex-a7 -mtune=cortex-a17.cortex-a7 -mtune=cortex-a72.cortex-a35 -mtune=cortex-a73.cortex-a53 -mtune=cortex-a75.cortex-a55 -mtune=cortex-a76.cortex-a55" -TUNE_CCARGS_append_toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa53 cortexa57-cortexa53 cortexa73-cortexa53", " -mcpu=cortex-a53", "", d)}" -TUNE_CCARGS_append_toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa15-cortexa7 cortexa17-cortexa7", " -mcpu=cortex-a7", "", d)}" -TUNE_CCARGS_append_toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa35", " -mcpu=cortex-a35", "", d)}" -TUNE_CCARGS_append_toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa75-cortex-a55 cortexa76-cortex-a55", " -mcpu=cortex-a55", "", d)}" +TUNE_CCARGS:remove:toolchain-clang = "-mtune=cortex-a57.cortex-a53 -mtune=cortex-a72.cortex-a53 -mtune=cortex-a15.cortex-a7 -mtune=cortex-a17.cortex-a7 -mtune=cortex-a72.cortex-a35 -mtune=cortex-a73.cortex-a53 -mtune=cortex-a75.cortex-a55 -mtune=cortex-a76.cortex-a55" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa53 cortexa57-cortexa53 cortexa73-cortexa53", " -mcpu=cortex-a53", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa15-cortexa7 cortexa17-cortexa7", " -mcpu=cortex-a7", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa35", " -mcpu=cortex-a35", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa75-cortexa55 cortexa76-cortexa55", " -mcpu=cortex-a55", "", d)}" # Clang does not support octeontx2 processor -TUNE_CCARGS_remove_toolchain-clang = "-mcpu=octeontx2" +TUNE_CCARGS:remove:toolchain-clang = "-mcpu=octeontx2" # LLD does not yet support relaxation for RISCV e.g. https://reviews.freebsd.org/D25210 -TUNE_CCARGS_append_toolchain-clang_riscv32 = " -mno-relax" -TUNE_CCARGS_append_toolchain-clang_riscv64 = " -mno-relax" - -TUNE_CCARGS_remove_toolchain-clang_powerpc = "-mhard-float" -TUNE_CCARGS_remove_toolchain-clang_powerpc = "-mno-spe" - -TUNE_CCARGS_append_toolchain-clang = " -Qunused-arguments" -TUNE_CCARGS_append_toolchain-clang_libc-musl_powerpc64 = " -mlong-double-64" -TUNE_CCARGS_append_toolchain-clang_libc-musl_powerpc64le = " -mlong-double-64" +TUNE_CCARGS:append:toolchain-clang:riscv32 = " -mno-relax" +TUNE_CCARGS:append:toolchain-clang:riscv64 = " -mno-relax" + +# Reconcile some ppc anamolies +TUNE_CCARGS:remove:toolchain-clang:powerpc = "-mhard-float -mno-spe" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64 = " -mlong-double-64" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64le = " -mlong-double-64" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64" # usrmerge workaround -TUNE_CCARGS_append_toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}" + +TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments" -LDFLAGS_append_toolchain-clang_class-nativesdk_x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2" -LDFLAGS_append_toolchain-clang_class-nativesdk_x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2" -LDFLAGS_append_toolchain-clang_class-nativesdk_aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1" +LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2" +LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2" +LDFLAGS:append:toolchain-clang:class-nativesdk:aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1" -LDFLAGS_toolchain-clang_class-nativesdk = "${BUILDSDK_LDFLAGS} \ +LDFLAGS:toolchain-clang:class-nativesdk = "${BUILDSDK_LDFLAGS} \ -Wl,-rpath-link,${STAGING_LIBDIR}/.. \ -Wl,-rpath,${libdir}/.. " # Enable lld globally" -LDFLAGS_append_toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=lld', '', d)}" +LDFLAGS:append:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=lld', '', d)}" # choose between 'gcc' 'clang' an empty '' can be used as well TOOLCHAIN ??= "gcc" # choose between 'gnu' 'llvm' RUNTIME ??= "gnu" -RUNTIME_toolchain-gcc = "gnu" -RUNTIME_armeb = "gnu" +#RUNTIME:toolchain-gcc = "gnu" +RUNTIME:armeb = "gnu" +RUNTIME:armv5 = "gnu" -TOOLCHAIN_class-native = "gcc" -TOOLCHAIN_class-nativesdk = "gcc" -TOOLCHAIN_class-cross-canadian = "gcc" -TOOLCHAIN_class-crosssdk = "gcc" -TOOLCHAIN_class-cross = "gcc" +TOOLCHAIN:class-native = "gcc" +TOOLCHAIN:class-nativesdk = "gcc" +TOOLCHAIN:class-cross-canadian = "gcc" +TOOLCHAIN:class-crosssdk = "gcc" +TOOLCHAIN:class-cross = "gcc" OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}" OVERRIDES =. "${@['', 'runtime-${RUNTIME}:']['${RUNTIME}' != '']}" OVERRIDES[vardepsexclude] += "TOOLCHAIN RUNTIME" -#DEPENDS_append_toolchain-clang_class-target = " clang-cross-${TARGET_ARCH} " -#DEPENDS_remove_toolchain-clang_allarch = "clang-cross-${TARGET_ARCH}" + +YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config" +YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}" + +#YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target[export] = "1" +#YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target[export] = "1" + +#DEPENDS:append:toolchain-clang:class-target = " clang-cross-${TARGET_ARCH} " +#DEPENDS:remove:toolchain-clang:allarch = "clang-cross-${TARGET_ARCH}" def clang_base_deps(d): if not d.getVar('INHIBIT_DEFAULT_DEPS', False): if not oe.utils.inherits(d, 'allarch') : - ret = " clang-cross-${TARGET_ARCH} virtual/libc " - if (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): + ret = " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc " + if (d.getVar('RUNTIME').find('android') != -1): + ret += " libcxx" + return ret + if (d.getVar('RUNTIME').find('llvm') != -1): + ret += " compiler-rt" + elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): ret += " compiler-rt " else: ret += " libgcc " - if (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): + if (d.getVar('RUNTIME').find('llvm') != -1): + ret += " libcxx" + elif (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): ret += " libcxx " - if (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1): + elif (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1): ret += " libcxx " else: ret += " virtual/${TARGET_PREFIX}compilerlibs " return ret return "" -BASE_DEFAULT_DEPS_toolchain-clang_class-target = "${@clang_base_deps(d)}" +BASE_DEFAULT_DEPS:toolchain-clang:class-target = "${@clang_base_deps(d)}" +BASE_DEFAULT_DEPS:append:class-native:toolchain-clang:runtime-llvm = " libcxx-native compiler-rt-native" +BASE_DEFAULT_DEPS:append:class-nativesdk:toolchain-clang:runtime-llvm = " clang-native nativesdk-libcxx nativesdk-compiler-rt" + +# do_populate_sysroot needs STRIP +POPULATESYSROOTDEPS:toolchain-clang:class-target = "${MLPREFIX}clang-cross-${TARGET_ARCH}:do_populate_sysroot" -cmake_do_generate_toolchain_file_append_toolchain-clang () { +cmake_do_generate_toolchain_file:append:toolchain-clang () { cat >> ${WORKDIR}/toolchain.cmake <max_response_quads]; #| ^ #| 1 error generated. -TOOLCHAIN_pn-libdc1394 = "gcc" +TOOLCHAIN:pn-libdc1394 = "gcc" # error: return address can be determined only for current frame -TOOLCHAIN_pn-libexecinfo_mipsarch = "gcc" -TOOLCHAIN_pn-libgcc = "gcc" -TOOLCHAIN_pn-libgcc-initial = "gcc" -TOOLCHAIN_pn-libgfortran = "gcc" -TOOLCHAIN_pn-libssp-nonshared = "gcc" - -# Dunfell is not affected by the ell and iwd breakages. -# Once we update past dunfell, patches to fix it properly -# can be found in OpenMandriva packages. -# ell 0.39 introduced nested functions sadly -#TOOLCHAIN_pn-ell = "gcc" -# iwd 1.13 introduced nested functions sadly -#TOOLCHAIN_pn-iwd = "gcc" - -#| cargo:warning=/mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/libstd-rs/1.27.1-r0/re -#cipe-sysroot/usr/include/bits/stdlib.h:90:3: error: "Assumed value of MB_LEN_MAX wrong" -#| cargo:warning=# error "Assumed value of MB_LEN_MAX wrong" -#| cargo:warning= ^ -TOOLCHAIN_pn-libstd-rs = "gcc" -TOOLCHAIN_pn-m4_powerpc = "gcc" +TOOLCHAIN:pn-libexecinfo:mipsarch = "gcc" +TOOLCHAIN:pn-libgcc = "gcc" +TOOLCHAIN:pn-libgcc-initial = "gcc" +TOOLCHAIN:pn-libgfortran = "gcc" +TOOLCHAIN:pn-libssp-nonshared = "gcc" + +TOOLCHAIN:pn-m4:powerpc = "gcc" # clang does not have 64bit atomics on mips32 -#TOOLCHAIN_pn-mesa_mips = "gcc" -#TOOLCHAIN_pn-mesa_mipsel = "gcc" -TOOLCHAIN_pn-mesa_riscv64 = "gcc" -TOOLCHAIN_pn-mesa_powerpc = "gcc" +#TOOLCHAIN:pn-mesa:mips = "gcc" +#TOOLCHAIN:pn-mesa:mipsel = "gcc" +TOOLCHAIN:pn-mesa:riscv64 = "gcc" +TOOLCHAIN:pn-mesa:powerpc = "gcc" # variant-impl.hpp:309:36: error: 'is_variant' does not name a template but is followed by template arguments -TOOLCHAIN_pn-omxplayer = "gcc" +TOOLCHAIN:pn-omxplayer = "gcc" # error: return address can be determined only for current frame -TOOLCHAIN_pn-openflow_mipsarch = "gcc" -TOOLCHAIN_pn-opensbi = "gcc" -TOOLCHAIN_pn-openjdk-8 = "gcc" -TOOLCHAIN_pn-openjre-8 = "gcc" -TOOLCHAIN_pn-piglit = "gcc" -TOOLCHAIN_pn-prelink = "gcc" -# Qemu cant run profile tests run during build -# | *** stack smashing detected ***: terminated -# | ./pgo-wrapper: line 3: 3372346 Aborted -#TOOLCHAIN_pn-python3 = "gcc" -# has dpkg source which does not compile -TOOLCHAIN_pn-start-stop-daemon = "gcc" -TOOLCHAIN_pn-syslinux = "gcc" -TOOLCHAIN_pn-systemtap = "gcc" +TOOLCHAIN:pn-openflow:mipsarch = "gcc" +TOOLCHAIN:pn-opensbi = "gcc" +TOOLCHAIN:pn-openjdk-8 = "gcc" +TOOLCHAIN:pn-openjre-8 = "gcc" +TOOLCHAIN:pn-syslinux = "gcc" +TOOLCHAIN:pn-systemtap = "gcc" # v4l-utils uses nested functions -TOOLCHAIN_pn-v4l-utils = "gcc" +TOOLCHAIN:pn-v4l-utils = "gcc" # uses C++ which clang does not like -TOOLCHAIN_pn-wvstreams = "gcc" -TOOLCHAIN_pn-wvdial = "gcc" +TOOLCHAIN:pn-wvstreams = "gcc" +TOOLCHAIN:pn-wvdial = "gcc" #| ../../mpfr-3.1.4/src/mul.c:324:11: error: invalid output constraint '=h' in asm #| umul_ppmm (tmp[1], tmp[0], MPFR_MANT (b)[0], MPFR_MANT (c)[0]); -TOOLCHAIN_pn-mpfr_mips = "gcc" -TOOLCHAIN_pn-mpfr_mips64 = "gcc" +TOOLCHAIN:pn-mpfr:mips = "gcc" +TOOLCHAIN:pn-mpfr:mips64 = "gcc" # #../../lib/libicui18n.so: undefined reference to `__atomic_fetch_sub_4' #../../lib/libicui18n.so: undefined reference to `__atomic_load_4' #../../lib/libicui18n.so: undefined reference to `__atomic_store_4' #../../lib/libicui18n.so: undefined reference to `__atomic_fetch_add_4' # -TOOLCHAIN_pn-icu_armv4 = "gcc" -TOOLCHAIN_pn-icu_armv5 = "gcc" +TOOLCHAIN:pn-icu:armv4 = "gcc" +TOOLCHAIN:pn-icu:armv5 = "gcc" #../../libgcrypt-1.6.5/mpi/mpih-div.c:98:3: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions -TOOLCHAIN_pn-libgcrypt_mips64 = "gcc" +TOOLCHAIN:pn-libgcrypt:mips64 = "gcc" # 32-bit assembly code in pixman uses gas specific extensions -CFLAGS_append_pn-pixman_toolchain-clang_arm = " -fno-integrated-as" +CFLAGS:append:pn-pixman:toolchain-clang:arm = " -fno-integrated-as" # debug information generated by clang 12 confuses the older # external gas version -DEBUG_FLAGS_remove_pn-pixman_toolchain-clang_arm = "-g" +DEBUG_FLAGS:remove:pn-pixman:toolchain-clang:arm = "-g" #recipe-sysroot/usr/include/mozjs-60/mozilla/Span.h:634:5: error: statement not allowed in constexpr function #| MOZ_RELEASE_ASSERT(aStart <= len && (aLength == dynamic_extent || #| ^ -#TOOLCHAIN_pn-polkit = "gcc" +#TOOLCHAIN:pn-polkit = "gcc" #| ./ports/linux/pseudo_wrappers.c:80:14: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] #| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); #| ^ #| ./ports/linux/pseudo_wrappers.c:80:57: error: use of unknown builtin '__builtin_apply_args' [-Wimplicit-function-declaration] #| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); +TOOLCHAIN:pn-pseudo = "gcc" + +#| checking for multiarch... riscv64-yoe-linux +#| configure: error: internal configure error for the platform triplet, please file a bug report +TOOLCHAIN:pn-python3:riscv64 = "gcc" +TOOLCHAIN:pn-python3:riscv32 = "gcc" +TOOLCHAIN:pn-python3:libc-musl = "gcc" +# Use until OE-core merges https://lists.openembedded.org/g/openembedded-core/message/164192 +TOOLCHAIN:pn-python3:aarch64 = "gcc" -TOOLCHAIN_pn-pseudo = "gcc" -#| ../../pulseaudio-10.0/src/pulsecore/mix_neon.c../../pulseaudio-10.0/src/pulsecore/sconv_neon.c:49::27: error: unknown register name 'q0' in asm -#| : "memory", "cc", "q0" /* clobber list */ -#| ^ -TOOLCHAIN_pn-pulseaudio_aarch64 = "gcc" # mix_neon.c:179:9: error: invalid operand in inline asm: 'vld1.s32 ${0:h}, [$2] # vld1.s32 ${1:h}, [$3] ' -TOOLCHAIN_pn-pulseaudio_armv7ve = "gcc" -TOOLCHAIN_pn-pulseaudio_armv7a = "gcc" +TOOLCHAIN:pn-pulseaudio:armv7ve = "gcc" +TOOLCHAIN:pn-pulseaudio:armv7a = "gcc" #| /usr/src/debug/qemu/2.6.0-r1/qemu-2.6.0/util/bitmap.c:191: undefined reference to `__atomic_fetch_or_4' #| /usr/src/debug/qemu/2.6.0-r1/qemu-2.6.0/util/bitmap.c:210: undefined reference to `__atomic_fetch_or_4' @@ -128,79 +119,90 @@ TOOLCHAIN_pn-pulseaudio_armv7a = "gcc" #| /usr/src/debug/qemu/2.6.0-r1/qemu-2.6.0/util/bitmap.c:273: undefined reference to `__atomic_fetch_and_4' # We need to link in with -latomic which comes from gcc-runtime anyway so just keep using gcc # to compile qemu for target -TOOLCHAIN_pn-qemu_arm = "gcc" +TOOLCHAIN:pn-qemu:arm = "gcc" #| ./dsp/v4f_IIR2.h:554:12: error: no matching function for call to 'v4f_map' #| a[5] = v4f_map<__builtin_cosf> (f); #| ^~~~~~~~~~~~~~~~~~~~~~~ -TOOLCHAIN_pn-caps = "gcc" +TOOLCHAIN:pn-caps = "gcc" -TOOLCHAIN_pn-lttng-ust_riscv64 = "gcc" +# Fails to build with clang-13 errors with .export.sym file +# Mismatch between symbols in shared library and lists in .exported_symbols.* files: dm_bit_get_prev +#TOOLCHAIN:pn-lvm2 = "gcc" +TOOLCHAIN:pn-libdevmapper = "gcc" + +TOOLCHAIN:pn-lttng-ust:riscv64 = "gcc" #| ../libffi-3.3-rc0/src/arm/sysv.S: Assembler messages: #| ../libffi-3.3-rc0/src/arm/sysv.S:131: Error: selected processor does not support `vldrle d0,[sp]' in ARM mode #| ../libffi-3.3-rc0/src/arm/sysv.S:132: Error: selected processor does not support `vldmgt sp,{d0-d7}' in ARM mode -TOOLCHAIN_pn-libffi_armeb = "gcc" +TOOLCHAIN:pn-libffi:armeb = "gcc" # Clang/mips still generates __sync_fetch_and_add_8 instead of __atomic_fetch_add_8 so it can't even use # libatomic to provide these functions, therefore can not compile redis on mips -TOOLCHAIN_pn-redis_mips = "gcc" +TOOLCHAIN:pn-redis:mips = "gcc" + +# latest 32bit arch versions fails to compile with clang 13 +# common/JackEngineControl.h:89:5: error: requested alignment is less than minimum alignment of 8 for type 'Jack::JackFrameTimer' +#| alignas(UInt32) JackFrameTimer fFrameTimer; +#| ^ +TOOLCHAIN:pn-jack = "${@['clang','gcc'][d.getVar('SITEINFO_BITS') != '32']}" -CFLAGS_append_pn-liboil_toolchain-clang_x86-64 = " -fheinous-gnu-extensions " +CFLAGS:append:pn-liboil:toolchain-clang:x86-64 = " -fheinous-gnu-extensions " #io_getevents.c:25:141: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions #io_syscall5(int, __io_getevents_0_4, io_getevents, io_context_t, ctx, long, min_nr, long, nr, struct io_event *, events, struct timespec *, timeout) -CFLAGS_append_pn-libaio_toolchain-clang_mips = " -fheinous-gnu-extensions" +CFLAGS:append:pn-libaio:toolchain-clang:mips = " -fheinous-gnu-extensions" #| error: unknown warning option '-Wimplicit-fallthrough=0'; did you mean '-Wimplicit-fallthrough'? [-Werror,-Wunknown-warning-option] -CFLAGS_append_pn-mdadm_toolchain-clang = " -Wno-error=unknown-warning-option" +CFLAGS:append:pn-mdadm:toolchain-clang = " -Wno-error=unknown-warning-option" # ../db-5.3.28/src/mutex/mut_tas.c:150:34: error: unknown directive #:9:2: note: instantiated into assembly here # .force_thumb # ^ -#CFLAGS_append_pn-db_toolchain-clang = " -no-integrated-as" +#CFLAGS:append:pn-db:toolchain-clang = " -no-integrated-as" # #| ../../../DirectFB-1.7.7/lib/direct/armasm_memcpy.S:63:2: error: invalid instruction #| ldmgeia r1!, {r3, r4, r12, lr} #| ^ -CFLAGS_append_pn-directfb_toolchain-clang_arm = " -no-integrated-as" +CFLAGS:append:pn-directfb:toolchain-clang:arm = " -no-integrated-as" -CFLAGS_append_pn-userland_toolchain-clang = " -no-integrated-as" +CFLAGS:append:pn-userland:toolchain-clang = " -no-integrated-as" # libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S # :13:5: error: invalid token in expression # .if $17 != 0 # ^ -CFLAGS_append_pn-libjpeg-turbo_toolchain-clang_mipsarch = " -no-integrated-as" +CFLAGS:append:pn-libjpeg-turbo:toolchain-clang:mipsarch = " -no-integrated-as" # arm-yoe-linux-gnueabi-ld: /usr/src/debug/libvorbis/1.3.6-r0/build/lib/../../libvorbis-1.3.6/lib/sharedbook.c:165: undefined reference to `__pow_finite' -CFLAGS_append_pn-libvorbis_toolchain-clang_armv7ve = " -fno-fast-math" -CFLAGS_append_pn-mpg123_toolchain-clang_armv7ve = " -fno-fast-math" +CFLAGS:append:pn-libvorbis:toolchain-clang:armv7ve = " -fno-fast-math" +CFLAGS:append:pn-mpg123:toolchain-clang:armv7ve = " -fno-fast-math" #../kexec-tools-2.0.18/purgatory/arch/i386/entry32-16.S:23:2: error: unknown directive # .arch i386 # ^ -CC_append_pn-kexec-tools_toolchain-clang_x86-64 = " -no-integrated-as" -CC_append_pn-kexec-tools_toolchain-clang_x86 = " -no-integrated-as" -CC_append_pn-kexec-tools-klibc_toolchain-clang_x86-64 = " -no-integrated-as" -CC_append_pn-kexec-tools-klibc_toolchain-clang_x86 = " -no-integrated-as" +CC:append:pn-kexec-tools:toolchain-clang:x86-64 = " -no-integrated-as" +CC:append:pn-kexec-tools:toolchain-clang:x86 = " -no-integrated-as" +CC:append:pn-kexec-tools-klibc:toolchain-clang:x86-64 = " -no-integrated-as" +CC:append:pn-kexec-tools-klibc:toolchain-clang:x86 = " -no-integrated-as" #| /tmp/x86-sse2-cdb148.s:207:9: error: ambiguous operand size for instruction 'sub' #| sub SIZE, 64 #| ^~~~ -CFLAGS_append_pn-tinymembench_toolchain-clang_x86-64 = " -no-integrated-as" -CFLAGS_append_pn-tinymembench_toolchain-clang_x86 = " -no-integrated-as" -CFLAGS_append_pn-tinymembench_toolchain-clang_mipsarch = " -no-integrated-as" +CFLAGS:append:pn-tinymembench:toolchain-clang:x86-64 = " -no-integrated-as" +CFLAGS:append:pn-tinymembench:toolchain-clang:x86 = " -no-integrated-as" +CFLAGS:append:pn-tinymembench:toolchain-clang:mipsarch = " -no-integrated-as" -CFLAGS_append_pn-ne10_toolchain-clang_arm = " -no-integrated-as" -CFLAGS_append_pn-libde265_toolchain-clang_arm = " -no-integrated-as" +CFLAGS:append:pn-ne10:toolchain-clang:arm = " -no-integrated-as" +CFLAGS:append:pn-libde265:toolchain-clang:arm = " -no-integrated-as" # :5 : error: unknown directive #^ # .endfunc # ^ -CFLAGS_append_pn-libsdl2_toolchain-clang_arm = " -no-integrated-as" +CFLAGS:append:pn-libsdl2:toolchain-clang:arm = " -no-integrated-as" #2816:2: error: changed section type for .debug_frame, expected: 0x7000001E # .section .debug_frame,"",@progbits @@ -208,90 +210,96 @@ CFLAGS_append_pn-libsdl2_toolchain-clang_arm = " -no-integrated-as" #lj_vm.S:2890:2: error: changed section flags for .eh_frame, expected: 0x2 # .section .eh_frame,"aw",@progbits # ^ -CFLAGS_append_pn-luajit_toolchain-clang_mips = " -no-integrated-as" +CFLAGS:append:pn-luajit:toolchain-clang:mips = " -no-integrated-as" # Generated asm file can not be compiled with clang assembler due to presence of .0 label # and its references #| aes-decrypt-internal-2.s:368:1: error: unexpected token at start of statement #| .0: #| ^ -CFLAGS_append_pn-nettle_toolchain-clang_powerpc64le = " -no-integrated-as" +CFLAGS:append:pn-nettle:toolchain-clang:powerpc64le = " -no-integrated-as" + +# Fixes clang crash when compiling gnutls-3.7.2/lib/accelerated/aarch64/elf/sha512-armv8.s +CFLAGS:append:pn-gnutls:toolchain-clang:aarch64 = " -no-integrated-as" # regtest.cc:374:39: error: invalid suffix on literal; C++11 requires a # space between literal and identifier [-Wreserved-user-defined-literal] #| snprintf_func (buf, sizeof(buf), "%"Q"u", x); #| ^ -CXXFLAGS_append_pn-xdelta3_toolchain-clang = " -Wno-error=reserved-user-defined-literal" +CXXFLAGS:append:pn-xdelta3:toolchain-clang = " -Wno-error=reserved-user-defined-literal" # -fno-tree-vrp is gcc specific -CXXFLAGS_remove_pn-mozjs_toolchain-clang = "-fno-tree-vrp" -CFLAGS_remove_pn-mozjs_toolchain-clang = "-fno-tree-vrp" +CXXFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" +CFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" #memcached.c:6280:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive] -CPPFLAGS_append_pn-memcached_toolchain-clang = " -Wno-error=embedded-directive" +CPPFLAGS:append:pn-memcached:toolchain-clang = " -Wno-error=embedded-directive" #| /tmp/mcp2515-578c41.s: Assembler messages: #| /tmp/mcp2515-578c41.s:1525: Error: r13 not allowed here -- `sub.w sp,r1,#8' #| /tmp/mcp2515-578c41.s:1821: Error: r13 not allowed here -- `sub.w sp,r6,#8' #| clang-7: error: assembler command failed with exit code 1 (use -v to see invocation) -TUNE_CCARGS_remove_pn-upm_toolchain-clang = "-no-integrated-as" -TUNE_CCARGS_remove_pn-omxplayer_toolchain-clang = "-no-integrated-as" -TUNE_CCARGS_remove_pn-nfs-utils_toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-upm:toolchain-clang = "-no-integrated-as" +TUNE_CCARGS:remove:pn-omxplayer:toolchain-clang = "-no-integrated-as" +TUNE_CCARGS:remove:pn-nfs-utils:toolchain-clang = "-Qunused-arguments" # We want to error out when -msse option is used otherwise it enables sse on non-x86 arches -TUNE_CCARGS_remove_pn-pipewire_toolchain-clang = "-Qunused-arguments" -TUNE_CCARGS_remove_pn-tesseract_toolchain-clang = "-Qunused-arguments" -TUNE_CCARGS_remove_pn-pulseaudio_toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-pipewire:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-tesseract:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-pulseaudio:toolchain-clang = "-Qunused-arguments" #| /usr/src/debug/ruby/2.5.1-r0/build/../ruby-2.5.1/process.c:7073: undefined reference to `__mulodi4' #| clang-7: error: linker command failed with exit code 1 (use -v to see invocation) -COMPILER_RT_pn-ruby_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_pn-python3_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_pn-m4_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_pn-cpio_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_pn-openssh_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_pn-webkitgtk_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_pn-wpewebkit_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_pn-python3-numpy_toolchain-clang = "-rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_remove_pn-m4_powerpc = "-rtlib=compiler-rt" -COMPILER_RT_remove_pn-ruby_powerpc = "-rtlib=compiler-rt" -COMPILER_RT_remove_pn-webkitgtk_powerpc = "-rtlib=compiler-rt" -COMPILER_RT_remove_pn-m4_armeb = "-rtlib=compiler-rt" -COMPILER_RT_remove_pn-ruby_armeb = "-rtlib=compiler-rt" -COMPILER_RT_remove_pn-webkitgtk_armeb = "-rtlib=compiler-rt" +COMPILER_RT:pn-ruby:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-python3:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-m4:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-cpio:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-openssh:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-webkitgtk:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-wpewebkit:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-python3-numpy:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-mongodb:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:remove:pn-m4:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-ruby:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-webkitgtk:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-m4:armeb = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-ruby:armeb = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-webkitgtk:armeb = "-rtlib=compiler-rt" # build/lib/libQt5Widgets.so: undefined reference to `__lshrti3' # __lshrti3 is missing in libgcc -COMPILER_RT_pn-qtbase_toolchain-clang_riscv32 = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-qtbase:toolchain-clang:riscv32 = "-rtlib=compiler-rt ${UNWINDLIB}" -LDFLAGS_append_pn-gnutls_toolchain-clang_riscv64 = " -latomic" -LDFLAGS_append_pn-harfbuzz_toolchain-clang_riscv64 = " -latomic" -LDFLAGS_append_pn-qtwebengine_toolchain-clang_runtime-gnu_x86 = " -latomic" -LDFLAGS_append_pn-qemu_toolchain-clang_runtime-gnu_x86 = " -latomic" +LDFLAGS:append:pn-gnutls:toolchain-clang:riscv64 = " -latomic" +LDFLAGS:append:pn-harfbuzz:toolchain-clang:riscv64 = " -latomic" +LDFLAGS:append:pn-qtwebengine:toolchain-clang:runtime-gnu:x86 = " -latomic" +LDFLAGS:append:pn-qemu:toolchain-clang:x86 = " -latomic" # glibc is built with gcc and hence encodes some libgcc specific builtins which are not found # when doing static linking with clang using compiler-rt, so use libgcc # undefined reference to `__unordtf2' -COMPILER_RT_pn-libc-bench_libc-glibc_toolchain-clang_x86 = "-rtlib=libgcc" -COMPILER_RT_pn-aufs-util_libc-glibc_toolchain-clang_x86 = "-rtlib=libgcc" -COMPILER_RT_pn-libhugetlbfs_libc-glibc_toolchain-clang_x86 = "-rtlib=libgcc" -COMPILER_RT_pn-tsocks_libc-glibc_toolchain-clang_x86 = "-rtlib=libgcc" -COMPILER_RT_pn-libc-bench_libc-glibc_toolchain-clang_x86-64 = "-rtlib=libgcc" -COMPILER_RT_pn-aufs-util_libc-glibc_toolchain-clang_x86-64 = "-rtlib=libgcc" -COMPILER_RT_pn-libhugetlbfs_libc-glibc_toolchain-clang_x86-64 = "-rtlib=libgcc" -COMPILER_RT_pn-tsocks_libc-glibc_toolchain-clang_x86-64 = "-rtlib=libgcc" +COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mpich:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mpich:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" #(unwind.o): in function `__pthread_unwind': #/usr/src/debug/glibc/2.29-r0/git/nptl/unwind.c:121: undefined reference to `_Unwind_ForcedUnwind' #clang-8: error: linker command failed with exit code 1 (use -v to see invocation) -COMPILER_RT_pn-libc-bench_libc-glibc_toolchain-clang_arm = "-rtlib=libgcc" -COMPILER_RT_pn-aufs-util_libc-glibc_toolchain-clang_arm = "-rtlib=libgcc" -COMPILER_RT_pn-libhugetlbfs_libc-glibc_toolchain-clang_arm = "-rtlib=libgcc" +COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" +COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" # Uses gcc for native tools, e.g. nsinstall and passes clang options which fails so # let same compiler ( gcc or clang) be native/cross compiler # | gcc: error: unrecognized command line option ‘-Qunused-arguments’ -BUILD_CC_pn-nss_toolchain-clang = "clang" +BUILD_CC:pn-nss:toolchain-clang = "clang -rtlib=libgcc -unwindlib=none" # libnoprofile.c:19:5: error: expected parameter declarator # int printf(const char *format, ...) { @@ -299,19 +307,42 @@ BUILD_CC_pn-nss_toolchain-clang = "clang" # error: non-constant-expression cannot be narrowed from type 'std::chrono::duration< #long long, std::ratio<1, 1> >::rep' (aka 'long long') to '__time_t' (aka 'long') in initializer list # [-Wc++11-narrowing] -CXXFLAGS_append_pn-apt_toolchain-clang = " -Wno-c++11-narrowing" -lcl_maybe_fortify_pn-apt_toolchain-clang = "" +CXXFLAGS:append:pn-apt:toolchain-clang = " -Wno-c++11-narrowing" +lcl_maybe_fortify:pn-apt:toolchain-clang = "" # LTO # Seems to use symver ASMs see https://stackoverflow.com/questions/46304742/how-to-combine-lto-with-symbol-versioning # lib/puny_encode.c:136: multiple definition of `_idn2_punycode_encode' -LTO_pn-libidn2_toolchain-clang = "" +LTO:pn-libidn2:toolchain-clang = "" #libcairo.so: undefined reference to pthread_mutexattr_init [--no-allow-shlib-undefined] -LTO_pn-cairo_toolchain-clang = "" +LTO:pn-cairo:toolchain-clang = "" # Hardcoded gcc use in makefiles TOOLCHAIN_pn-u-boot-stm32mp = "gcc" TOOLCHAIN_pn-tf-a-stm32mp = "gcc" TOOLCHAIN_pn-tf-a-stm32mp-serialboot = "gcc" TOOLCHAIN_pn-u-boot-seco-imx = "gcc" + +# see https://bugs.llvm.org/show_bug.cgi?id=50443 this is in clang-13, until it is fixed do not use -O2 +SELECTED_OPTIMIZATION:remove:pn-poke:toolchain-clang = "-O2" + +# Subprocess output:mips-yoe-linux-llvm-objcopy: error: Link field value 22 in section .rel.dyn is not a symbol table +# also seen on riscv64 and x86-64 +OBJCOPY:pn-linux-yocto:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-linux-yocto:toolchain-clang = "${HOST_PREFIX}strip" + +# see https://github.com/llvm/llvm-project/issues/53948 +OBJCOPY:pn-opensbi:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}strip" + +# Depend on GNU objcopy option missing in llvm-objcopy +# llvm-objcopy: error: unknown argument '--section-alignment=512' +OBJCOPY:pn-systemd-boot:toolchain-clang = "${HOST_PREFIX}objcopy" + +# Need OBJDUMP during do_package_qa which is set to llvm-objdump with meta-clang +# it might work with GNU objdump since it falls back to one from build host +DEPENDS:pn-linux-firmware:append:toolchain-clang = " clang-native" diff --git a/conf/nonscanable.conf b/conf/nonscanable.conf index e2b8f5dd..3cdc454e 100644 --- a/conf/nonscanable.conf +++ b/conf/nonscanable.conf @@ -1,22 +1,22 @@ -SCAN_BUILD_pn-linux-libc-headers = "" -SCAN_BUILD_pn-update-rc.d = "" -SCAN_BUILD_pn-initscripts = "" -SCAN_BUILD_pn-base-files = "" -SCAN_BUILD_pn-os-release = "" -SCAN_BUILD_pn-wireless-regdb = "" -SCAN_BUILD_pn-tzdata = "" -SCAN_BUILD_pn-qemuwrapper-cross = "" -SCAN_BUILD_pn-depmodwrapper-cross = "" -SCAN_BUILD_pn-bluez-firmware-rpidistro = "" -SCAN_BUILD_pn-udev-rules-rpi = "" -SCAN_BUILD_pn-shadow-securetty = "" -SCAN_BUILD_pn-96boards-tools = "" -SCAN_BUILD_pn-run-postinsts = "" -SCAN_BUILD_pn-keymaps = "" -SCAN_BUILD_pn-sysvinit-inittab = "" -SCAN_BUILD_pn-pi-bluetooth = "" -SCAN_BUILD_pn-rpi-config = "" -SCAN_BUILD_pn-bcm2835-bootfiles = "" -SCAN_BUILD_pn-autoconf-archive = "" -SCAN_BUILD_pn-compiler-rt = "" -SCAN_BUILD_pn-libcxx = "" +SCAN_BUILD:pn-linux-libc-headers = "" +SCAN_BUILD:pn-update-rc.d = "" +SCAN_BUILD:pn-initscripts = "" +SCAN_BUILD:pn-base-files = "" +SCAN_BUILD:pn-os-release = "" +SCAN_BUILD:pn-wireless-regdb = "" +SCAN_BUILD:pn-tzdata = "" +SCAN_BUILD:pn-qemuwrapper-cross = "" +SCAN_BUILD:pn-depmodwrapper-cross = "" +SCAN_BUILD:pn-bluez-firmware-rpidistro = "" +SCAN_BUILD:pn-udev-rules-rpi = "" +SCAN_BUILD:pn-shadow-securetty = "" +SCAN_BUILD:pn-96boards-tools = "" +SCAN_BUILD:pn-run-postinsts = "" +SCAN_BUILD:pn-keymaps = "" +SCAN_BUILD:pn-sysvinit-inittab = "" +SCAN_BUILD:pn-pi-bluetooth = "" +SCAN_BUILD:pn-rpi-config = "" +SCAN_BUILD:pn-bcm2835-bootfiles = "" +SCAN_BUILD:pn-autoconf-archive = "" +SCAN_BUILD:pn-compiler-rt = "" +SCAN_BUILD:pn-libcxx = "" diff --git a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium-ozone-wayland_%.bbappend b/dynamic-layers/chromium-browser-layer/recipes-browser/chromium-ozone-wayland_%.bbappend deleted file mode 100644 index ff82a797..00000000 --- a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium-ozone-wayland_%.bbappend +++ /dev/null @@ -1,10 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -GN_ARGS += "use_lld=true use_gold=false" - -UNWINDLIB_toolchain-clang = "--unwindlib=libgcc" - -DEPENDS_remove = "compiler-rt-native libcxx-native" - -BUILD_CPPFLAGS_remove = "-isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" -BUILD_LDFLAGS_remove = "-rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}" diff --git a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium-x11_%.bbappend b/dynamic-layers/chromium-browser-layer/recipes-browser/chromium-x11_%.bbappend deleted file mode 100644 index ff82a797..00000000 --- a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium-x11_%.bbappend +++ /dev/null @@ -1,10 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -GN_ARGS += "use_lld=true use_gold=false" - -UNWINDLIB_toolchain-clang = "--unwindlib=libgcc" - -DEPENDS_remove = "compiler-rt-native libcxx-native" - -BUILD_CPPFLAGS_remove = "-isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" -BUILD_LDFLAGS_remove = "-rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}" diff --git a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland_%.bbappend b/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland_%.bbappend deleted file mode 100644 index 554578e7..00000000 --- a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -DEPENDS_remove = "compiler-rt-native libcxx-native" - -BUILD_CPPFLAGS_remove = "-isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" -BUILD_LDFLAGS_remove = "-rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}" diff --git a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-x11_%.bbappend b/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-x11_%.bbappend deleted file mode 100644 index 554578e7..00000000 --- a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-x11_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -DEPENDS_remove = "compiler-rt-native libcxx-native" - -BUILD_CPPFLAGS_remove = "-isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" -BUILD_LDFLAGS_remove = "-rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}" diff --git a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/gn-native_%.bbappend b/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/gn-native_%.bbappend deleted file mode 100644 index cd60c58d..00000000 --- a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/gn-native_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -DEPENDS_remove = "compiler-rt-native libcxx-native" - -CXXFLAGS_remove = "-isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" -LDFLAGS_remove = "-rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}" diff --git a/dynamic-layers/chromium-browser-layer/recipes-browser/gn-native_%.bbappend b/dynamic-layers/chromium-browser-layer/recipes-browser/gn-native_%.bbappend deleted file mode 100644 index cd60c58d..00000000 --- a/dynamic-layers/chromium-browser-layer/recipes-browser/gn-native_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -DEPENDS_remove = "compiler-rt-native libcxx-native" - -CXXFLAGS_remove = "-isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" -LDFLAGS_remove = "-rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}" diff --git a/dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend b/dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend index dd3c5f9d..543f32ce 100644 --- a/dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend +++ b/dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend @@ -1,3 +1,3 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -SRC_URI_append = " file://fix_duplicate_pdb_search_init.patch " +SRC_URI:append = " file://fix_duplicate_pdb_search_init.patch " diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Replace-kprobe-function-blk_account_io_completion-to.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Replace-kprobe-function-blk_account_io_completion-to.patch deleted file mode 100644 index ef932962..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Replace-kprobe-function-blk_account_io_completion-to.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 95c9229ea9f029a1b9e8dcbe86fc67f037c0dfa2 Mon Sep 17 00:00:00 2001 -From: Chen HaoNing -Date: Wed, 1 Jul 2020 15:49:17 -0500 -Subject: [PATCH] Replace kprobe function "blk_account_io_completion" to - "blk_account_io_done" for kernel version >= 5.8.0 - -The kernel function "blk_account_io_completion" is not available anymore as attach point of Kprobe as of kernel version 5.8.0. Therefore, after discussions, we decided to use function "blk_account_io_done" instead in every kprobe attachment to "blk_account_io_completion". - -Upstream-Status: Backport - ---- - docs/reference_guide.md | 4 ++-- - docs/tutorial_bcc_python_developer.md | 6 +++--- - examples/lua/kprobe-latency.lua | 2 +- - examples/tracing/bitehist.py | 2 +- - examples/tracing/disksnoop.py | 2 +- - tools/biosnoop.lua | 2 +- - tools/biosnoop.py | 2 +- - tools/biotop.py | 2 +- - tools/old/biosnoop.py | 2 +- - 9 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/docs/reference_guide.md b/docs/reference_guide.md -index 924fa203..9eaf27a5 100644 ---- a/docs/reference_guide.md -+++ b/docs/reference_guide.md -@@ -1784,7 +1784,7 @@ Example: - b = BPF(text=""" - BPF_HISTOGRAM(dist); - --int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) -+int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) - { - dist.increment(bpf_log2l(req->__data_len / 1024)); - return 0; -@@ -1835,7 +1835,7 @@ Example: - b = BPF(text=""" - BPF_HISTOGRAM(dist); - --int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) -+int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) - { - dist.increment(req->__data_len / 1024); - return 0; -diff --git a/docs/tutorial_bcc_python_developer.md b/docs/tutorial_bcc_python_developer.md -index 0cb0e780..b3b8ed6b 100644 ---- a/docs/tutorial_bcc_python_developer.md -+++ b/docs/tutorial_bcc_python_developer.md -@@ -220,7 +220,7 @@ void trace_completion(struct pt_regs *ctx, struct request *req) { - - b.attach_kprobe(event="blk_start_request", fn_name="trace_start") - b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_start") --b.attach_kprobe(event="blk_account_io_completion", fn_name="trace_completion") -+b.attach_kprobe(event="blk_account_io_done", fn_name="trace_completion") - [...] - ``` - -@@ -351,7 +351,7 @@ b = BPF(text=""" - - BPF_HISTOGRAM(dist); - --int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) -+int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) - { - dist.increment(bpf_log2l(req->__data_len / 1024)); - return 0; -@@ -374,7 +374,7 @@ b["dist"].print_log2_hist("kbytes") - A recap from earlier lessons: - - - ```kprobe__```: This prefix means the rest will be treated as a kernel function name that will be instrumented using kprobe. --- ```struct pt_regs *ctx, struct request *req```: Arguments to kprobe. The ```ctx``` is registers and BPF context, the ```req``` is the first argument to the instrumented function: ```blk_account_io_completion()```. -+- ```struct pt_regs *ctx, struct request *req```: Arguments to kprobe. The ```ctx``` is registers and BPF context, the ```req``` is the first argument to the instrumented function: ```blk_account_io_done()```. - - ```req->__data_len```: Dereferencing that member. - - New things to learn: -diff --git a/examples/lua/kprobe-latency.lua b/examples/lua/kprobe-latency.lua -index 60ac2c1c..98464e5c 100644 ---- a/examples/lua/kprobe-latency.lua -+++ b/examples/lua/kprobe-latency.lua -@@ -30,7 +30,7 @@ local lat_map = bpf.map('array', bins) - local trace_start = bpf.kprobe('myprobe:blk_start_request', function (ptregs) - map[ptregs.parm1] = time() - end, false, -1, 0) --local trace_end = bpf.kprobe('myprobe2:blk_account_io_completion', function (ptregs) -+local trace_end = bpf.kprobe('myprobe2:blk_account_io_done', function (ptregs) - -- The lines below are computing index - -- using log10(x)*10 = log2(x)*10/log2(10) = log2(x)*3 - -- index = 29 ~ 1 usec -diff --git a/examples/tracing/bitehist.py b/examples/tracing/bitehist.py -index 4d7c7958..89ceb307 100755 ---- a/examples/tracing/bitehist.py -+++ b/examples/tracing/bitehist.py -@@ -25,7 +25,7 @@ b = BPF(text=""" - BPF_HISTOGRAM(dist); - BPF_HISTOGRAM(dist_linear); - --int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) -+int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) - { - dist.increment(bpf_log2l(req->__data_len / 1024)); - dist_linear.increment(req->__data_len / 1024); -diff --git a/examples/tracing/disksnoop.py b/examples/tracing/disksnoop.py -index 1101e6f2..a35e1abd 100755 ---- a/examples/tracing/disksnoop.py -+++ b/examples/tracing/disksnoop.py -@@ -46,7 +46,7 @@ void trace_completion(struct pt_regs *ctx, struct request *req) { - if BPF.get_kprobe_functions(b'blk_start_request'): - b.attach_kprobe(event="blk_start_request", fn_name="trace_start") - b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_start") --b.attach_kprobe(event="blk_account_io_completion", fn_name="trace_completion") -+b.attach_kprobe(event="blk_account_io_done", fn_name="trace_completion") - - # header - print("%-18s %-2s %-7s %8s" % ("TIME(s)", "T", "BYTES", "LAT(ms)")) -diff --git a/tools/biosnoop.lua b/tools/biosnoop.lua -index 8d9b6a19..3e0441e2 100755 ---- a/tools/biosnoop.lua -+++ b/tools/biosnoop.lua -@@ -126,7 +126,7 @@ return function(BPF, utils) - bpf:attach_kprobe{event="blk_account_io_start", fn_name="trace_pid_start"} - bpf:attach_kprobe{event="blk_start_request", fn_name="trace_req_start"} - bpf:attach_kprobe{event="blk_mq_start_request", fn_name="trace_req_start"} -- bpf:attach_kprobe{event="blk_account_io_completion", -+ bpf:attach_kprobe{event="blk_account_io_done", - fn_name="trace_req_completion"} - - print("%-14s %-14s %-6s %-7s %-2s %-9s %-7s %7s" % {"TIME(s)", "COMM", "PID", -diff --git a/tools/biosnoop.py b/tools/biosnoop.py -index ff9b842b..5bbc77cd 100755 ---- a/tools/biosnoop.py -+++ b/tools/biosnoop.py -@@ -160,7 +160,7 @@ b.attach_kprobe(event="blk_account_io_start", fn_name="trace_pid_start") - if BPF.get_kprobe_functions(b'blk_start_request'): - b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start") - b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start") --b.attach_kprobe(event="blk_account_io_completion", -+b.attach_kprobe(event="blk_account_io_done", - fn_name="trace_req_completion") - - # header -diff --git a/tools/biotop.py b/tools/biotop.py -index cad3759a..d3a42ef7 100755 ---- a/tools/biotop.py -+++ b/tools/biotop.py -@@ -178,7 +178,7 @@ b.attach_kprobe(event="blk_account_io_start", fn_name="trace_pid_start") - if BPF.get_kprobe_functions(b'blk_start_request'): - b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start") - b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start") --b.attach_kprobe(event="blk_account_io_completion", -+b.attach_kprobe(event="blk_account_io_done", - fn_name="trace_req_completion") - - print('Tracing... Output every %d secs. Hit Ctrl-C to end' % interval) -diff --git a/tools/old/biosnoop.py b/tools/old/biosnoop.py -index 37ee3f9c..847ab91b 100755 ---- a/tools/old/biosnoop.py -+++ b/tools/old/biosnoop.py -@@ -98,7 +98,7 @@ int trace_req_completion(struct pt_regs *ctx, struct request *req) - b.attach_kprobe(event="blk_account_io_start", fn_name="trace_pid_start") - b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start") - b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start") --b.attach_kprobe(event="blk_account_io_completion", -+b.attach_kprobe(event="blk_account_io_done", - fn_name="trace_req_completion") - - # header --- -2.17.1 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-cmake-link-dynamically-to-libclang-cpp-if-found-and-.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-cmake-link-dynamically-to-libclang-cpp-if-found-and-.patch deleted file mode 100644 index 74b2e277..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-cmake-link-dynamically-to-libclang-cpp-if-found-and-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From f14f69d996ffc1c61dd523b839271d4a51328e4d Mon Sep 17 00:00:00 2001 -From: Luca Boccassi -Date: Fri, 1 Jan 2021 19:04:37 +0000 -Subject: [PATCH 1/3] cmake: link dynamically to libclang-cpp if found and - ENABLE_LLVM_SHARED is set - -ENABLE_LLVM_SHARED allows to dynamically link against libLLVM, but -libclang is still unconditionally linked statically. -Search for libclang-cpp.so, and if it is found and ENABLE_LLVM_SHARED -is set dynamically link against it. -Also expand the libstdc++ static linking check to include this new -condition. ---- - CMakeLists.txt | 1 + - cmake/clang_libs.cmake | 4 ++++ - cmake/static_libstdc++.cmake | 2 +- - 3 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 74fe4f19..b2e334e9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -76,6 +76,7 @@ find_library(libclangRewrite NAMES clangRewrite clang-cpp HINTS ${CLANG_SEARCH}) - find_library(libclangSema NAMES clangSema clang-cpp HINTS ${CLANG_SEARCH}) - find_library(libclangSerialization NAMES clangSerialization clang-cpp HINTS ${CLANG_SEARCH}) - find_library(libclangASTMatchers NAMES clangASTMatchers clang-cpp HINTS ${CLANG_SEARCH}) -+find_library(libclang-shared libclang-cpp.so HINTS ${CLANG_SEARCH}) - if(libclangBasic STREQUAL "libclangBasic-NOTFOUND") - message(FATAL_ERROR "Unable to find clang libraries") - endif() -diff --git a/cmake/clang_libs.cmake b/cmake/clang_libs.cmake -index c33b635c..3f1523b7 100644 ---- a/cmake/clang_libs.cmake -+++ b/cmake/clang_libs.cmake -@@ -26,6 +26,9 @@ llvm_map_components_to_libnames(_llvm_libs ${llvm_raw_libs}) - llvm_expand_dependencies(llvm_libs ${_llvm_libs}) - endif() - -+if(ENABLE_LLVM_SHARED AND NOT libclang-shared STREQUAL "libclang-shared-NOTFOUND") -+set(clang_libs ${libclang-shared}) -+else() - # order is important - set(clang_libs - ${libclangFrontend} -@@ -46,6 +49,7 @@ list(APPEND clang_libs - ${libclangAST} - ${libclangLex} - ${libclangBasic}) -+endif() - - # prune unused llvm static library stuff when linking into the new .so - set(_exclude_flags) -diff --git a/cmake/static_libstdc++.cmake b/cmake/static_libstdc++.cmake -index 3c8ac179..787ed9ad 100644 ---- a/cmake/static_libstdc++.cmake -+++ b/cmake/static_libstdc++.cmake -@@ -1,7 +1,7 @@ - # only turn on static-libstdc++ if also linking statically against clang - string(REGEX MATCH ".*[.]a$" LIBCLANG_ISSTATIC "${libclangBasic}") - # if gcc 4.9 or higher is used, static libstdc++ is a good option --if (CMAKE_COMPILER_IS_GNUCC AND LIBCLANG_ISSTATIC) -+if (CMAKE_COMPILER_IS_GNUCC AND LIBCLANG_ISSTATIC AND (NOT ENABLE_LLVM_SHARED OR libclang-shared STREQUAL "libclang-shared-NOTFOUND")) - execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9) - execute_process(COMMAND ${CMAKE_C_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GCC_LIB) --- -2.29.2 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-fix-compilation-issues-with-latest-llvm12-trunk.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-fix-compilation-issues-with-latest-llvm12-trunk.patch deleted file mode 100644 index b1f56e68..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-fix-compilation-issues-with-latest-llvm12-trunk.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 675fca6a646812361c16884ccd2ff789f40c4ce8 Mon Sep 17 00:00:00 2001 -From: Yonghong Song -Date: Tue, 3 Nov 2020 22:11:57 -0800 -Subject: [PATCH 1/2] fix compilation issues with latest llvm12 trunk -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With latest llvm12 trunk, we got two compilation bugs. - -Bug #1: - /home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc: - In member function ‘void ebpf::BFrontendAction::DoMiscWorkAround()’: - /home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc:1706:31: - error: ‘class clang::SourceManage’ has no member named ‘getBuffer’; did you mean ‘getBufferData’? - rewriter_->getSourceMgr().getBuffer(rewriter_->getSourceMgr().getMainFileID())->getBufferSize(), - ^~~~~~~~~ - getBufferData - - This is due to upstream change https://reviews.llvm.org/D89394. - To fix, follow upstream examples in https://reviews.llvm.org/D89394. - -Bug #2: - /home/yhs/work/bcc/src/cc/bpf_module.cc: In member function ‘int ebpf::BPFModule::finalize()’: - /home/yhs/work/bcc/src/cc/bpf_module.cc:470:11: - error: ‘class llvm::EngineBuilder’ has no member named ‘setUseOrcMCJITReplacement’ - builder.setUseOrcMCJITReplacement(false); - ^~~~~~~~~~~~~~~~~~~~~~~~~ - - This is due to upstream - https://github.com/llvm/llvm-project/commit/6154c4115cd4b78d0171892aac21e340e72e32bd - - It seems builder.setUseOrcMCJITReplacement() is not needed any more. So just remove it - from bcc. - -Signed-off-by: Yonghong Song ---- - src/cc/bpf_module.cc | 2 ++ - src/cc/bpf_module_rw_engine.cc | 2 ++ - src/cc/frontends/clang/b_frontend_action.cc | 4 ++++ - 3 files changed, 8 insertions(+) - -diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc -index 8fba8d27..c194b815 100644 ---- a/src/cc/bpf_module.cc -+++ b/src/cc/bpf_module.cc -@@ -466,7 +466,9 @@ int BPFModule::finalize() { - builder.setErrorStr(&err); - builder.setMCJITMemoryManager(ebpf::make_unique(sections_p)); - builder.setMArch("bpf"); -+#if LLVM_MAJOR_VERSION <= 11 - builder.setUseOrcMCJITReplacement(false); -+#endif - engine_ = unique_ptr(builder.create()); - if (!engine_) { - fprintf(stderr, "Could not create ExecutionEngine: %s\n", err.c_str()); -diff --git a/src/cc/bpf_module_rw_engine.cc b/src/cc/bpf_module_rw_engine.cc -index d7e31a71..9890af69 100644 ---- a/src/cc/bpf_module_rw_engine.cc -+++ b/src/cc/bpf_module_rw_engine.cc -@@ -356,7 +356,9 @@ unique_ptr BPFModule::finalize_rw(unique_ptr m) { - string err; - EngineBuilder builder(move(m)); - builder.setErrorStr(&err); -+#if LLVM_MAJOR_VERSION <= 11 - builder.setUseOrcMCJITReplacement(false); -+#endif - auto engine = unique_ptr(builder.create()); - if (!engine) - fprintf(stderr, "Could not create ExecutionEngine: %s\n", err.c_str()); -diff --git a/src/cc/frontends/clang/b_frontend_action.cc b/src/cc/frontends/clang/b_frontend_action.cc -index 154a3794..80b03b9b 100644 ---- a/src/cc/frontends/clang/b_frontend_action.cc -+++ b/src/cc/frontends/clang/b_frontend_action.cc -@@ -1694,7 +1694,11 @@ void BFrontendAction::DoMiscWorkAround() { - false); - - rewriter_->getEditBuffer(rewriter_->getSourceMgr().getMainFileID()).InsertTextAfter( -+#if LLVM_MAJOR_VERSION >= 12 -+ rewriter_->getSourceMgr().getBufferOrFake(rewriter_->getSourceMgr().getMainFileID()).getBufferSize(), -+#else - rewriter_->getSourceMgr().getBuffer(rewriter_->getSourceMgr().getMainFileID())->getBufferSize(), -+#endif - "\n#include \n"); - } - --- -2.30.0 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch deleted file mode 100644 index fb659ccc..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 8e12b10e7576a6d47e0dc2cdc36caeb9ba26fa12 Mon Sep 17 00:00:00 2001 -From: He Zhe -Date: Mon, 15 Jun 2020 07:05:24 +0000 -Subject: [PATCH] tools: opensnoop: snoop do_sys_openat2 for kernel v5.6 and - later - -Since kernel v5.6, fddb5d430ad9 ("open: introduce openat2(2) syscall"), -do_sys_openat2 instead of do_sys_open has been used as entry function for open. - -Upstream-Status: Inappropriate, upstream context has changed and needs more - tweak. - -Signed-off-by: He Zhe ---- - tools/opensnoop.py | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/tools/opensnoop.py b/tools/opensnoop.py -index 51d3dc05..522812d4 100755 ---- a/tools/opensnoop.py -+++ b/tools/opensnoop.py -@@ -22,6 +22,8 @@ from bcc.utils import printb - import argparse - from datetime import datetime, timedelta - import os -+import platform -+from pkg_resources import parse_version - - # arguments - examples = """examples: -@@ -235,8 +237,14 @@ if debug or args.ebpf: - # initialize BPF - b = BPF(text=bpf_text) - if not is_support_kfunc: -- b.attach_kprobe(event="do_sys_open", fn_name="trace_entry") -- b.attach_kretprobe(event="do_sys_open", fn_name="trace_return") -+ # Since kernel v5.6, do_sys_openat2 instead of do_sys_open has been used as entry function for open -+ if parse_version(platform.uname().release.split('-')[0]) > parse_version('5.6.0'): -+ entry = "do_sys_openat2" -+ else: -+ entry = "do_sys_open" -+ -+ b.attach_kprobe(event=entry, fn_name="trace_entry") -+ b.attach_kretprobe(event=entry, fn_name="trace_return") - - initial_ts = 0 - --- -2.17.1 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0002-cmake-always-link-to-packaged-libbpf-if-CMAKE_USE_LI.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0002-cmake-always-link-to-packaged-libbpf-if-CMAKE_USE_LI.patch deleted file mode 100644 index 0269fa4e..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0002-cmake-always-link-to-packaged-libbpf-if-CMAKE_USE_LI.patch +++ /dev/null @@ -1,239 +0,0 @@ -From ab9a9dadf294f69e024a8b58c983a6c2085c223a Mon Sep 17 00:00:00 2001 -From: Luca Boccassi -Date: Fri, 8 Jan 2021 16:58:56 +0000 -Subject: [PATCH 2/3] cmake: always link to packaged libbpf if - CMAKE_USE_LIBBPF_PACKAGE is set (#3210) - -Some of the executables still link to the local static versions -even if the user requested CMAKE_USE_LIBBPF_PACKAGE. Fix this by -using bcc-shared-no-libbpf more widely if the variable is set. - -Skip the git submodule and the extraction commands if the user -set CMAKE_USE_LIBBPF_PACKAGE ---- - CMakeLists.txt | 2 +- - examples/cpp/CMakeLists.txt | 59 ++++++++---------------------- - examples/cpp/pyperf/CMakeLists.txt | 5 +++ - introspection/CMakeLists.txt | 8 +++- - src/cc/CMakeLists.txt | 29 ++++++++++----- - tests/cc/CMakeLists.txt | 22 +++++++---- - 6 files changed, 61 insertions(+), 64 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b2e334e9..b68571ea 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -14,7 +14,7 @@ endif() - enable_testing() - - # populate submodules (libbpf) --if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) -+if(NOT CMAKE_USE_LIBBPF_PACKAGE AND NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) - execute_process(COMMAND git submodule update --init --recursive - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endif() -diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt -index dae0e9ce..dd343245 100644 ---- a/examples/cpp/CMakeLists.txt -+++ b/examples/cpp/CMakeLists.txt -@@ -11,49 +11,20 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - - option(INSTALL_CPP_EXAMPLES "Install C++ examples. Those binaries are statically linked and can take plenty of disk space" OFF) - --add_executable(HelloWorld HelloWorld.cc) --target_link_libraries(HelloWorld bcc-static) -- --add_executable(CPUDistribution CPUDistribution.cc) --target_link_libraries(CPUDistribution bcc-static) -- --add_executable(RecordMySQLQuery RecordMySQLQuery.cc) --target_link_libraries(RecordMySQLQuery bcc-static) -- --add_executable(TCPSendStack TCPSendStack.cc) --target_link_libraries(TCPSendStack bcc-static) -- --add_executable(RandomRead RandomRead.cc) --target_link_libraries(RandomRead bcc-static) -- --add_executable(LLCStat LLCStat.cc) --target_link_libraries(LLCStat bcc-static) -- --add_executable(FollyRequestContextSwitch FollyRequestContextSwitch.cc) --target_link_libraries(FollyRequestContextSwitch bcc-static) -- --add_executable(UseExternalMap UseExternalMap.cc) --target_link_libraries(UseExternalMap bcc-static) -- --add_executable(CGroupTest CGroupTest.cc) --target_link_libraries(CGroupTest bcc-static) -- --add_executable(TaskIterator TaskIterator.cc) --target_link_libraries(TaskIterator bcc-static) -- --add_executable(SkLocalStorageIterator SkLocalStorageIterator.cc) --target_link_libraries(SkLocalStorageIterator bcc-static) -- --if(INSTALL_CPP_EXAMPLES) -- install (TARGETS HelloWorld DESTINATION share/bcc/examples/cpp) -- install (TARGETS CPUDistribution DESTINATION share/bcc/examples/cpp) -- install (TARGETS RecordMySQLQuery DESTINATION share/bcc/examples/cpp) -- install (TARGETS TCPSendStack DESTINATION share/bcc/examples/cpp) -- install (TARGETS RandomRead DESTINATION share/bcc/examples/cpp) -- install (TARGETS LLCStat DESTINATION share/bcc/examples/cpp) -- install (TARGETS FollyRequestContextSwitch DESTINATION share/bcc/examples/cpp) -- install (TARGETS UseExternalMap DESTINATION share/bcc/examples/cpp) -- install (TARGETS CGroupTest DESTINATION share/bcc/examples/cpp) --endif(INSTALL_CPP_EXAMPLES) -+file(GLOB EXAMPLES *.cc) -+foreach(EXAMPLE ${EXAMPLES}) -+ get_filename_component(NAME ${EXAMPLE} NAME_WE) -+ add_executable(${NAME} ${EXAMPLE}) -+ -+ if(NOT CMAKE_USE_LIBBPF_PACKAGE) -+ target_link_libraries(${NAME} bcc-static) -+ else() -+ target_link_libraries(${NAME} bcc-shared-no-libbpf) -+ endif() -+ -+ if(INSTALL_CPP_EXAMPLES) -+ install (TARGETS ${NAME} DESTINATION share/bcc/examples/cpp) -+ endif(INSTALL_CPP_EXAMPLES) -+endforeach() - - add_subdirectory(pyperf) -diff --git a/examples/cpp/pyperf/CMakeLists.txt b/examples/cpp/pyperf/CMakeLists.txt -index 6f963c66..97420806 100644 ---- a/examples/cpp/pyperf/CMakeLists.txt -+++ b/examples/cpp/pyperf/CMakeLists.txt -@@ -7,6 +7,11 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) - - add_executable(PyPerf PyPerf.cc PyPerfUtil.cc PyPerfBPFProgram.cc PyPerfLoggingHelper.cc PyPerfDefaultPrinter.cc Py36Offsets.cc) - target_link_libraries(PyPerf bcc-static) -+if(NOT CMAKE_USE_LIBBPF_PACKAGE) -+ target_link_libraries(PyPerf bcc-static) -+else() -+ target_link_libraries(PyPerf bcc-shared-no-libbpf) -+endif() - - if(INSTALL_CPP_EXAMPLES) - install (TARGETS PyPerf DESTINATION share/bcc/examples/cpp) -diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt -index 4328ee11..6c83f0c8 100644 ---- a/introspection/CMakeLists.txt -+++ b/introspection/CMakeLists.txt -@@ -8,7 +8,13 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) - option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON) - option(BPS_LINK_RT "Pass -lrt to linker when linking bps tool" ON) - --set(bps_libs_to_link bpf-static elf z) -+# Note that the order matters! bpf-static first, the rest later -+if(CMAKE_USE_LIBBPF_PACKAGE AND LIBBPF_FOUND) -+set(bps_libs_to_link bpf-shared ${LIBBPF_LIBRARIES}) -+else() -+set(bps_libs_to_link bpf-static) -+endif() -+list(APPEND bps_libs_to_link elf z) - if(BPS_LINK_RT) - list(APPEND bps_libs_to_link rt) - endif() -diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt -index 4021c662..c8ea63aa 100644 ---- a/src/cc/CMakeLists.txt -+++ b/src/cc/CMakeLists.txt -@@ -10,8 +10,12 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frontends/clang) - include_directories(${LLVM_INCLUDE_DIRS}) - include_directories(${LIBELF_INCLUDE_DIRS}) - # todo: if check for kernel version --include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include) --include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include/uapi) -+if (CMAKE_USE_LIBBPF_PACKAGE AND LIBBPF_FOUND) -+ include_directories(${LIBBPF_INCLUDE_DIRS}) -+else() -+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include) -+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include/uapi) -+endif() - - # add_definitions has a problem parsing "-D_GLIBCXX_USE_CXX11_ABI=0", this is safer - separate_arguments(LLVM_DEFINITIONS) -@@ -41,21 +45,26 @@ if(LIBBPF_INCLUDE_DIR) - add_definitions(-DHAVE_EXTERNAL_LIBBPF) - endif() - --if(LIBBPF_FOUND) -- set(extract_dir ${CMAKE_CURRENT_BINARY_DIR}/libbpf_a_extract) -- execute_process(COMMAND sh -c "mkdir -p ${extract_dir} && cd ${extract_dir} && ${CMAKE_AR} x ${LIBBPF_STATIC_LIBRARIES}") -- file(GLOB libbpf_sources "${extract_dir}/*.o") --else() -- file(GLOB libbpf_sources "libbpf/src/*.c") --endif() -+if(NOT CMAKE_USE_LIBBPF_PACKAGE) -+ if(LIBBPF_FOUND) -+ set(extract_dir ${CMAKE_CURRENT_BINARY_DIR}/libbpf_a_extract) -+ execute_process(COMMAND sh -c "mkdir -p ${extract_dir} && cd ${extract_dir} && ${CMAKE_AR} x ${LIBBPF_STATIC_LIBRARIES}") -+ file(GLOB libbpf_sources "${extract_dir}/*.o") -+ else() -+ file(GLOB libbpf_sources "libbpf/src/*.c") -+ endif() - --set(libbpf_uapi libbpf/include/uapi/linux/) -+ set(libbpf_uapi libbpf/include/uapi/linux/) -+endif() - - add_library(bpf-static STATIC libbpf.c perf_reader.c ${libbpf_sources}) - set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bcc_bpf) - add_library(bpf-shared SHARED libbpf.c perf_reader.c ${libbpf_sources}) - set_target_properties(bpf-shared PROPERTIES VERSION ${REVISION_LAST} SOVERSION 0) - set_target_properties(bpf-shared PROPERTIES OUTPUT_NAME bcc_bpf) -+if(CMAKE_USE_LIBBPF_PACKAGE AND LIBBPF_FOUND) -+ target_link_libraries(bpf-shared ${LIBBPF_LIBRARIES}) -+endif() - - set(bcc_common_sources bcc_common.cc bpf_module.cc bcc_btf.cc exported_files.cc) - if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 6 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 6) -diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt -index 528f1bda..b2fba5e3 100644 ---- a/tests/cc/CMakeLists.txt -+++ b/tests/cc/CMakeLists.txt -@@ -7,7 +7,11 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) - include_directories(${CMAKE_SOURCE_DIR}/tests/python/include) - - add_executable(test_static test_static.c) --target_link_libraries(test_static bcc-static) -+if(NOT CMAKE_USE_LIBBPF_PACKAGE) -+ target_link_libraries(test_static bcc-static) -+else() -+ target_link_libraries(test_static bcc-shared-no-libbpf) -+endif() - - add_test(NAME c_test_static COMMAND ${TEST_WRAPPER} c_test_static sudo ${CMAKE_CURRENT_BINARY_DIR}/test_static) - -@@ -35,17 +39,19 @@ set(TEST_LIBBCC_SOURCES - utils.cc - test_parse_tracepoint.cc) - --add_executable(test_libbcc ${TEST_LIBBCC_SOURCES}) -- - file(COPY dummy_proc_map.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - add_library(usdt_test_lib SHARED usdt_test_lib.cc) - --add_dependencies(test_libbcc bcc-shared) --target_link_libraries(test_libbcc ${PROJECT_BINARY_DIR}/src/cc/libbcc.so dl usdt_test_lib) --set_target_properties(test_libbcc PROPERTIES INSTALL_RPATH ${PROJECT_BINARY_DIR}/src/cc) --target_compile_definitions(test_libbcc PRIVATE -DLIBBCC_NAME=\"libbcc.so\") -+if(NOT CMAKE_USE_LIBBPF_PACKAGE) -+ add_executable(test_libbcc ${TEST_LIBBCC_SOURCES}) -+ add_dependencies(test_libbcc bcc-shared) - --add_test(NAME test_libbcc COMMAND ${TEST_WRAPPER} c_test_all sudo ${CMAKE_CURRENT_BINARY_DIR}/test_libbcc) -+ target_link_libraries(test_libbcc ${PROJECT_BINARY_DIR}/src/cc/libbcc.so dl usdt_test_lib) -+ set_target_properties(test_libbcc PROPERTIES INSTALL_RPATH ${PROJECT_BINARY_DIR}/src/cc) -+ target_compile_definitions(test_libbcc PRIVATE -DLIBBCC_NAME=\"libbcc.so\") -+ -+ add_test(NAME test_libbcc COMMAND ${TEST_WRAPPER} c_test_all sudo ${CMAKE_CURRENT_BINARY_DIR}/test_libbcc) -+endif() - - if(LIBBPF_FOUND) - add_executable(test_libbcc_no_libbpf ${TEST_LIBBCC_SOURCES}) --- -2.29.2 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0002-fix-compilation-error-with-latest-llvm12-trunk.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0002-fix-compilation-error-with-latest-llvm12-trunk.patch deleted file mode 100644 index ded9f28c..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0002-fix-compilation-error-with-latest-llvm12-trunk.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 35ff839b1b70b3cd7a9a025d0fd96173e7be566e Mon Sep 17 00:00:00 2001 -From: Yonghong Song -Date: Mon, 4 Jan 2021 19:09:20 -0800 -Subject: [PATCH 2/2] fix compilation error with latest llvm12 trunk -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With latest llvm trunk (llvm12), I hit the following compilation -error: - ... - [ 17%] Building CXX object src/cc/frontends/b/CMakeFiles/b_frontend.dir/codegen_llvm.cc.o - /home/yhs/work/bcc/src/cc/frontends/b/codegen_llvm.cc: In member function - ‘virtual ebpf::StatusTuple ebpf::cc::CodegenLLVM::visit_table_decl_stmt_node(ebpf::cc::TableDeclStmtNode*)’: - /home/yhs/work/bcc/src/cc/frontends/b/codegen_llvm.cc:1122:37: - error: ‘class llvm::Module’ has no member named ‘getTypeB yName’; did you mean ‘getName’? - StructType *decl_struct = mod_->getTypeByName("_struct." + n->id_->name_); - ^~~~~~~~~~~~~ - getName - -This is due to llvm patch https://reviews.llvm.org/D78793 which -changed how to use getTypeByName(). This patch adjusted the usage -in bcc based on this patch. - -Signed-off-by: Yonghong Song ---- - src/cc/frontends/b/codegen_llvm.cc | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/cc/frontends/b/codegen_llvm.cc b/src/cc/frontends/b/codegen_llvm.cc -index d8c9470a..71c83b41 100644 ---- a/src/cc/frontends/b/codegen_llvm.cc -+++ b/src/cc/frontends/b/codegen_llvm.cc -@@ -1119,7 +1119,11 @@ StatusTuple CodegenLLVM::visit_table_decl_stmt_node(TableDeclStmtNode *n) { - StructType *key_stype, *leaf_stype; - TRY2(lookup_struct_type(n->key_type_, &key_stype)); - TRY2(lookup_struct_type(n->leaf_type_, &leaf_stype)); -+#if LLVM_MAJOR_VERSION >= 12 -+ StructType *decl_struct = StructType::getTypeByName(mod_->getContext(), "_struct." + n->id_->name_); -+#else - StructType *decl_struct = mod_->getTypeByName("_struct." + n->id_->name_); -+#endif - if (!decl_struct) - decl_struct = StructType::create(ctx(), "_struct." + n->id_->name_); - if (decl_struct->isOpaque()) -@@ -1182,7 +1186,11 @@ StatusTuple CodegenLLVM::visit_func_decl_stmt_node(FuncDeclStmtNode *n) { - StructType *stype; - //TRY2(lookup_struct_type(formal, &stype)); - auto var = (StructVariableDeclStmtNode *)formal; -+#if LLVM_MAJOR_VERSION >= 12 -+ stype = StructType::getTypeByName(mod_->getContext(), "_struct." + var->struct_id_->name_); -+#else - stype = mod_->getTypeByName("_struct." + var->struct_id_->name_); -+#endif - if (!stype) return mkstatus_(n, "could not find type %s", var->struct_id_->c_str()); - formals.push_back(PointerType::getUnqual(stype)); - } else { --- -2.30.0 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0003-Remove-libbcc-no-libbpf-shared-library-change-libbcc.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0003-Remove-libbcc-no-libbpf-shared-library-change-libbcc.patch deleted file mode 100644 index 25e744f5..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0003-Remove-libbcc-no-libbpf-shared-library-change-libbcc.patch +++ /dev/null @@ -1,156 +0,0 @@ -From c7509c9e6377a374ca28d73960d505e129aace7b Mon Sep 17 00:00:00 2001 -From: Luca Boccassi -Date: Fri, 8 Jan 2021 17:04:03 +0000 -Subject: [PATCH 3/3] Remove libbcc-no-libbpf shared library, change libbcc - linkage instead - -The current upstream split does not work very well, as the SONAME is mangled so -nothing recognises it. Applications link against libbcc, not libbcc_no_bpf. -Remove it entirely, and switch the libbcc.so to dynamically -link with libbpf if CMAKE_USE_LIBBPF_PACKAGE is set. ---- - examples/cpp/CMakeLists.txt | 2 +- - examples/cpp/pyperf/CMakeLists.txt | 2 +- - src/cc/CMakeLists.txt | 36 +++++++++++++----------------- - tests/cc/CMakeLists.txt | 8 +++---- - 4 files changed, 21 insertions(+), 27 deletions(-) - -diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt -index dd343245..45b30280 100644 ---- a/examples/cpp/CMakeLists.txt -+++ b/examples/cpp/CMakeLists.txt -@@ -19,7 +19,7 @@ foreach(EXAMPLE ${EXAMPLES}) - if(NOT CMAKE_USE_LIBBPF_PACKAGE) - target_link_libraries(${NAME} bcc-static) - else() -- target_link_libraries(${NAME} bcc-shared-no-libbpf) -+ target_link_libraries(${NAME} bcc-shared) - endif() - - if(INSTALL_CPP_EXAMPLES) -diff --git a/examples/cpp/pyperf/CMakeLists.txt b/examples/cpp/pyperf/CMakeLists.txt -index 97420806..618b4e75 100644 ---- a/examples/cpp/pyperf/CMakeLists.txt -+++ b/examples/cpp/pyperf/CMakeLists.txt -@@ -10,7 +10,7 @@ target_link_libraries(PyPerf bcc-static) - if(NOT CMAKE_USE_LIBBPF_PACKAGE) - target_link_libraries(PyPerf bcc-static) - else() -- target_link_libraries(PyPerf bcc-shared-no-libbpf) -+ target_link_libraries(PyPerf bcc-shared) - endif() - - if(INSTALL_CPP_EXAMPLES) -diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt -index c8ea63aa..931de2d9 100644 ---- a/src/cc/CMakeLists.txt -+++ b/src/cc/CMakeLists.txt -@@ -83,6 +83,9 @@ set(bcc_sym_sources bcc_syms.cc bcc_elf.c bcc_perf_map.c bcc_proc.c) - set(bcc_common_headers libbpf.h perf_reader.h "${CMAKE_CURRENT_BINARY_DIR}/bcc_version.h") - set(bcc_table_headers file_desc.h table_desc.h table_storage.h) - set(bcc_api_headers bcc_common.h bpf_module.h bcc_exception.h bcc_syms.h bcc_proc.h bcc_elf.h) -+if(LIBBPF_FOUND) -+ set(bcc_common_sources ${bcc_common_sources} libbpf.c perf_reader.c) -+endif() - - if(ENABLE_CLANG_JIT) - add_library(bcc-shared SHARED -@@ -91,16 +94,6 @@ add_library(bcc-shared SHARED - set_target_properties(bcc-shared PROPERTIES VERSION ${REVISION_LAST} SOVERSION 0) - set_target_properties(bcc-shared PROPERTIES OUTPUT_NAME bcc) - --# If there's libbpf detected we build the libbcc-no-libbpf.so library, that --# dynamicaly links libbpf.so, in comparison to static link in libbcc.so. --if(LIBBPF_FOUND) -- add_library(bcc-shared-no-libbpf SHARED -- link_all.cc ${bcc_common_sources} ${bcc_table_sources} ${bcc_sym_sources} -- ${bcc_util_sources} libbpf.c perf_reader.c) -- set_target_properties(bcc-shared-no-libbpf PROPERTIES VERSION ${REVISION_LAST} SOVERSION 0) -- set_target_properties(bcc-shared-no-libbpf PROPERTIES OUTPUT_NAME bcc-no-libbpf) --endif() -- - if(ENABLE_USDT) - set(bcc_usdt_sources usdt/usdt.cc usdt/usdt_args.cc) - # else undefined -@@ -123,18 +116,25 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f - set(bcc_common_libs b_frontend clang_frontend - -Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive - ${LIBELF_LIBRARIES}) --set(bcc_common_libs_for_a ${bcc_common_libs} bpf-static) --set(bcc_common_libs_for_s ${bcc_common_libs} bpf-static) --set(bcc_common_libs_for_n ${bcc_common_libs}) --set(bcc_common_libs_for_lua b_frontend clang_frontend bpf-static -+set(bcc_common_libs_for_a ${bcc_common_libs}) -+set(bcc_common_libs_for_s ${bcc_common_libs}) -+set(bcc_common_libs_for_lua b_frontend clang_frontend - ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES}) -+if(LIBBPF_FOUND) -+ list(APPEND bcc_common_libs_for_a ${LIBBPF_LIBRARIES}) -+ list(APPEND bcc_common_libs_for_s ${LIBBPF_LIBRARIES}) -+ list(APPEND bcc_common_libs_for_lua ${LIBBPF_LIBRARIES}) -+else() -+ list(APPEND bcc_common_libs_for_a bpf-static) -+ list(APPEND bcc_common_libs_for_s bpf-static) -+ list(APPEND bcc_common_libs_for_lua bpf-static) -+endif() - - if(ENABLE_CPP_API) - add_subdirectory(api) - list(APPEND bcc_common_libs_for_a api-static) - # Keep all API functions - list(APPEND bcc_common_libs_for_s -Wl,--whole-archive api-static -Wl,--no-whole-archive) -- list(APPEND bcc_common_libs_for_n -Wl,--whole-archive api-static -Wl,--no-whole-archive) - endif() - - if(ENABLE_USDT) -@@ -142,7 +142,6 @@ if(ENABLE_USDT) - add_subdirectory(usdt) - list(APPEND bcc_common_libs_for_a usdt-static) - list(APPEND bcc_common_libs_for_s usdt-static) -- list(APPEND bcc_common_libs_for_n usdt-static) - list(APPEND bcc_common_libs_for_lua usdt-static) - endif() - -@@ -153,11 +152,6 @@ target_link_libraries(bcc-shared ${bcc_common_libs_for_s}) - target_link_libraries(bcc-static ${bcc_common_libs_for_a} bcc-loader-static) - set(bcc-lua-static ${bcc-lua-static} ${bcc_common_libs_for_lua}) - --if(LIBBPF_FOUND) -- target_link_libraries(bcc-shared-no-libbpf ${bcc_common_libs_for_n} ${LIBBPF_LIBRARIES}) -- install(TARGETS bcc-shared-no-libbpf LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) --endif() -- - install(TARGETS bcc-shared bcc-static bcc-loader-static bpf-static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - install(FILES ${bcc_table_headers} DESTINATION include/bcc) - install(FILES ${bcc_api_headers} DESTINATION include/bcc) -diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt -index b2fba5e3..58493248 100644 ---- a/tests/cc/CMakeLists.txt -+++ b/tests/cc/CMakeLists.txt -@@ -10,7 +10,7 @@ add_executable(test_static test_static.c) - if(NOT CMAKE_USE_LIBBPF_PACKAGE) - target_link_libraries(test_static bcc-static) - else() -- target_link_libraries(test_static bcc-shared-no-libbpf) -+ target_link_libraries(test_static bcc-shared) - endif() - - add_test(NAME c_test_static COMMAND ${TEST_WRAPPER} c_test_static sudo ${CMAKE_CURRENT_BINARY_DIR}/test_static) -@@ -55,11 +55,11 @@ endif() - - if(LIBBPF_FOUND) - add_executable(test_libbcc_no_libbpf ${TEST_LIBBCC_SOURCES}) -- add_dependencies(test_libbcc_no_libbpf bcc-shared-no-libbpf) -+ add_dependencies(test_libbcc_no_libbpf bcc-shared) - -- target_link_libraries(test_libbcc_no_libbpf ${PROJECT_BINARY_DIR}/src/cc/libbcc-no-libbpf.so dl usdt_test_lib ${LIBBPF_LIBRARIES}) -+ target_link_libraries(test_libbcc_no_libbpf ${PROJECT_BINARY_DIR}/src/cc/libbcc.so dl usdt_test_lib ${LIBBPF_LIBRARIES}) - set_target_properties(test_libbcc_no_libbpf PROPERTIES INSTALL_RPATH ${PROJECT_BINARY_DIR}/src/cc) -- target_compile_definitions(test_libbcc_no_libbpf PRIVATE -DLIBBCC_NAME=\"libbcc-no-libbpf.so\") -+ target_compile_definitions(test_libbcc_no_libbpf PRIVATE -DLIBBCC_NAME=\"libbcc.so\") - - add_test(NAME test_libbcc_no_libbpf COMMAND ${TEST_WRAPPER} c_test_all_no_libbpf sudo ${CMAKE_CURRENT_BINARY_DIR}/test_libbcc_no_libbpf) - endif() --- -2.29.2 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0004-cmake-look-for-either-static-or-dynamic-libraries.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0004-cmake-look-for-either-static-or-dynamic-libraries.patch deleted file mode 100644 index 31bcbcd8..00000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0004-cmake-look-for-either-static-or-dynamic-libraries.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 6b4222cd41b3f5e833307aeff2b10c6b084d3f4f Mon Sep 17 00:00:00 2001 -From: Matteo Croce -Date: Wed, 27 Jan 2021 00:26:39 +0100 -Subject: [PATCH] cmake: look for either static or dynamic libraries - -On some distro, static libraries are shipped in a separate package. -Look for either a static or dynamic libbpf, and only fail if neither is found. ---- - cmake/FindLibBpf.cmake | 23 ++++++++++++++++------- - 1 file changed, 16 insertions(+), 7 deletions(-) - -diff --git a/cmake/FindLibBpf.cmake b/cmake/FindLibBpf.cmake -index 75683ae3d..dc10dcee4 100644 ---- a/cmake/FindLibBpf.cmake -+++ b/cmake/FindLibBpf.cmake -@@ -28,9 +28,9 @@ find_path (LIBBPF_INCLUDE_DIR - /sw/include - ENV CPATH) - --find_library (LIBBPF_STATIC_LIBRARIES -+find_library (LIBBPF_LIBRARIES - NAMES -- libbpf.a -+ bpf - PATHS - /usr/lib - /usr/local/lib -@@ -38,10 +38,13 @@ find_library (LIBBPF_STATIC_LIBRARIES - /sw/lib - ENV LIBRARY_PATH - ENV LD_LIBRARY_PATH) -+if(LIBBPF_LIBRARIES) -+list(APPEND PATHS LIBBPF_LIBRARIES) -+endif() - --find_library (LIBBPF_LIBRARIES -+find_library (LIBBPF_STATIC_LIBRARIES - NAMES -- bpf -+ libbpf.a - PATHS - /usr/lib - /usr/local/lib -@@ -49,13 +52,19 @@ find_library (LIBBPF_LIBRARIES - /sw/lib - ENV LIBRARY_PATH - ENV LD_LIBRARY_PATH) -+if(LIBBPF_STATIC_LIBRARIES) -+list(APPEND PATHS LIBBPF_STATIC_LIBRARIES) -+endif() - -+if(LIBBPF_STATIC_LIBRARIES OR LIBBPF_LIBRARIES) - include (FindPackageHandleStandardArgs) - - # handle the QUIETLY and REQUIRED arguments and set LIBBPF_FOUND to TRUE if all listed variables are TRUE - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibBpf "Please install the libbpf development package" -- LIBBPF_LIBRARIES -- LIBBPF_STATIC_LIBRARIES -+ ${PATHS} - LIBBPF_INCLUDE_DIR) - --mark_as_advanced(LIBBPF_INCLUDE_DIR LIBBPF_STATIC_LIBRARIES LIBBPF_LIBRARIES) -+mark_as_advanced(LIBBPF_INCLUDE_DIR ${PATHS}) -+else() -+message(Please install the libbpf development package) -+endif() --- -2.29.2 - diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.17.0.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.20.0.bb similarity index 52% rename from dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.17.0.bb rename to dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.20.0.bb index 8953fd4a..c615a25a 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.17.0.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.20.0.bb @@ -13,33 +13,28 @@ DEPENDS += "bison-native \ " LUAJIT ?= "luajit" -LUAJIT_powerpc64le = "" -LUAJIT_powerpc64 = "" +LUAJIT:powerpc64le = "" +LUAJIT:powerpc64 = "" -RDEPENDS_${PN} += "bash python3 python3-core python3-setuptools xz" +RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" -# Don't fetch submodules otherwise we fetch an older, vendored libbpf version -# We use a dynamic libbpf library instead -SRC_URI = "git://github.com/iovisor/bcc \ +SRC_URI = "gitsm://github.com/iovisor/bcc \ file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ file://0001-tools-trace.py-Fix-failing-to-exit.patch \ file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ - file://0001-fix-compilation-issues-with-latest-llvm12-trunk.patch \ - file://0002-fix-compilation-error-with-latest-llvm12-trunk.patch \ - file://0001-cmake-link-dynamically-to-libclang-cpp-if-found-and-.patch \ - file://0002-cmake-always-link-to-packaged-libbpf-if-CMAKE_USE_LI.patch \ - file://0003-Remove-libbcc-no-libbpf-shared-library-change-libbcc.patch \ - file://0004-cmake-look-for-either-static-or-dynamic-libraries.patch \ " -DEPENDS += "libbpf" +SRCREV = "ab14fafec3fc13f89bd4678b7fc94829dcacaa7b" -SRCREV = "ad5b82a5196b222ed2cdc738d8444e8c9546a77f" +PV .= "+git${SRCPV}" S = "${WORKDIR}/git" -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "examples" +PACKAGECONFIG:remove:libc-musl = "examples" + PACKAGECONFIG[manpages] = "-DENABLE_MAN=ON,-DENABLE_MAN=OFF," +PACKAGECONFIG[examples] = "-DENABLE_EXAMPLES=ON,-DENABLE_EXAMPLES=OFF," EXTRA_OECMAKE = " \ -DENABLE_LLVM_SHARED=ON \ @@ -47,15 +42,14 @@ EXTRA_OECMAKE = " \ -DLLVM_PACKAGE_VERSION=${LLVMVERSION} \ -DPYTHON_CMD=${PYTHON} \ -DPYTHON_FLAGS=--install-lib=${PYTHON_SITEPACKAGES_DIR} \ - -DCMAKE_USE_LIBBPF_PACKAGE=ON \ " -do_install_append() { +do_install:append() { sed -e 's@#!/usr/bin/python@#!/usr/bin/env python3@g' \ -i $(find ${D}${datadir}/${PN} -type f) } -FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}" -FILES_${PN}-doc += "${datadir}/${PN}/man" +FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" +FILES:${PN}-doc += "${datadir}/${PN}/man" COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*)-linux" diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.11.4.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.11.4.bb index d6ab0cea..9f67d943 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.11.4.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.11.4.bb @@ -11,7 +11,7 @@ DEPENDS += "bison-native \ " PV .= "+git${SRCREV}" -RDEPENDS_${PN} += "bash python3 xz" +RDEPENDS:${PN} += "bash python3 xz" SRC_URI = "git://github.com/iovisor/bpftrace;branch=master \ file://0001-bpforc.h-Include-optional-header.patch \ @@ -29,4 +29,4 @@ EXTRA_OECMAKE = " \ " COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*)-linux" -COMPATIBLE_HOST_libc-musl = "null" +COMPATIBLE_HOST:libc-musl = "null" diff --git a/dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend b/dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend index a1d4585f..580d98bf 100644 --- a/dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend +++ b/dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend @@ -1,4 +1,4 @@ -DEPENDS_append = " clang-native" -DEPENDS_remove = "llvm-native" +DEPENDS:append = " clang-native" +DEPENDS:remove = "llvm-native" -EXCLUDE_FROM_WORLD_forcevariable = "" +EXCLUDE_FROM_WORLD:forcevariable = "" diff --git a/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch new file mode 100644 index 00000000..65158b3e --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch @@ -0,0 +1,44 @@ +From b2ad4a0d31083a5fc1dbfb65b51bff14b2b7942f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 2 Sep 2020 10:45:48 -0700 +Subject: [PATCH] Bug 1661378 - pkix: Do not use NULL where 0 is needed Clang + finds this error + +pkix_logger.c:316:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast] + logger->logComponent = (PKIX_ERRORCLASS)NULL; + ^~~~~~~~~~~~~~~~~~~~~ +pkix_logger.c:617:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast] + logger->logComponent = (PKIX_ERRORCLASS)NULL; + ^~~~~~~~~~~~~~~~~~~~~ +2 errors generated. + +Signed-off-by: Khem Raj +--- + lib/nss/libpkix/pkix/util/pkix_logger.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/nss/lib/nss/libpkix/pkix/util/pkix_logger.c b/nss/lib/libpkix/pkix/util/pkix_logger.c +index a916e6e4f..10f537a31 100644 +--- a/nss/lib/nss/libpkix/pkix/util/pkix_logger.c ++++ b/nss/lib/libpkix/pkix/util/pkix_logger.c +@@ -313,7 +313,7 @@ pkix_Logger_Destroy( + + logger->callback = NULL; + PKIX_DECREF(logger->context); +- logger->logComponent = (PKIX_ERRORCLASS)NULL; ++ logger->logComponent = (PKIX_ERRORCLASS)0; + + cleanup: + +@@ -614,7 +614,7 @@ PKIX_Logger_Create( + + logger->callback = callback; + logger->maxLevel = 0; +- logger->logComponent = (PKIX_ERRORCLASS)NULL; ++ logger->logComponent = (PKIX_ERRORCLASS)0; + + PKIX_INCREF(loggerContext); + logger->context = loggerContext; +-- +2.41.0 + diff --git a/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch new file mode 100644 index 00000000..ff7829e7 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch @@ -0,0 +1,49 @@ +Upstream-status: Backport + +The warnings below are actual errors when building. + +Signed-off-by: Raphael Kubo da Costa +--- +From 99c69dc3ca363ce9ff909531f8581252189905d0 Mon Sep 17 00:00:00 2001 +From: "John M. Schanck" +Date: Mon, 13 Dec 2021 16:35:17 +0000 +Subject: [PATCH] Bug 1738028: avoid a clang 13 unused variable warning in opt + build. r=bbeurdouche + +Differential Revision: https://phabricator.services.mozilla.com/D130309 + +--HG-- +extra : moz-landing-system : lando +--- + lib/certhigh/certvfypkix.c | 2 ++ + lib/freebl/shvfy.c | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/nss/lib/certhigh/certvfypkix.c b/nss/lib/certhigh/certvfypkix.c +index 95d88b53f..7c8784f4e 100644 +--- a/nss/lib/certhigh/certvfypkix.c ++++ b/nss/lib/certhigh/certvfypkix.c +@@ -817,6 +817,8 @@ cert_PkixErrorToNssCode( + void *plContext) + { + int errLevel = 0; ++ (void)errLevel; /* Suppress unused var warning (Bug 1738028) */ ++ + PKIX_Int32 nssErr = 0; + PKIX_Error *errPtr = error; + +diff --git a/nss/lib/freebl/shvfy.c b/nss/lib/freebl/shvfy.c +index da42467fd..0428bf6c0 100644 +--- a/nss/lib/freebl/shvfy.c ++++ b/nss/lib/freebl/shvfy.c +@@ -335,6 +335,7 @@ blapi_SHVerifyFile(const char *shName, PRBool self) + SECStatus rv; + DSAPublicKey key; + int count; ++ (void)count; /* Suppress unused var warning (Bug 1738028) */ + #ifdef FREEBL_USE_PRELINK + int pid = 0; + #endif +-- +2.41.0 + diff --git a/dynamic-layers/openembedded-layer/recipes-support/nss/nss_3.51.1.bbappend b/dynamic-layers/openembedded-layer/recipes-support/nss/nss_3.51.1.bbappend new file mode 100644 index 00000000..a4731ff3 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/nss/nss_3.51.1.bbappend @@ -0,0 +1,6 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:toolchain-clang = "\ +file://0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch \ +file://0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch \ +" diff --git a/recipes-bsp/systemd-boot/systemd-boot_%.bbappend b/recipes-bsp/systemd-boot/systemd-boot_%.bbappend index d5e4bcc5..bc0bdd9a 100644 --- a/recipes-bsp/systemd-boot/systemd-boot_%.bbappend +++ b/recipes-bsp/systemd-boot/systemd-boot_%.bbappend @@ -1,4 +1,4 @@ -do_configure_append_toolchain-clang() { +do_configure:append:toolchain-clang() { export EFI_CC="${CC}" sed -i -e "s#O0#O#g" ${S}/src/boot/efi/meson.build } diff --git a/recipes-connectivity/openssl/openssl_%.bbappend b/recipes-connectivity/openssl/openssl_%.bbappend index 408ac387..9112eadc 100644 --- a/recipes-connectivity/openssl/openssl_%.bbappend +++ b/recipes-connectivity/openssl/openssl_%.bbappend @@ -1,8 +1,8 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -LDLIBS_append_toolchain-clang_riscv64 = " -latomic" -LDLIBS_append_toolchain-clang_riscv32 = " -latomic" +LDLIBS:append:toolchain-clang:riscv64 = " -latomic" +LDLIBS:append:toolchain-clang:riscv32 = " -latomic" -do_configure_prepend_toolchain-clang () { +do_configure:prepend:toolchain-clang () { export LDLIBS="${LDLIBS}" } diff --git a/recipes-core/busybox/busybox_1.31.1%.bbappend b/recipes-core/busybox/busybox_1.31.1%.bbappend index 726ee762..201f1f0e 100644 --- a/recipes-core/busybox/busybox_1.31.1%.bbappend +++ b/recipes-core/busybox/busybox_1.31.1%.bbappend @@ -1,9 +1,9 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append_toolchain-clang = "\ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI:append:toolchain-clang = "\ file://0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const-1.31.1.patch \ " # networking/tls_pstm_sqr_comba.c:514:4: error: inline assembly requires more registers than available # SQRADD2(*tmpx++, *tmpy--); # ^ -TOOLCHAIN_x86 = "gcc" +TOOLCHAIN:x86 = "gcc" diff --git a/recipes-core/glib-2.0/glib-2.0_%.bbappend b/recipes-core/glib-2.0/glib-2.0_%.bbappend index 4a0f94af..2aef80ec 100644 --- a/recipes-core/glib-2.0/glib-2.0_%.bbappend +++ b/recipes-core/glib-2.0/glib-2.0_%.bbappend @@ -1 +1 @@ -CFLAGS_append_libc-musl = " -Wno-format-nonliteral" +CFLAGS:append:libc-musl = " -Wno-format-nonliteral" diff --git a/recipes-core/meta/clang-environment.inc b/recipes-core/meta/clang-environment.inc index a238e498..78876100 100644 --- a/recipes-core/meta/clang-environment.inc +++ b/recipes-core/meta/clang-environment.inc @@ -1,14 +1,14 @@ export TARGET_CLANGCC_ARCH = "${TARGET_CC_ARCH}" -TARGET_CLANGCC_ARCH_remove = "-mthumb-interwork" -TARGET_CLANGCC_ARCH_remove = "-mmusl" -TARGET_CLANGCC_ARCH_remove = "-muclibc" -TARGET_CLANGCC_ARCH_remove = "-meb" -TARGET_CLANGCC_ARCH_remove = "-mel" -TARGET_CLANGCC_ARCH_append = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" -TARGET_CLANGCC_ARCH_remove_powerpc = "-mhard-float" -TARGET_CLANGCC_ARCH_remove_powerpc = "-mno-spe" +TARGET_CLANGCC_ARCH:remove = "-mthumb-interwork" +TARGET_CLANGCC_ARCH:remove = "-mmusl" +TARGET_CLANGCC_ARCH:remove = "-muclibc" +TARGET_CLANGCC_ARCH:remove = "-meb" +TARGET_CLANGCC_ARCH:remove = "-mel" +TARGET_CLANGCC_ARCH:append = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" +TARGET_CLANGCC_ARCH:remove:powerpc = "-mhard-float" +TARGET_CLANGCC_ARCH:remove:powerpc = "-mno-spe" -create_sdk_files_append() { +create_sdk_files:append() { script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} if ${@bb.utils.contains('CLANGSDK', '1', 'true', 'false', d)}; then echo 'export CLANGCC="${TARGET_PREFIX}clang --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script diff --git a/recipes-core/meta/meta-environment-extsdk.bbappend b/recipes-core/meta/meta-environment-extsdk.bbappend index e867074c..d40a025e 100644 --- a/recipes-core/meta/meta-environment-extsdk.bbappend +++ b/recipes-core/meta/meta-environment-extsdk.bbappend @@ -1,3 +1,3 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" require clang-environment.inc diff --git a/recipes-core/meta/meta-environment.bbappend b/recipes-core/meta/meta-environment.bbappend index e867074c..d40a025e 100644 --- a/recipes-core/meta/meta-environment.bbappend +++ b/recipes-core/meta/meta-environment.bbappend @@ -1,3 +1,3 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" require clang-environment.inc diff --git a/recipes-core/musl/musl_%.bbappend b/recipes-core/musl/musl_%.bbappend index 70fe10cd..51409687 100644 --- a/recipes-core/musl/musl_%.bbappend +++ b/recipes-core/musl/musl_%.bbappend @@ -1,4 +1,9 @@ -DEPENDS_append_toolchain-clang = " clang-cross-${TARGET_ARCH}" -DEPENDS_remove_toolchain-clang = "virtual/${TARGET_PREFIX}gcc" -TOOLCHAIN_x86-x32 = "gcc" -TOOLCHAIN_powerpc64 = "gcc" +DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}" +DEPENDS:remove:toolchain-clang = "virtual/${TARGET_PREFIX}gcc" +TOOLCHAIN:x86-x32 = "gcc" + +# crashes seen in malloc@plt +# Dump of assembler code for function malloc@got.plt: +# => 0x3f7fc2e8 <+0>: addis r27,r20,-22264 + +TOOLCHAIN:powerpc = "gcc" diff --git a/recipes-core/ncurses/ncurses_%.bbappend b/recipes-core/ncurses/ncurses_%.bbappend index 096d5bcb..6e7a7c13 100644 --- a/recipes-core/ncurses/ncurses_%.bbappend +++ b/recipes-core/ncurses/ncurses_%.bbappend @@ -1 +1 @@ -CACHED_CONFIGUREVARS_append_toolchain-clang = " cf_cv_prog_CC_c_o=yes cf_cv_prog_CXX_c_o=yes" +CACHED_CONFIGUREVARS:append:toolchain-clang = " cf_cv_prog_CC_c_o=yes cf_cv_prog_CXX_c_o=yes" diff --git a/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend index 0c8ae6c3..b2b0a845 100644 --- a/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend +++ b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend @@ -1 +1 @@ -RDEPENDS_${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang', '', d)}" +RDEPENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang', '', d)}" diff --git a/recipes-core/packagegroups/packagegroup-core-buildessential.bbappend b/recipes-core/packagegroups/packagegroup-core-buildessential.bbappend index 403af1ac..527ff741 100644 --- a/recipes-core/packagegroups/packagegroup-core-buildessential.bbappend +++ b/recipes-core/packagegroups/packagegroup-core-buildessential.bbappend @@ -1,3 +1,3 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -RDEPENDS_packagegroup-core-buildessential_append_toolchain-clang = " clang " +RDEPENDS:packagegroup-core-buildessential:append:toolchain-clang = " clang " diff --git a/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend b/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend index 59f0959b..29990f0b 100644 --- a/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend +++ b/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend @@ -1 +1 @@ -RRECOMMENDS_${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'libcxx-dev libcxx-staticdev compiler-rt-dev compiler-rt-staticdev', '', d)}" +RRECOMMENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'libcxx-dev libcxx-staticdev compiler-rt-dev compiler-rt-staticdev', '', d)}" diff --git a/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend b/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend index 5b397b59..3199a698 100644 --- a/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend +++ b/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend @@ -1,3 +1,3 @@ CLANGCROSSCANADIAN = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}" CLANGCROSSCANADIANDEPS += "${@all_multilib_tune_values(d, 'CLANGCROSSCANADIAN')}" -RDEPENDS_${PN} += "${@bb.utils.contains('CLANGSDK', '1', '${CLANGCROSSCANADIANDEPS}', '', d)}" +RDEPENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', '${CLANGCROSSCANADIANDEPS}', '', d)}" diff --git a/recipes-devtools/castxml/castxml_git.bb b/recipes-devtools/castxml/castxml_git.bb index 4d3aa8ae..d9e6ce0e 100644 --- a/recipes-devtools/castxml/castxml_git.bb +++ b/recipes-devtools/castxml/castxml_git.bb @@ -2,11 +2,11 @@ SUMMARY = "C-family abstract syntax tree XML output tool." LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" -SRC_URI = "git://github.com/CastXML/CastXML" +SRC_URI = "git://github.com/CastXML/CastXML;protocol=https;branch=master" -# 0.3.6 is the release for LLVM/Clang v11.0.0 -SRCREV = "902ac163f0291fcfc459f58691481e88c9f91dea" -PV = "0.3.6" +# 0.4.4 is the release for LLVM/Clang v13.0.0 +SRCREV = "2095c10a25610a8ccf6c7ef819440bdac6b13c59" +PV = "0.4.4" S = "${WORKDIR}/git" @@ -14,15 +14,15 @@ DEPENDS = "clang" # Match clang's idea of what TOOLCHAIN should be. TOOLCHAIN = "clang" -TOOLCHAIN_class-native = "gcc" -TOOLCHAIN_class-nativesdk = "clang" - -BUILD_CC_class-nativesdk = "clang" -BUILD_CXX_class-nativesdk = "clang++" -BUILD_AR_class-nativesdk = "llvm-ar" -BUILD_RANLIB_class-nativesdk = "llvm-ranlib" -BUILD_NM_class-nativesdk = "llvm-nm" -LDFLAGS_append_class-nativesdk = " -fuse-ld=gold" +TOOLCHAIN:class-native = "gcc" +TOOLCHAIN:class-nativesdk = "clang" + +BUILD_CC:class-nativesdk = "clang" +BUILD_CXX:class-nativesdk = "clang++" +BUILD_AR:class-nativesdk = "llvm-ar" +BUILD_RANLIB:class-nativesdk = "llvm-ranlib" +BUILD_NM:class-nativesdk = "llvm-nm" +LDFLAGS:append:class-nativesdk = " -fuse-ld=gold" inherit cmake cmake-native pkgconfig python3native diff --git a/recipes-devtools/clang/clang-cross-canadian_git.bb b/recipes-devtools/clang/clang-cross-canadian_git.bb index b16dbe11..e3ae393c 100644 --- a/recipes-devtools/clang/clang-cross-canadian_git.bb +++ b/recipes-devtools/clang/clang-cross-canadian_git.bb @@ -20,13 +20,17 @@ TARGET_ARCH[vardepsexclude] = "TUNE_ARCH" do_install() { install -d ${D}${bindir} - for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata llvm-ar llvm-ranlib llvm-nm + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov do ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool done } SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-llvm-ar \ - *-llvm-ranlib *-llvm-nm *-lld *-ld.lld" -do_install_append() { + *-llvm-ranlib *-llvm-nm *-lld *-ld.lld *-llvm-as *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" +do_install:append() { cross_canadian_bindirlinks } diff --git a/recipes-devtools/clang/clang-cross_git.bb b/recipes-devtools/clang/clang-cross_git.bb index fd8ece58..8aee5cd8 100644 --- a/recipes-devtools/clang/clang-cross_git.bb +++ b/recipes-devtools/clang/clang-cross_git.bb @@ -11,17 +11,21 @@ PN = "clang-cross-${TARGET_ARCH}" require clang.inc require common-source.inc inherit cross -DEPENDS += "clang-native binutils-cross-${TARGET_ARCH}" +DEPENDS += "clang-native virtual/${TARGET_PREFIX}binutils" do_install() { install -d ${D}${bindir} - for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata llvm-ar llvm-ranlib llvm-nm + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov do ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool done } -SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-llvm-ar \ - *-llvm-ranlib *-llvm-nm *-lld *-ld.lld" +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \ + *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" SYSROOT_PREPROCESS_FUNCS += "clangcross_sysroot_preprocess" diff --git a/recipes-devtools/clang/clang-crosssdk_git.bb b/recipes-devtools/clang/clang-crosssdk_git.bb index eaea7659..906bc873 100644 --- a/recipes-devtools/clang/clang-crosssdk_git.bb +++ b/recipes-devtools/clang/clang-crosssdk_git.bb @@ -15,13 +15,17 @@ DEPENDS += "clang-native nativesdk-clang-glue virtual/${TARGET_PREFIX}binutils-c do_install() { install -d ${D}${bindir} - for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata llvm-ar llvm-ranlib llvm-nm + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov do ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool done } -SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-llvm-ar \ - *-llvm-ranlib *-llvm-nm *-lld *-ld.lld" +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \ + *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" sysroot_stage_all () { sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} } diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 6a080462..90c7ae86 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -4,14 +4,14 @@ LLVM_DIR = "llvm${LLVM_RELEASE}" LLVM_GIT ?= "git://github.com/llvm" LLVM_GIT_PROTOCOL ?= "https" -MAJOR_VER = "12" +MAJOR_VER = "14" MINOR_VER = "0" -PATCH_VER = "0" +PATCH_VER = "3" -SRCREV ?= "fa0971b87fb2c9d14d1bba2551e61f02f18f329b" +SRCREV ?= "1f9140064dfbfb0bbda8e51306ea51080b2f7aac" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" -BRANCH = "release/${MAJOR_VER}.x" +BRANCH = "release/14.x" LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" diff --git a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch similarity index 90% rename from recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch rename to recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch index f101e772..f81f714d 100644 --- a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -1,4 +1,4 @@ -From da63df8f02b3a767b68d6de730bb63bba6c3ce33 Mon Sep 17 00:00:00 2001 +From 655270f8c4caa717e10d97013ffd9ed88e06699b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 27 Aug 2017 10:37:49 -0700 Subject: [PATCH] libcxxabi: Find libunwind headers when @@ -17,10 +17,10 @@ Signed-off-by: Khem Raj 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt -index 426c855288fc..06a62c642898 100644 +index 5ef85c9cfc40..1afdb5a17970 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt -@@ -478,14 +478,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") +@@ -535,14 +535,9 @@ endif() # Setup Source Code #=============================================================================== @@ -36,7 +36,7 @@ index 426c855288fc..06a62c642898 100644 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} ${LIBCXXABI_LIBUNWIND_PATH}/include ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} -@@ -496,15 +491,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +@@ -553,15 +548,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) NO_CMAKE_FIND_ROOT_PATH ) diff --git a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch deleted file mode 100644 index c1ba4325..00000000 --- a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 42e6673563ca1d0e433e16c3eefa20b98e280ebd Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 22 May 2017 17:36:16 -0700 -Subject: [PATCH] lldb: Add -lxml2 to linker cmdline of xml is found - -When cross compiling for systems where static libs -for libxml are not available cmake's detection mechanism -resort to linking with libxml.so but doesnt use -lxml2 -liblldbHost.a however requires libxml on linker -cmdline _after_ itself so its use of symbols from libxml2 -can be resolved. Here check for libxml2 being detected and -add it if its found. - -Fixes - -| ../../../../lib/liblldbHost.a(XML.cpp.o): In function `lldb_private::XMLDocument::Clear()': -| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc' -| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc' - -Signed-off-by: Khem Raj ---- - lldb/source/Host/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt -index 7456cb98bfa1..1a732ec5cb89 100644 ---- a/lldb/source/Host/CMakeLists.txt -+++ b/lldb/source/Host/CMakeLists.txt -@@ -138,7 +138,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") - list(APPEND EXTRA_LIBS kvm) - endif() - if (LLDB_ENABLE_LIBXML2) -- list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) -+ list(APPEND EXTRA_LIBS xml2) - endif() - if (HAVE_LIBDL) - list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) diff --git a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch similarity index 93% rename from recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch rename to recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch index e8536d37..74d0c1e2 100644 --- a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch +++ b/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch @@ -1,30 +1,16 @@ -From cfeba7ac05c96abddfad1eeb827ba8d0c968ec94 Mon Sep 17 00:00:00 2001 +From 5a1cf5bd6eb5b7ee299c11b7a39ada74fd60be1d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 19 Apr 2015 15:16:23 -0700 Subject: [PATCH] compiler-rt: support a new embedded linux target Signed-off-by: Khem Raj --- - compiler-rt/lib/builtins/int_util.c | 2 +- .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ .../clang_linux_embedded_test_input.c | 0 - 3 files changed, 287 insertions(+), 1 deletion(-) + 2 files changed, 286 insertions(+) create mode 100644 compiler-rt/make/platform/clang_linux_embedded.mk create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c -diff --git a/compiler-rt/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c -index 226a6e93440d..efc977acbb39 100644 ---- a/compiler-rt/lib/builtins/int_util.c -+++ b/compiler-rt/lib/builtins/int_util.c -@@ -54,7 +54,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) { - #else - - // Get the system definition of abort() --#include -+extern void abort (void) __attribute__ ((__noreturn__)); - - #ifndef _WIN32 - __attribute__((weak)) diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk new file mode 100644 index 000000000000..d0a890075a1c diff --git a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch similarity index 90% rename from recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch rename to recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch index 8b8edd80..b93f68a6 100644 --- a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ b/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -1,4 +1,4 @@ -From 6c786d55d560abca076b7c1b718cdcb31ef5b388 Mon Sep 17 00:00:00 2001 +From 3bc3328f89915cde33c26cec91a57b79109420f0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 23:11:45 -0700 Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use @@ -20,10 +20,10 @@ Signed-off-by: Khem Raj 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt -index b44ad2c2118e..ed8f4bd80e93 100644 +index 3a41aa43e406..3bbfbca1f645 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt -@@ -72,7 +72,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL +@@ -67,7 +67,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL "Build for a bare-metal target.") if (COMPILER_RT_STANDALONE_BUILD) diff --git a/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch similarity index 83% rename from recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch rename to recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch index 4e1120a1..8da23bda 100644 --- a/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -1,4 +1,4 @@ -From 4afcffd0c4b3317b5b5e08e3372b2923ab471e4b Mon Sep 17 00:00:00 2001 +From 2da0422b45b2b9842a2ceb6840beba05356057d2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 00:33:20 +0000 Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are @@ -13,10 +13,10 @@ Signed-off-by: Khem Raj 1 file changed, 21 insertions(+) diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -index defc95d0062a..41d2099d0c5b 100644 +index 9c1abef33b28..29d2a79ddecc 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -@@ -809,6 +809,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") +@@ -815,6 +815,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") TLI_DEFINE_ENUM_INTERNAL(fopen) TLI_DEFINE_STRING_INTERNAL("fopen") /// FILE *fopen64(const char *filename, const char *opentype) @@ -26,7 +26,7 @@ index defc95d0062a..41d2099d0c5b 100644 TLI_DEFINE_ENUM_INTERNAL(fopen64) TLI_DEFINE_STRING_INTERNAL("fopen64") /// int fork(); -@@ -856,6 +859,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") +@@ -862,6 +865,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") /// int fseeko(FILE *stream, off_t offset, int whence); TLI_DEFINE_ENUM_INTERNAL(fseeko) TLI_DEFINE_STRING_INTERNAL("fseeko") @@ -36,7 +36,7 @@ index defc95d0062a..41d2099d0c5b 100644 /// int fseeko64(FILE *stream, off64_t offset, int whence) TLI_DEFINE_ENUM_INTERNAL(fseeko64) TLI_DEFINE_STRING_INTERNAL("fseeko64") -@@ -866,6 +872,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") +@@ -872,6 +878,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") TLI_DEFINE_ENUM_INTERNAL(fstat) TLI_DEFINE_STRING_INTERNAL("fstat") /// int fstat64(int filedes, struct stat64 *buf) @@ -46,7 +46,7 @@ index defc95d0062a..41d2099d0c5b 100644 TLI_DEFINE_ENUM_INTERNAL(fstat64) TLI_DEFINE_STRING_INTERNAL("fstat64") /// int fstatvfs(int fildes, struct statvfs *buf); -@@ -881,6 +890,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") +@@ -887,6 +896,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") TLI_DEFINE_ENUM_INTERNAL(ftello) TLI_DEFINE_STRING_INTERNAL("ftello") /// off64_t ftello64(FILE *stream) @@ -56,7 +56,7 @@ index defc95d0062a..41d2099d0c5b 100644 TLI_DEFINE_ENUM_INTERNAL(ftello64) TLI_DEFINE_STRING_INTERNAL("ftello64") /// int ftrylockfile(FILE *file); -@@ -1007,6 +1019,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") +@@ -1013,6 +1025,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") TLI_DEFINE_ENUM_INTERNAL(lstat) TLI_DEFINE_STRING_INTERNAL("lstat") /// int lstat64(const char *path, struct stat64 *buf); @@ -66,7 +66,7 @@ index defc95d0062a..41d2099d0c5b 100644 TLI_DEFINE_ENUM_INTERNAL(lstat64) TLI_DEFINE_STRING_INTERNAL("lstat64") /// void *malloc(size_t size); -@@ -1250,6 +1265,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") +@@ -1262,6 +1277,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") TLI_DEFINE_ENUM_INTERNAL(stat) TLI_DEFINE_STRING_INTERNAL("stat") /// int stat64(const char *path, struct stat64 *buf); @@ -76,7 +76,7 @@ index defc95d0062a..41d2099d0c5b 100644 TLI_DEFINE_ENUM_INTERNAL(stat64) TLI_DEFINE_STRING_INTERNAL("stat64") /// int statvfs(const char *path, struct statvfs *buf); -@@ -1385,6 +1403,9 @@ TLI_DEFINE_STRING_INTERNAL("times") +@@ -1397,6 +1415,9 @@ TLI_DEFINE_STRING_INTERNAL("times") TLI_DEFINE_ENUM_INTERNAL(tmpfile) TLI_DEFINE_STRING_INTERNAL("tmpfile") /// FILE *tmpfile64(void) diff --git a/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch new file mode 100644 index 00000000..8521d7fe --- /dev/null +++ b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch @@ -0,0 +1,66 @@ +From affcd7f14bca2d9ee95352cd979f66f55901272a Mon Sep 17 00:00:00 2001 +From: Martin Kelly +Date: Fri, 19 May 2017 00:22:57 -0700 +Subject: [PATCH] llvm: allow env override of exe and libdir path + +When using a native llvm-config from inside a sysroot, we need llvm-config to +return the libraries, include directories, etc. from inside the sysroot rather +than from the native sysroot. Thus provide an env override for calling +llvm-config from a target sysroot. + +Add YOCTO_ALTERNATE_LIBDIR and YOCTO_ALTERNATE_EXE_PATH env variables + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Martin Kelly +Signed-off-by: Khem Raj +--- + llvm/tools/llvm-config/llvm-config.cpp | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp +index 8ed88f33ead4..9e26a2b41409 100644 +--- a/llvm/tools/llvm-config/llvm-config.cpp ++++ b/llvm/tools/llvm-config/llvm-config.cpp +@@ -247,6 +247,13 @@ Typical components:\n\ + + /// Compute the path to the main executable. + std::string GetExecutablePath(const char *Argv0) { ++ // Hack for Yocto: we need to override the root path when we are using ++ // llvm-config from within a target sysroot. ++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); ++ if (Sysroot != nullptr) { ++ return Sysroot; ++ } ++ + // This just needs to be some symbol in the binary; C++ doesn't + // allow taking the address of ::main however. + void *P = (void *)(intptr_t)GetExecutablePath; +@@ -326,7 +333,7 @@ int main(int argc, char **argv) { + // Compute various directory locations based on the derived location + // information. + std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir, +- ActiveCMakeDir; ++ ActiveCMakeDir, BaseLibDir; + std::string ActiveIncludeOption; + if (IsInDevelopmentTree) { + ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include"; +@@ -367,7 +374,17 @@ int main(int argc, char **argv) { + sys::fs::make_absolute(ActivePrefix, Path); + ActiveBinDir = std::string(Path.str()); + } +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; ++ // Hack for Yocto: we need to override the lib path when we are using ++ // llvm-config from within a target sysroot since LLVM_LIBDIR_SUFFIX ++ // maybe different for host llvm vs target e.g. ppc64 Libdir=lib64 but ++ // x86_64 Libdir = lib ++ const char *YoctoLibDir = std::getenv("YOCTO_ALTERNATE_LIBDIR"); ++ if (YoctoLibDir != nullptr) { ++ BaseLibDir = std::string(YoctoLibDir); ++ } else { ++ BaseLibDir = std::string("/lib") + LLVM_LIBDIR_SUFFIX; ++ } ++ ActiveLibDir = ActivePrefix + BaseLibDir; + ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } diff --git a/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch b/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch similarity index 87% rename from recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch rename to recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch index ea28de04..d08c50a6 100644 --- a/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch +++ b/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch @@ -1,4 +1,4 @@ -From 15008103e23b5e1cd65bcc32746aa41579583dc5 Mon Sep 17 00:00:00 2001 +From 7ff4f134a5e5e1f6ffe31637a474cf118ae0079b Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Wed, 26 Apr 2017 20:29:41 -0600 Subject: [PATCH] clang: driver: Check sysroot for ldso path @@ -14,10 +14,10 @@ Signed-off-by: Khem Raj 1 file changed, 16 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 9663a7390ada..06b92cc0bf5b 100644 +index f85c04df4f6c..97e987c37e4a 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -507,11 +507,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -493,11 +493,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -37,7 +37,7 @@ index 9663a7390ada..06b92cc0bf5b 100644 break; case llvm::Triple::riscv32: { StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); -@@ -533,6 +541,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -519,6 +527,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -48,7 +48,7 @@ index 9663a7390ada..06b92cc0bf5b 100644 break; case llvm::Triple::systemz: LibDir = "lib"; -@@ -547,6 +559,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -533,6 +545,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = X32 ? "libx32" : "lib64"; Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; diff --git a/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch similarity index 86% rename from recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch rename to recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch index a0d116b0..1c3f9aad 100644 --- a/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ b/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -1,4 +1,4 @@ -From 1b2f69bc1938d4d65dd88c2e43e1bd160312d074 Mon Sep 17 00:00:00 2001 +From 12b2de3db9a53a25610f3c61fef10fe877e765c4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 21:11:06 -0700 Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl @@ -13,10 +13,10 @@ Signed-off-by: Khem Raj 1 file changed, 6 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 1d8a3cdce92a..195a302c8771 100644 +index 7a9570a686f4..633daa58590d 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -628,6 +628,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, +@@ -622,6 +622,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (IsIAMCU) CmdArgs.push_back("-lgloss"); diff --git a/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch deleted file mode 100644 index 4df2d622..00000000 --- a/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 4ed6b8848edbe1c453ce0d23d33551ff023f4fb2 Mon Sep 17 00:00:00 2001 -From: Martin Kelly -Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH] llvm: allow env override of exe path - -When using a native llvm-config from inside a sysroot, we need llvm-config to -return the libraries, include directories, etc. from inside the sysroot rather -than from the native sysroot. Thus provide an env override for calling -llvm-config from a target sysroot. - -Signed-off-by: Martin Kelly -Signed-off-by: Khem Raj ---- - llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp -index 1a2f04552d13..019d8f2b5c5e 100644 ---- a/llvm/tools/llvm-config/llvm-config.cpp -+++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -247,6 +247,13 @@ Typical components:\n\ - - /// Compute the path to the main executable. - std::string GetExecutablePath(const char *Argv0) { -+ // Hack for Yocto: we need to override the root path when we are using -+ // llvm-config from within a target sysroot. -+ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); -+ if (Sysroot != nullptr) { -+ return Sysroot; -+ } -+ - // This just needs to be some symbol in the binary; C++ doesn't - // allow taking the address of ::main however. - void *P = (void *)(intptr_t)GetExecutablePath; diff --git a/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch similarity index 88% rename from recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch rename to recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch index 88d1868c..4752daf7 100644 --- a/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch +++ b/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch @@ -1,4 +1,4 @@ -From af7639bf4db497300060a22f2cc94b37145b8db5 Mon Sep 17 00:00:00 2001 +From 610d6a7c8c9d21f10b225f971a377be49bbaea4f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 09:02:13 -0700 Subject: [PATCH] clang: Prepend trailing '/' to sysroot @@ -24,10 +24,10 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 06b92cc0bf5b..726308413dc9 100644 +index 97e987c37e4a..f9e233f15dfc 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -218,7 +218,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) +@@ -181,7 +181,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) Multilibs = GCCInstallation.getMultilibs(); SelectedMultilib = GCCInstallation.getMultilib(); llvm::Triple::ArchType Arch = Triple.getArch(); diff --git a/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch similarity index 85% rename from recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch rename to recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch index 1e9d395d..02d702c6 100644 --- a/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ b/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -1,4 +1,4 @@ -From f946307a70619c45919ac06fa37c267fd25c3ec8 Mon Sep 17 00:00:00 2001 +From da2647d56a98cc708a6b13e3586e7fb364ef77a0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 19:06:26 -0700 Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime @@ -15,18 +15,18 @@ Signed-off-by: Khem Raj 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp -index b2ddef141a75..784a946b453f 100644 +index d657d21bfcdb..e83a556b708c 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp -@@ -14,6 +14,7 @@ - #include "ToolChains/Flang.h" +@@ -13,6 +13,7 @@ + #include "ToolChains/InterfaceStubs.h" #include "clang/Basic/ObjCRuntime.h" #include "clang/Basic/Sanitizers.h" +#include "clang/Basic/Version.h" #include "clang/Config/config.h" #include "clang/Driver/Action.h" #include "clang/Driver/Driver.h" -@@ -404,7 +405,10 @@ StringRef ToolChain::getOSLibName() const { +@@ -419,7 +420,10 @@ StringRef ToolChain::getOSLibName() const { } std::string ToolChain::getCompilerRTPath() const { diff --git a/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch similarity index 66% rename from recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch rename to recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch index 1b07e5a0..55924c95 100644 --- a/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch +++ b/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch @@ -1,6 +1,6 @@ -From 9c61a33cec25c8f2e0a90d5109808131d2e51c2d Mon Sep 17 00:00:00 2001 +From 6e17f402773f9408a62c8d03a39db5af6f637653 Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Sun, 21 May 2017 15:38:25 -0700 +Date: Sat, 20 Mar 2021 16:09:16 -0700 Subject: [PATCH] clang: Define / releative gcc installation dir This is required for OE gcc installation to work. @@ -10,14 +10,14 @@ installation in OE Signed-off-by: Khem Raj --- - clang/lib/Driver/ToolChains/Gnu.cpp | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) + clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 195a302c8771..05d1d3003881 100644 +index 633daa58590d..d22eaf698eb8 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2514,12 +2514,6 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( +@@ -2517,19 +2517,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( // Whether this library suffix is relevant for the triple. bool Active; } Suffixes[] = { @@ -30,16 +30,17 @@ index 195a302c8771..05d1d3003881 100644 // The Freescale PPC SDK has the gcc libraries in // /usr/lib//x.y.z so have a look there as well. Only do // this on Freescale triples, though, since some systems put a *lot* of -@@ -2528,6 +2522,12 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", TargetTriple.getVendor() == llvm::Triple::Freescale || - TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, - +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}}; ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ + // This is the normal place. + {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, + + // Debian puts cross-compilers in gcc-cross. -+ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}, -+ - // Natively multiarch systems sometimes put the GCC triple-specific - // directory within their multiarch lib directory, resulting in the - // triple appearing twice. ++ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}}; + + for (auto &Suffix : Suffixes) { + if (!Suffix.Active) diff --git a/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch deleted file mode 100644 index 8c2ddeb9..00000000 --- a/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7ab52935bc6bd89529a2478af1ea2cdf192eb0d9 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 10 May 2016 02:00:11 -0700 -Subject: [PATCH] clang: musl/ppc does not support 128-bit long double - -Signed-off-by: Khem Raj ---- - clang/lib/Basic/Targets/PPC.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h -index 56c8f33ef221..b7e7edf270be 100644 ---- a/clang/lib/Basic/Targets/PPC.h -+++ b/clang/lib/Basic/Targets/PPC.h -@@ -386,6 +386,10 @@ public: - LongDoubleFormat = &llvm::APFloat::IEEEdouble(); - } - -+ if (getTriple().isMusl()) { -+ LongDoubleWidth = LongDoubleAlign = 64; -+ LongDoubleFormat = &llvm::APFloat::IEEEdouble(); -+ } - // PPC32 supports atomics up to 4 bytes. - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; - } diff --git a/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch similarity index 53% rename from recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch rename to recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch index a785bdac..b2539f14 100644 --- a/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch +++ b/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -1,4 +1,4 @@ -From c309e121d6aca050119084e3e98371cd8e44ecca Mon Sep 17 00:00:00 2001 +From 718bc533b5d621ee5eb24a87ed882bf82360807c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Jul 2019 22:51:39 -0700 Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static @@ -16,25 +16,19 @@ therefore we need to link in libpthread and libdl to fill these symbols Signed-off-by: Khem Raj --- - clang/lib/Driver/ToolChains/CommonArgs.cpp | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) + clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index bcaea71dca94..95b806e29ef2 100644 +index dfcef2304040..dbc91e427dfb 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1423,8 +1423,13 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, - // Let the linker choose between libunwind.dll.a and libunwind.a - // depending on what's available, and depending on the -static flag +@@ -1472,6 +1472,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, CmdArgs.push_back("-lunwind"); -- } else -+ } else { - CmdArgs.push_back("-l:libunwind.so"); -+ if (Args.hasArg(options::OPT_static)) { -+ CmdArgs.push_back("-lpthread"); -+ CmdArgs.push_back("-ldl"); -+ } -+ } - break; - } - + } else if (LGT == LibGccType::StaticLibGcc) { + CmdArgs.push_back("-l:libunwind.a"); ++ CmdArgs.push_back("-lpthread"); ++ CmdArgs.push_back("-ldl"); + } else if (TC.getTriple().isOSCygMing()) { + if (LGT == LibGccType::SharedLibGcc) + CmdArgs.push_back("-l:libunwind.dll.a"); diff --git a/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch similarity index 78% rename from recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch rename to recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch index 3f2e16ba..c8738300 100644 --- a/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ b/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -1,4 +1,4 @@ -From 00449fb89e8ab3b34f03d3a09a4d859e5d0a8245 Mon Sep 17 00:00:00 2001 +From d26acd3f09d6796c35b29a70480142e70ec74d51 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 26 Dec 2019 12:56:16 -0800 Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build @@ -10,11 +10,11 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+) diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake -index 01cd37124841..f50be9d967df 100644 +index 2a39b6a40a28..8a441729c943 100644 --- a/llvm/cmake/modules/CrossCompile.cmake +++ b/llvm/cmake/modules/CrossCompile.cmake -@@ -79,6 +79,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) - -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}" +@@ -84,6 +84,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) + -DLLVM_ENABLE_RUNTIMES="${llvm_enable_runtimes_arg}" ${external_project_source_dirs} -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" + -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" diff --git a/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch similarity index 91% rename from recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch rename to recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch index 800b58e3..c5920210 100644 --- a/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch +++ b/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch @@ -1,4 +1,4 @@ -From 761be2d8d20d9ebe93fa33719bdd0d25396d812d Mon Sep 17 00:00:00 2001 +From 8bee07de2d0078373f0f1a72e924d7808ddf03e0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 17:00:29 -0800 Subject: [PATCH] Check for atomic intrinsics @@ -15,7 +15,7 @@ Signed-off-by: Khem Raj 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake -index 04eed1448482..e890cfecd139 100644 +index 3c5ba72993a3..34a1b950bbed 100644 --- a/llvm/cmake/modules/CheckAtomic.cmake +++ b/llvm/cmake/modules/CheckAtomic.cmake @@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname) diff --git a/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch b/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch deleted file mode 100644 index 67cc8deb..00000000 --- a/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 3166a3b59f406de57f04a0b6fd0f3f1eabfaaa37 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 16 Aug 2017 15:16:15 -0700 -Subject: [PATCH] clang: Fix ldso for musl on x86 and x32 architectures - -x32 linker is called ld-musl-x32.so.1 and x86 linker -is called ld-musl-i386.so.1, Currently, linker for -x86 is returned as ld-musl-i586.so.1, when default -arch is i586, which is not the right thing - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 726308413dc9..b64396647882 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -426,6 +426,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - if (Triple.isMusl()) { - std::string ArchName; - bool IsArm = false; -+ bool isX32 = false; - - switch (Arch) { - case llvm::Triple::arm: -@@ -438,6 +439,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - ArchName = "armeb"; - IsArm = true; - break; -+ case llvm::Triple::x86: -+ ArchName = "i386"; -+ break; -+ case llvm::Triple::x86_64: -+ isX32 = Triple.getEnvironment() == llvm::Triple::GNUX32; -+ ArchName = isX32 ? "x32" : Triple.getArchName().str(); -+ break; - default: - ArchName = Triple.getArchName().str(); - } diff --git a/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch similarity index 77% rename from recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch rename to recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch index 1500fc91..55875f24 100644 --- a/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch +++ b/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch @@ -1,4 +1,4 @@ -From 5c0a4264ad87c880ade430022e0f128da86bbf6d Mon Sep 17 00:00:00 2001 +From 3d7469e6d46dd19a20500fdb56f21a0cc7198e9d Mon Sep 17 00:00:00 2001 From: Jeremy Puhlman Date: Thu, 16 Jan 2020 21:16:10 +0000 Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx @@ -14,24 +14,24 @@ Signed-off-by: Khem Raj 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt -index 9965104cb5b2..bee4d80bc67a 100644 +index 12dcdf954405..54e446e2aecd 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt -@@ -177,7 +177,7 @@ split_list(LIBCXX_LINK_FLAGS) - if (LIBCXX_ENABLE_SHARED) +@@ -212,7 +212,7 @@ if (LIBCXX_ENABLE_SHARED) add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(cxx_shared PUBLIC cxx-headers - PRIVATE ${LIBCXX_LIBRARIES}) + PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") set_target_properties(cxx_shared PROPERTIES COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" -@@ -252,7 +252,7 @@ endif() - if (LIBCXX_ENABLE_STATIC) +@@ -290,7 +290,7 @@ if (LIBCXX_ENABLE_STATIC) add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(cxx_static PUBLIC cxx-headers - PRIVATE ${LIBCXX_LIBRARIES}) + PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") - set(CMAKE_STATIC_LIBRARY_PREFIX "lib") set_target_properties(cxx_static PROPERTIES + COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" diff --git a/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch similarity index 65% rename from recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch rename to recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch index a9cd7a7d..30deb5b3 100644 --- a/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ b/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch @@ -1,4 +1,4 @@ -From 12fe6e45d18add7da95fe637f9e21425330666f9 Mon Sep 17 00:00:00 2001 +From 728e023a8d2dc85402fbe1295e87023fdb7c4c1b Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Fri, 31 Jan 2020 10:56:11 +0200 Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using @@ -26,32 +26,24 @@ Upstream-Status: Innapropriate [oe-specific] Signed-off-by: Ovidiu Panait --- - clang/cmake/modules/AddClang.cmake | 8 -------- - llvm/cmake/modules/AddLLVM.cmake | 18 ------------------ - llvm/cmake/modules/TableGen.cmake | 7 ------- - 3 files changed, 33 deletions(-) + clang/cmake/modules/AddClang.cmake | 2 -- + llvm/cmake/modules/AddLLVM.cmake | 6 ------ + llvm/cmake/modules/TableGen.cmake | 7 ------- + 3 files changed, 15 deletions(-) diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 704278a0e93b..6ea99c90772c 100644 +index 9bbbfc032b7d..7ee5170bbc71 100644 --- a/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake -@@ -161,15 +161,8 @@ macro(add_clang_tool name) - add_dependencies(${name} clang-resource-headers) - +@@ -159,7 +159,6 @@ macro(add_clang_tool name) if (CLANG_BUILD_TOOLS) -- set(export_to_clangtargets) -- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_clangtargets EXPORT ClangTargets) -- set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True) -- endif() - + get_target_export_arg(${name} Clang export_to_clangtargets) install(TARGETS ${name} - ${export_to_clangtargets} - RUNTIME DESTINATION bin + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) -@@ -178,7 +171,6 @@ macro(add_clang_tool name) +@@ -168,7 +167,6 @@ macro(add_clang_tool name) DEPENDS ${name} COMPONENT ${name}) endif() @@ -60,26 +52,18 @@ index 704278a0e93b..6ea99c90772c 100644 endmacro() diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index 97c9980c7de3..2cb2ead31ba0 100644 +index 37bc98f9e021..d34083fa52ec 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1210,15 +1210,8 @@ macro(add_llvm_tool name) - - if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) +@@ -1251,7 +1251,6 @@ macro(add_llvm_tool name) if( LLVM_BUILD_TOOLS ) -- set(export_to_llvmexports) -- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) -- endif() - + get_target_export_arg(${name} LLVM export_to_llvmexports) install(TARGETS ${name} - ${export_to_llvmexports} RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} COMPONENT ${name}) -@@ -1229,9 +1222,6 @@ macro(add_llvm_tool name) +@@ -1262,9 +1261,6 @@ macro(add_llvm_tool name) endif() endif() endif() @@ -89,23 +73,15 @@ index 97c9980c7de3..2cb2ead31ba0 100644 set_target_properties(${name} PROPERTIES FOLDER "Tools") endmacro(add_llvm_tool name) -@@ -1269,15 +1259,8 @@ macro(add_llvm_utility name) - set_target_properties(${name} PROPERTIES FOLDER "Utils") - if ( ${name} IN_LIST LLVM_TOOLCHAIN_UTILITIES OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) +@@ -1304,7 +1300,6 @@ macro(add_llvm_utility name) if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) -- set(export_to_llvmexports) -- if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) -- endif() - + get_target_export_arg(${name} LLVM export_to_llvmexports) install(TARGETS ${name} - ${export_to_llvmexports} RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} COMPONENT ${name}) -@@ -1286,7 +1269,6 @@ macro(add_llvm_utility name) +@@ -1313,7 +1308,6 @@ macro(add_llvm_utility name) DEPENDS ${name} COMPONENT ${name}) endif() @@ -114,10 +90,10 @@ index 97c9980c7de3..2cb2ead31ba0 100644 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) endif() diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake -index 5f07acc1f692..47fe887e083b 100644 +index 59fd0d3b0733..3b9ac56ed37f 100644 --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/cmake/modules/TableGen.cmake -@@ -177,14 +177,8 @@ macro(add_tablegen target project) +@@ -183,14 +183,8 @@ macro(add_tablegen target project) endif() if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) @@ -132,7 +108,7 @@ index 5f07acc1f692..47fe887e083b 100644 COMPONENT ${target} RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) if(NOT LLVM_ENABLE_IDE) -@@ -193,5 +187,4 @@ macro(add_tablegen target project) +@@ -199,5 +193,4 @@ macro(add_tablegen target project) COMPONENT ${target}) endif() endif() diff --git a/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch b/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch deleted file mode 100644 index 46b6995c..00000000 --- a/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch +++ /dev/null @@ -1,24 +0,0 @@ -From bd42395fa181d5821f0d756d12c534f2cda525c0 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 15 May 2018 10:28:43 -0700 -Subject: [PATCH] clang: scan-view needs python 2.x - -Some distributions e.g. archlinux have switched to pointing -python to python3, therefore its better to be specific about -python version needed. - -Signed-off-by: Khem Raj ---- - clang/tools/scan-view/bin/scan-view | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view -index 6165432e7af8..04ad518a60cd 100755 ---- a/clang/tools/scan-view/bin/scan-view -+++ b/clang/tools/scan-view/bin/scan-view -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2 - - from __future__ import print_function - diff --git a/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch similarity index 90% rename from recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch rename to recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch index da4e3fee..aca23d27 100644 --- a/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ b/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -1,4 +1,4 @@ -From 6ad331a0e464ee28eac7d0a1c658cd007e831297 Mon Sep 17 00:00:00 2001 +From e12e426d3c67b17d74879d7dec434eb64310881e Mon Sep 17 00:00:00 2001 From: Jim Broadus Date: Thu, 26 Mar 2020 16:05:53 -0700 Subject: [PATCH] clang: Fix resource dir location for cross toolchains @@ -19,10 +19,10 @@ Signed-off-by: Khem Raj 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp -index 418e1d3e8ec9..44c9f6e59d3f 100644 +index 3bfddeefc7b2..8a806efb292b 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp -@@ -119,7 +119,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, +@@ -176,7 +176,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, // With a static-library build of libclang, LibClangPath will contain the // path of the embedding binary, which for LLVM binaries will be in bin/. // ../lib gets us to lib/ in both cases. diff --git a/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch similarity index 89% rename from recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch rename to recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch index 521f06d4..ddd52dd3 100644 --- a/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ b/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -1,4 +1,4 @@ -From 5f3d1b71c3e87017dfa471f1561f6c28f34a77f8 Mon Sep 17 00:00:00 2001 +From 554002679332300b789cf44384c2274840ed24d9 Mon Sep 17 00:00:00 2001 From: Oleksandr Ocheretnyi Date: Wed, 15 Apr 2020 00:08:39 +0300 Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso @@ -18,10 +18,10 @@ Signed-off-by: Khem Raj 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 604024bb3df4..812599cdaf84 100644 +index f9e233f15dfc..bf73b1ef27db 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -515,8 +515,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -493,8 +493,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -32,7 +32,7 @@ index 604024bb3df4..812599cdaf84 100644 LibDir = "lib"; } break; -@@ -524,8 +524,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -502,8 +502,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; @@ -43,7 +43,7 @@ index 604024bb3df4..812599cdaf84 100644 LibDir = "lib"; } break; -@@ -549,8 +549,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -527,8 +527,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -54,7 +54,7 @@ index 604024bb3df4..812599cdaf84 100644 LibDir = "lib"; } break; -@@ -567,8 +567,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -545,8 +545,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = X32 ? "libx32" : "lib64"; Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; diff --git a/recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch similarity index 74% rename from recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch rename to recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch index defbc8d9..f54cffd3 100644 --- a/recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch +++ b/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch @@ -1,4 +1,4 @@ -From fd3696213eed77e8c217be0ded0e220c0b597f1e Mon Sep 17 00:00:00 2001 +From 5ce5ec34d618d694a862d345c89eaa2d12e2bfc6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 14 Oct 2020 22:19:57 -0700 Subject: [PATCH] clang: Use python3 in python scripts @@ -14,11 +14,9 @@ Signed-off-by: Khem Raj clang-tools-extra/clang-tidy/rename_check.py | 2 +- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 2 +- - clang/tools/clang-format/clang-format-diff.py | 2 +- clang/tools/clang-format/git-clang-format | 2 +- clang/tools/scan-view/bin/scan-view | 2 +- - clang/utils/hmaptool/hmaptool | 2 +- - 9 files changed, 9 insertions(+), 9 deletions(-) + 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py index 8655af137bb2..e95ba59a421c 100755 @@ -31,7 +29,7 @@ index 8655af137bb2..e95ba59a421c 100755 #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# # diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py -index 14fcfe8d49ff..ee7e682690b7 100755 +index 50a220b3f975..ea40cbc48dd2 100755 --- a/clang-tools-extra/clang-tidy/add_new_check.py +++ b/clang-tools-extra/clang-tidy/add_new_check.py @@ -1,4 +1,4 @@ @@ -41,7 +39,7 @@ index 14fcfe8d49ff..ee7e682690b7 100755 #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# # diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py -index 2410041fd5d2..976a02100cd6 100755 +index 9c2021751e0e..4bb9af8cbe0a 100755 --- a/clang-tools-extra/clang-tidy/rename_check.py +++ b/clang-tools-extra/clang-tidy/rename_check.py @@ -1,4 +1,4 @@ @@ -51,7 +49,7 @@ index 2410041fd5d2..976a02100cd6 100755 #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# # diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -index 17086d15053e..a20b1f1f46b2 100755 +index 6bd05531333b..9e134123ef44 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -1,4 +1,4 @@ @@ -61,7 +59,7 @@ index 17086d15053e..a20b1f1f46b2 100755 #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# # diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -index 313ecd2f9571..a298e38b1a45 100755 +index e6cff6a7414d..582c113fb173 100755 --- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py @@ -1,4 +1,4 @@ @@ -70,18 +68,8 @@ index 313ecd2f9571..a298e38b1a45 100755 # #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===# # -diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py -index 6e653a134289..1c31192a4562 100755 ---- a/clang/tools/clang-format/clang-format-diff.py -+++ b/clang/tools/clang-format/clang-format-diff.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# - # diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format -index ccd2f50fa4ad..cfcfb9fcbaef 100755 +index 7968c4387574..268e4dd14782 100755 --- a/clang/tools/clang-format/git-clang-format +++ b/clang/tools/clang-format/git-clang-format @@ -1,4 +1,4 @@ @@ -91,22 +79,12 @@ index ccd2f50fa4ad..cfcfb9fcbaef 100755 #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===# # diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view -index 04ad518a60cd..07effbca5969 100755 +index 6165432e7af8..07effbca5969 100755 --- a/clang/tools/scan-view/bin/scan-view +++ b/clang/tools/scan-view/bin/scan-view @@ -1,4 +1,4 @@ --#!/usr/bin/env python2 +-#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function -diff --git a/clang/utils/hmaptool/hmaptool b/clang/utils/hmaptool/hmaptool -index e647cde6bc46..7ed2fdf674b1 100755 ---- a/clang/utils/hmaptool/hmaptool -+++ b/clang/utils/hmaptool/hmaptool -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - from __future__ import absolute_import, division, print_function - - import json diff --git a/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch similarity index 89% rename from recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch rename to recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch index 801696e8..44b4828a 100644 --- a/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch +++ b/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -1,4 +1,4 @@ -From 13dedb0bbf780f7d66ddad8b1b33b3a1e0de2d25 Mon Sep 17 00:00:00 2001 +From d720595723c92fe8e2d17887bab85c6fd154825e Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Mon, 25 Jan 2021 16:14:35 +0800 Subject: [PATCH] For x86_64, set Yocto based GCC install search path @@ -57,14 +57,14 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 05d1d3003881..33b1d7fb7061 100644 +index d22eaf698eb8..6fcd5abe7211 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2109,6 +2109,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( +@@ -2105,6 +2105,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( "x86_64-redhat-linux", "x86_64-suse-linux", "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux", "x86_64-unknown-linux", + "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES - "x86_64-amazon-linux", "x86_64-linux-android"}; - static const char *const X32LibDirs[] = {"/libx32"}; - static const char *const X86LibDirs[] = {"/lib32", "/lib"}; + "x86_64-amazon-linux"}; + static const char *const X32Triples[] = {"x86_64-linux-gnux32", + "x86_64-pc-linux-gnux32"}; diff --git a/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch deleted file mode 100644 index 164503fe..00000000 --- a/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch +++ /dev/null @@ -1,310 +0,0 @@ -From d0f788c1fb3d00350c51e88302ecbcf3506e4b53 Mon Sep 17 00:00:00 2001 -From: Evangelos Foutras -Date: Thu, 26 Dec 2019 15:46:19 -0800 -Subject: [PATCH] clang: Enable SSP and PIE by default - -This is a minimal set of changes needed to make clang use SSP and PIE by -default on Arch Linux. Tests that were easy to adjust have been changed -accordingly; only test/Driver/linux-ld.c has been marked as "expected -failure" due to the number of changes it would require (mostly replacing -crtbegin.o with crtbeginS.o). - -Doing so is needed in order to align clang with the new default GCC -behavior in Arch which generates PIE executables by default and also -defaults to -fstack-protector-strong. It is not meant to be a long term -solution, but a simple temporary fix. - -Hopefully these changes will be obsoleted by the introduction upstream -of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) - -Taken from ArchLinux - https://git.archlinux.org/svntogit/packages.git/plain/trunk/enable-SSP-and-PIE-by-default.patch?h=packages/clang - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 10 ++++++++-- - clang/lib/Driver/ToolChains/Linux.h | 4 ++++ - clang/test/Driver/cross-linux.c | 16 ++++++++-------- - clang/test/Driver/env.c | 2 +- - clang/test/Driver/fsanitize.c | 14 +++++++------- - clang/test/Driver/gcc-toolchain.cpp | 2 +- - clang/test/Driver/hexagon-toolchain-elf.c | 2 +- - clang/test/Driver/linux-as.c | 4 ++-- - clang/test/Driver/linux-ld.c | 2 ++ - clang/test/Driver/ppc-abi.c | 4 ++-- - clang/test/Driver/riscv32-toolchain.c | 4 ++-- - clang/test/Driver/riscv64-toolchain.c | 4 ++-- - clang/test/Driver/stack-protector.c | 4 ++-- - 13 files changed, 42 insertions(+), 30 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index b64396647882..604024bb3df4 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -856,8 +856,14 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, - } - - bool Linux::isPIEDefault() const { -- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -- getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ const bool IsMips = getTriple().isMIPS(); -+ const bool IsAndroid = getTriple().isAndroid(); -+ -+ if (IsMips || IsAndroid) -+ return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -+ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ -+ return true; - } - - bool Linux::isNoExecStackDefault() const { -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index 6b16b0e64990..582d4bef81df 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -39,6 +39,10 @@ public: - bool isPIEDefault() const override; - bool isNoExecStackDefault() const override; - bool IsMathErrnoDefault() const override; -+ virtual LangOptions::StackProtectorMode -+ GetDefaultStackProtectorLevel(bool KernelOrKext) const override { -+ return LangOptions::SSPStrong; -+ } - SanitizerMask getSupportedSanitizers() const override; - void addProfileRTLibs(const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs) const override; -diff --git a/clang/test/Driver/cross-linux.c b/clang/test/Driver/cross-linux.c -index 6c2dab260695..c28c5653e348 100644 ---- a/clang/test/Driver/cross-linux.c -+++ b/clang/test/Driver/cross-linux.c -@@ -42,8 +42,8 @@ - // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI32-I386: "-m" "elf_i386" --// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" --// CHECK-MULTI32-I386: "-L[[gcc_install]]" -+// CHECK-MULTI32-I386: "crti.o" "crtbeginS.o" -+// CHECK-MULTI32-I386: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]" - // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32" - // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" - // CHECK-MULTI32-I386: "-L[[sysroot]]/lib" -@@ -60,8 +60,8 @@ - // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI32-X86-64: "-m" "elf_x86_64" --// CHECK-MULTI32-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64{{/|\\\\}}crtbegin.o" --// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64" -+// CHECK-MULTI32-X86-64: "crti.o" "crtbeginS.o" -+// CHECK-MULTI32-X86-64: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" -@@ -79,8 +79,8 @@ - // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI64-I386: "-m" "elf_i386" --// CHECK-MULTI64-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32{{/|\\\\}}crtbegin.o" --// CHECK-MULTI64-I386: "-L[[gcc_install]]/32" -+// CHECK-MULTI64-I386: "crti.o" "crtbeginS.o" -+// CHECK-MULTI64-I386: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" -@@ -98,8 +98,8 @@ - // CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI64-X86-64: "-m" "elf_x86_64" --// CHECK-MULTI64-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" --// CHECK-MULTI64-X86-64: "-L[[gcc_install]]" -+// CHECK-MULTI64-X86-64: "crti.o" "crtbeginS.o" -+// CHECK-MULTI64-X86-64: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]" - // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64" - // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" - // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib" -diff --git a/clang/test/Driver/env.c b/clang/test/Driver/env.c -index 0371bc91c4a3..ea89f5251217 100644 ---- a/clang/test/Driver/env.c -+++ b/clang/test/Driver/env.c -@@ -20,7 +20,7 @@ - // - // CHECK-LD-32-NOT: warning: - // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" --// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" -+// CHECK-LD-32: "crtbeginS.o" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." -diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c -index 8926d55a0cf4..40f628ccae45 100644 ---- a/clang/test/Driver/fsanitize.c -+++ b/clang/test/Driver/fsanitize.c -@@ -330,15 +330,15 @@ - // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 - // OK - --// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE --// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-NO-PIE - // RUN: %clang -target arm-linux-androideabi24 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target aarch64-linux-android -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE --// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE --// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -+// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - - // CHECK-NO-PIE-NOT: "-pie" - // CHECK-NO-PIE: "-mrelocation-model" "static" -@@ -667,12 +667,12 @@ - // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP - // NOSP-NOT: "-fsanitize=safe-stack" - --// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN - // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP --// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP --// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -+// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP -+// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP - // NO-SP-NOT: stack-protector - // NO-SP: "-fsanitize=safe-stack" -diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp -index 6c872f4255c3..f5006d1dd9ab 100644 ---- a/clang/test/Driver/gcc-toolchain.cpp -+++ b/clang/test/Driver/gcc-toolchain.cpp -@@ -26,6 +26,6 @@ - // the same precise formatting of the path as the '-internal-system' flags - // above, so we just blanket wildcard match the 'crtbegin.o'. - // CHECK: "{{[^"]*}}ld{{(.exe)?}}" --// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" -+// CHECK: "crtbeginS.o" - // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" - // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." -diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c -index cc11f9fcba9e..1fe8b5db587b 100644 ---- a/clang/test/Driver/hexagon-toolchain-elf.c -+++ b/clang/test/Driver/hexagon-toolchain-elf.c -@@ -487,7 +487,7 @@ - // RUN: %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK042 %s - // CHECK042: "-cc1" --// CHECK042: "-mrelocation-model" "static" -+// CHECK042: "-mrelocation-model" "pic" - // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" - // CHECK042-NEXT: llvm-mc - // CHECK042: "-gpsize=8" -diff --git a/clang/test/Driver/linux-as.c b/clang/test/Driver/linux-as.c -index 0959bd7ba0a1..4056a672b6f9 100644 ---- a/clang/test/Driver/linux-as.c -+++ b/clang/test/Driver/linux-as.c -@@ -164,7 +164,7 @@ - // CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu" - // - // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ --// RUN: -no-integrated-as -c %s 2>&1 \ -+// RUN: -no-integrated-as -fno-pic -c %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s - // CHECK-SPARCV9: as - // CHECK-SPARCV9: -64 -@@ -173,7 +173,7 @@ - // CHECK-SPARCV9: -o - // - // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ --// RUN: -no-integrated-as -fpic -c %s 2>&1 \ -+// RUN: -no-integrated-as -c %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK-SPARCV9PIC %s - // CHECK-SPARCV9PIC: as - // CHECK-SPARCV9PIC: -64 -diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c -index 24d3c78643f8..9ea22e6e0f64 100644 ---- a/clang/test/Driver/linux-ld.c -+++ b/clang/test/Driver/linux-ld.c -@@ -1,3 +1,5 @@ -+// XFAIL: linux -+ - // General tests that ld invocations on Linux targets sane. Note that we use - // sysroot to make these tests independent of the host system. - // -diff --git a/clang/test/Driver/ppc-abi.c b/clang/test/Driver/ppc-abi.c -index a74a19953ca2..0ba4a14ab74f 100644 ---- a/clang/test/Driver/ppc-abi.c -+++ b/clang/test/Driver/ppc-abi.c -@@ -26,9 +26,9 @@ - - // CHECK-ELFv1: "-mrelocation-model" "static" - // CHECK-ELFv1: "-target-abi" "elfv1" --// CHECK-ELFv1-LE: "-mrelocation-model" "static" -+// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv1-LE: "-target-abi" "elfv1" --// CHECK-ELFv2: "-mrelocation-model" "static" -+// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv2: "-target-abi" "elfv2" - // CHECK-ELFv2-BE: "-mrelocation-model" "static" - // CHECK-ELFv2-BE: "-target-abi" "elfv2" -diff --git a/clang/test/Driver/riscv32-toolchain.c b/clang/test/Driver/riscv32-toolchain.c -index a5852f5f3997..233d9ef003cf 100644 ---- a/clang/test/Driver/riscv32-toolchain.c -+++ b/clang/test/Driver/riscv32-toolchain.c -@@ -84,7 +84,7 @@ - // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" - // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1" --// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32{{/|\\\\}}crtbegin.o" -+// C-RV32-LINUX-MULTI-ILP32: "crtbeginS.o" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32" -@@ -99,7 +99,7 @@ - // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" - // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1" --// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d{{/|\\\\}}crtbegin.o" -+// C-RV32-LINUX-MULTI-ILP32D: "crtbeginS.o" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d" -diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c -index e727f20bb601..a801e5eee462 100644 ---- a/clang/test/Driver/riscv64-toolchain.c -+++ b/clang/test/Driver/riscv64-toolchain.c -@@ -84,7 +84,7 @@ - // C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv" - // C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1" --// C-RV64-LINUX-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64{{/|\\\\}}crtbegin.o" -+// C-RV64-LINUX-MULTI-LP64: "crtbeginS.o" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64" -@@ -99,7 +99,7 @@ - // C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv" - // C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1" --// C-RV64-LINUX-MULTI-LP64D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d{{/|\\\\}}crtbegin.o" -+// C-RV64-LINUX-MULTI-LP64D: "crtbeginS.o" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d" -diff --git a/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c -index a3e40b50eed8..dfffe0d6cf85 100644 ---- a/clang/test/Driver/stack-protector.c -+++ b/clang/test/Driver/stack-protector.c -@@ -3,11 +3,11 @@ - // NOSSP-NOT: "-stack-protector-buffer-size" - - // RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP --// SSP: "-stack-protector" "1" -+// SSP: "-stack-protector" "2" - // SSP-NOT: "-stack-protector-buffer-size" - - // RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF --// SSP-BUF: "-stack-protector" "1" -+// SSP-BUF: "-stack-protector" "2" - // SSP-BUF: "-stack-protector-buffer-size" "16" - - // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD diff --git a/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch similarity index 52% rename from recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch rename to recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch index ef9b2ed5..46f151ae 100644 --- a/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch +++ b/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch @@ -1,4 +1,4 @@ -From 6660c7d48601df4276fb3f51156c96fff103fb79 Mon Sep 17 00:00:00 2001 +From fd5760df7696cd9c6ec9ef38ed6cbab19d70e3ac Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 7 Feb 2021 23:58:41 -0800 Subject: [PATCH] llvm: Do not use find_library for ncurses @@ -12,33 +12,33 @@ clang-12: error: linker command failed with exit code 1 (use -v to see invocatio Signed-off-by: Khem Raj --- - compiler-rt/cmake/config-ix.cmake | 2 +- - llvm/cmake/config-ix.cmake | 2 +- + compiler-rt/cmake/config-ix.cmake | 2 +- + llvm/cmake/modules/FindTerminfo.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake -index 196aa62fd01c..49bbbd257d97 100644 +index 4299a0589a7b..cb53b6fd14bd 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake -@@ -140,7 +140,7 @@ else() +@@ -149,7 +149,7 @@ else() set(MAYBE_REQUIRED) endif() if(LLVM_ENABLE_TERMINFO) - find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) -+ set(TERMINFO_LIB tinfo curses ncurses ncursesw) ++ find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) endif() if(COMPILER_RT_TERMINFO_LIB) set(LLVM_ENABLE_TERMINFO 1) -diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake -index 818fafbce148..2f8ad6652334 100644 ---- a/llvm/cmake/config-ix.cmake -+++ b/llvm/cmake/config-ix.cmake -@@ -175,7 +175,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") - set(MAYBE_REQUIRED) - endif() - if(LLVM_ENABLE_TERMINFO) -- find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) -+ set(TERMINFO_LIB tinfo curses ncurses ncursesw) - endif() - if(TERMINFO_LIB) - set(LLVM_ENABLE_TERMINFO 1) +diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake +index 65edb80fa69a..a58180be8926 100644 +--- a/llvm/cmake/modules/FindTerminfo.cmake ++++ b/llvm/cmake/modules/FindTerminfo.cmake +@@ -11,7 +11,7 @@ + # Additionally, the following import target will be defined: + # Terminfo::terminfo + +-find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) ++find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + + if(Terminfo_LIBRARIES) + include(CMakePushCheckState) diff --git a/recipes-devtools/clang/clang/0029-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch similarity index 86% rename from recipes-devtools/clang/clang/0029-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch rename to recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch index a9658b37..33a351db 100644 --- a/recipes-devtools/clang/clang/0029-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch +++ b/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -1,4 +1,4 @@ -From 7bc8252aff944f2efeaad92c431b1f1c5cf606b1 Mon Sep 17 00:00:00 2001 +From ef4ee8181adc48116a563adafae014409e9432d0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 11 Feb 2021 16:42:49 -0800 Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names @@ -18,10 +18,10 @@ Signed-off-by: Martin Jansa 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp -index 4f483c965282..ffd20d223133 100644 +index a9afcc9db96a..dc48caf02616 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp -@@ -489,7 +489,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { +@@ -506,7 +506,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { .Case("amd", Triple::AMD) .Case("mesa", Triple::Mesa) .Case("suse", Triple::SUSE) diff --git a/recipes-devtools/clang/clang/0031-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch similarity index 96% rename from recipes-devtools/clang/clang/0031-compiler-rt-Use-mcr-based-barrier-on-armv6.patch rename to recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch index 1f3af25d..a407a4be 100644 --- a/recipes-devtools/clang/clang/0031-compiler-rt-Use-mcr-based-barrier-on-armv6.patch +++ b/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch @@ -1,4 +1,4 @@ -From 4f45514fb8841a08d8d3bb68d9cb84b607e652f2 Mon Sep 17 00:00:00 2001 +From 759dff74b297c8bf35d222b17cee3047c0df10b8 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 24 Mar 2021 00:32:09 -0700 Subject: [PATCH] compiler-rt: Use mcr based barrier on armv6 @@ -51,10 +51,10 @@ index c9623249e5d2..7a26170741ad 100644 #define MINMAX_4(rD, rN, rM, cmp_kind) \ diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h -index f6ce6a9fccff..5c6cd9376ac4 100644 +index 69a3d8620f92..60bac86df218 100644 --- a/compiler-rt/lib/builtins/assembly.h +++ b/compiler-rt/lib/builtins/assembly.h -@@ -181,6 +181,14 @@ +@@ -189,6 +189,14 @@ JMP(ip) #endif diff --git a/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 00000000..bb247c94 --- /dev/null +++ b/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From e350e74522f03ed6d202b8130cf615e58a2ea714 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:32:13 -0700 +Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux + +musl e.g. does not provide backtrace APIs + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +index ea8e72be287d..0344074dd254 100644 +--- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp ++++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +@@ -7,7 +7,9 @@ + //===----------------------------------------------------------------------===// + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -21,8 +23,11 @@ + namespace { + size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); +- ++#ifdef __GLIBC__ + return backtrace(reinterpret_cast(TraceBuffer), Size); ++#else ++ return -1; ++#endif + } + + // We don't need any custom handling for the Segv backtrace - the libc unwinder +@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + // to avoid the additional frame. + GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, + void * /*Context*/) { ++#ifdef __GLIBC__ + return Backtrace(TraceBuffer, Size); ++#else ++ return -1; ++#endif + } + + static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, +@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + return; + } + ++#ifdef __GLIBC__ + char **BacktraceSymbols = + backtrace_symbols(reinterpret_cast(Trace), TraceLength); + +@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + Printf("\n"); + if (BacktraceSymbols) + free(BacktraceSymbols); ++#endif + } + } // anonymous namespace + diff --git a/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch b/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch deleted file mode 100644 index e22c0bdc..00000000 --- a/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch +++ /dev/null @@ -1,26 +0,0 @@ -From cbcfe7d13dfc5644c9b8a48e951b43bc15d9f4cf Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Fri, 3 Apr 2020 15:10:37 +0800 -Subject: [PATCH] fix path to libffi - -FFI_LIBRARY_PATH is the full path to libffi so when building something that links to -libLLVMInterpreter, we were looking for libffi in clang's recipe-sysroot instead of -the recipe's sysroot. - -Signed-off-by: Anuj Mittal -Signed-off-by: Khem Raj ---- - llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -index 976219830d5e..9930e01559e9 100644 ---- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -@@ -22,5 +22,5 @@ add_llvm_component_library(LLVMInterpreter - ) - - if( LLVM_ENABLE_FFI ) -- target_link_libraries( LLVMInterpreter PRIVATE ${FFI_LIBRARY_PATH} ) -+ target_link_libraries( LLVMInterpreter PRIVATE ffi ) - endif() diff --git a/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 00000000..880f500d --- /dev/null +++ b/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,27 @@ +From a310ecc416f38d81c13af43cdecaaf001cf06274 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:56:03 -0700 +Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros + +OpenEmbedded does not hardcode mutli-arch like debian therefore ensure +that it still uses the proper tuple + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index bf73b1ef27db..eb92a037c930 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -636,6 +636,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + GCCInstallation.getTriple().getArch() == llvm::Triple::x86 + ? "i386-linux-gnu" + : TripleStr; ++ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian ++ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ DebianMultiarch = TripleStr; + + // Try generic GCC detection first. + if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/recipes-devtools/clang/clang/0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch similarity index 88% rename from recipes-devtools/clang/clang/0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch rename to recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch index e95b4189..cce7b610 100644 --- a/recipes-devtools/clang/clang/0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch +++ b/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch @@ -1,4 +1,4 @@ -From 08c592b1850c9b0c17a9f4163e93682a9f83d7f7 Mon Sep 17 00:00:00 2001 +From 4bbb4ab9d4cd3ff1424bed6346dd8e47cd4bcb24 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 19 May 2021 21:49:18 -0700 Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES @@ -15,10 +15,10 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt -index c50ea0233fae..ddc1128b8ed8 100644 +index 995e853e2a4d..25b79a8d17e8 100644 --- a/compiler-rt/lib/scudo/CMakeLists.txt +++ b/compiler-rt/lib/scudo/CMakeLists.txt -@@ -12,6 +12,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) +@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) diff --git a/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch new file mode 100644 index 00000000..4eac4e39 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch @@ -0,0 +1,29 @@ +From 0806d2c4a56116b99413c506e8ff5ebe11bf270f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 21 May 2021 08:14:29 -0700 +Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips + +clang on mips generate atomic built-ins which should be provided by +libatomic + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt +index 739f131bdefd..5862545b842b 100644 +--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt +@@ -137,6 +137,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS) + + append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND SCUDO_LINK_LIBS atomic) ++endif() ++ + if(COMPILER_RT_HAS_SCUDO_STANDALONE) + add_compiler_rt_object_libraries(RTScudoStandalone + ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} diff --git a/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch b/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch deleted file mode 100644 index 3bd41ea6..00000000 --- a/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f5367ee64b6e74039c0957e1f7d81dc8d597804d Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 6 Feb 2021 12:44:30 -0800 -Subject: [PATCH] compiler-rt: Include stddef.h - -size_t is use in the source needs relevant header to include the -definition, fixes build on musl - -compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:82:61: error: unknown type name 'size_t'; did you mean 'std::size_t'? - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp -index b87798603fda..34e11727d77b 100644 ---- a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp -+++ b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp -@@ -26,6 +26,7 @@ - - #include - #include -+#include // for size_t - #include // for dlsym() - - static void *getFuncAddr(const char *name, uintptr_t wrapper_addr) { diff --git a/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 00000000..6244cd29 --- /dev/null +++ b/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,55 @@ +From a71fda827da45c357d92d07ea491c208c1e044fe Mon Sep 17 00:00:00 2001 +From: Maksim Kita +Date: Sun, 23 May 2021 10:27:29 +0000 +Subject: [PATCH] libunwind: Added unw_backtrace method + +Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libunwind/include/libunwind.h | 1 + + libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+) + +diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +index 9a74faa48d6f..f7480c9cf27a 100644 +--- a/libunwind/include/libunwind.h ++++ b/libunwind/include/libunwind.h +@@ -127,6 +127,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; + extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; + extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; + //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); ++extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; + + extern unw_addr_space_t unw_local_addr_space; + +diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp +index 03f8b75b5bba..730e2393a8f8 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -326,7 +326,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { + #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) + #endif // !defined(__USING_SJLJ_EXCEPTIONS__) + ++int unw_backtrace(void **buffer, int size) { ++ unw_context_t context; ++ unw_cursor_t cursor; ++ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { ++ return 0; ++ } ++ ++ unw_word_t ip; ++ int current = 0; ++ while (unw_step(&cursor) > 0) { ++ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { ++ break; ++ } + ++ buffer[current++] = reinterpret_cast(static_cast(ip)); ++ } ++ ++ return current; ++} + + // Add logging hooks in Debug builds only + #ifndef NDEBUG diff --git a/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch new file mode 100644 index 00000000..6db1e875 --- /dev/null +++ b/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch @@ -0,0 +1,46 @@ +From f69f7529bc8b561ddc32a5057da6d74d90dd9c94 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 12 Jun 2021 08:42:36 -0700 +Subject: [PATCH] Do not force thumb mode directive + +.thumb_func was not switching mode until [1] +so it did not show up but now that .thumb_func (without argument) is +switching mode, its causing build failures on armv6 ( rpi0 ) even when +build is explicitly asking for this file to be built with -marm (ARM +mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function +header which considers arch and mode from compiler cmdline to decide if +the function is built using thumb mode or arm mode. + +[1] https://reviews.llvm.org/D101975 + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h +index 7a26170741ad..d914f9d3a109 100644 +--- a/compiler-rt/lib/builtins/arm/sync-ops.h ++++ b/compiler-rt/lib/builtins/arm/sync-ops.h +@@ -16,9 +16,8 @@ + + #define SYNC_OP_4(op) \ + .p2align 2; \ +- .thumb; \ + .syntax unified; \ +- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ ++ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ + DMB; \ + mov r12, r0; \ + LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ +@@ -31,9 +30,8 @@ + + #define SYNC_OP_8(op) \ + .p2align 2; \ +- .thumb; \ + .syntax unified; \ +- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ ++ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ + push {r4, r5, r6, lr}; \ + DMB; \ + mov r12, r0; \ diff --git a/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 00000000..8bae1a39 --- /dev/null +++ b/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,32 @@ +From 71a195e5ed96e47a21fe3f55708046350ebabdfe Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 11 Aug 2021 18:37:11 -0700 +Subject: [PATCH] clang: Do not use install relative libc++ headers + +In OE we use same clang for native and cross builds, therefore we need +to ensure that native sysroot install of libc++ is not searched for +headers when doing cross compile instead it searches the target sysroot +this is especially troublesome when libcxx-native is staged along with +libcxx e.g. chromium + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 6fcd5abe7211..0d04a199a7af 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2919,7 +2919,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + + // Android never uses the libc++ headers installed alongside the toolchain, + // which are generally incompatible with the NDK libraries anyway. +- if (!getTriple().isAndroid()) ++ // And also do not add it when --sysroot is specified, since it would expect ++ // libc++ headers from sysroot ++ if (!getTriple().isAndroid() && SysRoot.empty()) + if (AddIncludePath(getDriver().Dir + "/../include")) + return; + // If this is a development, non-installed, clang, libcxx will diff --git a/recipes-devtools/clang/clang/0030-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch b/recipes-devtools/clang/clang/0030-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch deleted file mode 100644 index 8093de0e..00000000 --- a/recipes-devtools/clang/clang/0030-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4d51447a11ee6796594fd55718ea62575ecebc78 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 27 Nov 2020 10:11:08 +0000 -Subject: [PATCH] AsmMatcherEmitter: sort ClassInfo lists by name as well - -Otherwise, there are instances which are identical in -every other field and therefore sort non-reproducibly -(which breaks binary and source reproducibiliy). - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin -Signed-off-by: Khem Raj ---- - llvm/utils/TableGen/AsmMatcherEmitter.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -index 9d304910ba4e..d1b50b04fc71 100644 ---- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp -+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -@@ -359,7 +359,10 @@ public: - // name of a class shouldn't be significant. However, some of the backends - // accidentally rely on this behaviour, so it will have to stay like this - // until they are fixed. -- return ValueName < RHS.ValueName; -+ if (ValueName != RHS.ValueName) -+ return ValueName < RHS.ValueName; -+ // All else being equal, we should sort by name, for source and binary reproducibility -+ return Name < RHS.Name; - } - }; - diff --git a/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch new file mode 100644 index 00000000..b814803a --- /dev/null +++ b/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch @@ -0,0 +1,97 @@ +From d7b262b22c16436c836de7f39591eaafd28a4e21 Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Wed, 20 Oct 2021 17:30:36 -0700 +Subject: [PATCH] clang: Fix how driver finds GCC installation path on + OpenEmbedded + +Fix how Clang Driver finds GCC installation path on OpenEmbedded + +- For RISCV (riscv{32,64}) we define new two multi-lib options without any + subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC + builds don't use them. +- Modify how Clang Driver finds GCC installation path. This is important + because GCC files on OpenEmbedded are in two different directories: + (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 + (2) /usr/lib/riscv64-oe-linux/9.2.0 + +Clang Driver will check (1) first. The directory exist, but will produce +no valid multi-libs and there will be no multi-lib selected. (2) contains +actual GCC run-time objects/libraries, but because the path has exact +same GCC version (9.2.0) it will be skipped. + +We modify the approach by allowing to check other directories with the same +GCC version. We also avoid picking GCC installation path if it results in +an empty multi-lib list. + +Upstream-Status: Pending +Signed-off-by: David Abdurachmanov +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- + 1 file changed, 28 insertions(+), 11 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 0d04a199a7af..1e5a3cc2c1f1 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -1641,18 +1641,29 @@ static void findRISCVMultilibs(const Driver &D, + return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); + + FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); +- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); +- Multilib Ilp32f = ++ MultilibSet RISCVMultilibs; ++ ++ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { ++ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); ++ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) ++ .FilterOut(NonExistent); ++ } else { ++ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); ++ Multilib Ilp32f = + makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); +- Multilib Ilp32d = ++ Multilib Ilp32d = + makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); +- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); +- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); +- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); +- MultilibSet RISCVMultilibs = +- MultilibSet() +- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) +- .FilterOut(NonExistent); ++ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); ++ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); ++ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) ++ .FilterOut(NonExistent); ++ } + + Multilib::flags_list Flags; + bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; +@@ -2549,13 +2560,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + continue; // Saw this path before; no need to look at it again. + if (CandidateVersion.isOlderThan(4, 1, 1)) + continue; +- if (CandidateVersion <= Version) ++ if (CandidateVersion < Version) + continue; + + if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), + NeedsBiarchSuffix)) + continue; + ++ // We might have found existing directory with GCCVersion, but it ++ // might not have GCC libraries we are looking for (i.e. return an ++ // empty Mulilibs) ++ if (Multilibs.size() == 0) ++ continue; ++ + Version = CandidateVersion; + GCCTriple.setTriple(CandidateTriple); + // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 00000000..c5eb168d --- /dev/null +++ b/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +From 4dab11c8abdd1a48cd0df4475ef2f82732c7f7e3 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:08:22 +0000 +Subject: [PATCH] Fix lib paths for OpenEmbedded Host + +Under OpenEmbedded Host, while building with clang-native, it cannot find +the GCCInstallPath, which causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +hosttools/ld: cannot find crtbeginS.o: No such file or directory +[snip] + +Before this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 + +After this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 +Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 + +Summary: +For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. +Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. +For clang-native, the target vendor is '-unknown', need to test current distro +to follow above form. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 1e5a3cc2c1f1..d3574b86cb26 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -22,6 +22,7 @@ + #include "clang/Driver/Options.h" + #include "clang/Driver/Tool.h" + #include "clang/Driver/ToolChain.h" ++#include "clang/Driver/Distro.h" + #include "llvm/Option/ArgList.h" + #include "llvm/Support/CodeGen.h" + #include "llvm/Support/Path.h" +@@ -2518,6 +2519,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + const llvm::Triple &TargetTriple, const ArgList &Args, + const std::string &LibDir, StringRef CandidateTriple, + bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { ++ Distro Distro(D.getVFS(), TargetTriple); + // Locations relative to the system lib directory where GCC's triple-specific + // directories might reside. + struct GCCLibSuffix { +@@ -2535,7 +2537,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || ++ Distro.IsOpenEmbedded()}, + + // This is the normal place. + {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, diff --git a/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 00000000..7388f8e7 --- /dev/null +++ b/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +From 12b439deed0381e603155a11f3aec5eb20cd6803 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:55:48 +0000 +Subject: [PATCH] Correct library search path for OpenEmbedded Host + +For OpenEmbedded Host, the gcc install path is +/usr/lib/x86_64-[distroname]-linux/[gcc-version]. +So the library search path is not found with default triple +'x86_64-linux-gnu' for x86_64. Causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) +[snip] + +before this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +after this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/include/clang/Driver/Distro.h | 2 ++ + clang/lib/Driver/Distro.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 3 files changed, 4 insertions(+) + +diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h +index 2723f75e8945..cd43e8f11574 100644 +--- a/clang/include/clang/Driver/Distro.h ++++ b/clang/include/clang/Driver/Distro.h +@@ -44,6 +44,7 @@ public: + RHEL7, + Fedora, + Gentoo, ++ //CLANG_EXTRA_OE_DISTRO_NAME + OpenSUSE, + UbuntuHardy, + UbuntuIntrepid, +@@ -132,6 +133,7 @@ public: + + bool IsGentoo() const { return DistroVal == Gentoo; } + ++ //CLANG_EXTRA_OE_DISTRO_CHECK + /// @} + }; + +diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp +index 5ac38c34d112..f20dd4b526e5 100644 +--- a/clang/lib/Driver/Distro.cpp ++++ b/clang/lib/Driver/Distro.cpp +@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { + .Case("sles", Distro::OpenSUSE) + .Case("opensuse", Distro::OpenSUSE) + .Case("exherbo", Distro::Exherbo) ++ //CLANG_EXTRA_OE_DISTRO_CASE + .Default(Distro::UnknownDistro); + return Version; + } +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index eb92a037c930..c92cef442005 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return "x86_64-linux-android"; + if (TargetEnvironment == llvm::Triple::GNUX32) + return "x86_64-linux-gnux32"; ++ //CLANG_EXTRA_OE_DISTRO_TRIPLE + return "x86_64-linux-gnu"; + case llvm::Triple::aarch64: + if (IsAndroid) diff --git a/recipes-devtools/clang/clang/0032-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch b/recipes-devtools/clang/clang/0032-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch deleted file mode 100644 index a022a714..00000000 --- a/recipes-devtools/clang/clang/0032-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 1d07b3e71bf073da0a25b30efb135adaa876e3df Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 15 Apr 2021 18:58:07 -0700 -Subject: [PATCH] clang: Switch defaults to dwarf-5 debug info on Linux - -GCC 11 has defaulted to DWARF-5 as well, this matches -debug info formats, so mix and match of components with GCC 11 -works. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index 582d4bef81df..82c9494c744e 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -58,6 +58,8 @@ public: - const llvm::opt::ArgList &DriverArgs, const JobAction &JA, - const llvm::fltSemantics *FPType = nullptr) const override; - -+ unsigned GetDefaultDwarfVersion() const override { return 5; } -+ - protected: - Tool *buildAssembler() const override; - Tool *buildLinker() const override; diff --git a/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 00000000..7539afc8 --- /dev/null +++ b/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +From 17c7ad88f765bfbcfe25dd8f76ab9264250b9ea3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 8 Feb 2022 01:31:26 -0800 +Subject: [PATCH] lldb: Link with libatomic on x86 + +cmake atomic check is not sufficient for i686 target where clang14 still +generates __atomic_store calls but the check does not entail this +function and happily thinks that compiler can resolve all atomic via intrinsics +on i686, but thats not the case, ideally the check for determining +atomic operation should be make more robust but until then lets ask to +link with libatomic on i686/linux + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + lldb/source/Utility/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt +index cc0bf5fdb61a..5228bf01c276 100644 +--- a/lldb/source/Utility/CMakeLists.txt ++++ b/lldb/source/Utility/CMakeLists.txt +@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") + list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) + endif () + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND LLDB_SYSTEM_LIBS atomic) ++endif() ++ + if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) + list(APPEND LLDB_SYSTEM_LIBS atomic) + endif() diff --git a/recipes-devtools/clang/clang/0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch b/recipes-devtools/clang/clang/0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch deleted file mode 100644 index cefbf02a..00000000 --- a/recipes-devtools/clang/clang/0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch +++ /dev/null @@ -1,320 +0,0 @@ -From 9583baa3f6787236a2452937bbf962a2418f6423 Mon Sep 17 00:00:00 2001 -From: Jack Andersen -Date: Sun, 5 Dec 2021 14:45:33 -0500 -Subject: [PATCH] [CMake] Installable find modules for terminfo and libffi - -Improves cross-distro portability of LLVM cmake package by resolving paths for -terminfo and libffi via import targets. - -When LLVMExports.cmake is generated for installation, it contains absolute -library paths which are likely to be a common cause of portability issues. To -mitigate this, the discovery logic for these dependencies is refactored into -find modules which get installed alongside LLVMConfig.cmake. The result is -cleaner, cmake-friendly management of these dependencies that respect the -environment of the LLVM package importer. - -Reviewed By: JDevlieghere - -Differential Revision: https://reviews.llvm.org/D114327 ---- - llvm/cmake/config-ix.cmake | 50 +++--------- - llvm/cmake/modules/FindFFI.cmake | 81 +++++++++++++++++++ - llvm/cmake/modules/FindTerminfo.cmake | 43 ++++++++++ - llvm/cmake/modules/LLVMConfig.cmake.in | 11 +++ - .../Interpreter/CMakeLists.txt | 10 +-- - llvm/lib/Support/CMakeLists.txt | 7 +- - 6 files changed, 154 insertions(+), 48 deletions(-) - create mode 100644 llvm/cmake/modules/FindFFI.cmake - create mode 100644 llvm/cmake/modules/FindTerminfo.cmake - -diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake -index 2f8ad6652334..ea0cd107a783 100644 ---- a/llvm/cmake/config-ix.cmake -+++ b/llvm/cmake/config-ix.cmake -@@ -169,18 +169,13 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") - else() - set(HAVE_LIBEDIT 0) - endif() -- if(LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON) -- set(MAYBE_REQUIRED REQUIRED) -- else() -- set(MAYBE_REQUIRED) -- endif() - if(LLVM_ENABLE_TERMINFO) -- set(TERMINFO_LIB tinfo curses ncurses ncursesw) -- endif() -- if(TERMINFO_LIB) -- set(LLVM_ENABLE_TERMINFO 1) -- else() -- set(LLVM_ENABLE_TERMINFO 0) -+ if(LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON) -+ find_package(Terminfo REQUIRED) -+ else() -+ find_package(Terminfo) -+ endif() -+ set(LLVM_ENABLE_TERMINFO "${Terminfo_FOUND}") - endif() - else() - set(LLVM_ENABLE_TERMINFO 0) -@@ -318,38 +313,19 @@ if (LLVM_ENABLE_DOXYGEN) - llvm_find_program(dot) - endif () - --if( LLVM_ENABLE_FFI ) -- find_path(FFI_INCLUDE_PATH ffi.h PATHS ${FFI_INCLUDE_DIR}) -- if( EXISTS "${FFI_INCLUDE_PATH}/ffi.h" ) -- set(FFI_HEADER ffi.h CACHE INTERNAL "") -- set(HAVE_FFI_H 1 CACHE INTERNAL "") -+if(LLVM_ENABLE_FFI) -+ set(FFI_REQUIRE_INCLUDE On) -+ if(LLVM_ENABLE_FFI STREQUAL FORCE_ON) -+ find_package(FFI REQUIRED) - else() -- find_path(FFI_INCLUDE_PATH ffi/ffi.h PATHS ${FFI_INCLUDE_DIR}) -- if( EXISTS "${FFI_INCLUDE_PATH}/ffi/ffi.h" ) -- set(FFI_HEADER ffi/ffi.h CACHE INTERNAL "") -- set(HAVE_FFI_FFI_H 1 CACHE INTERNAL "") -- endif() -+ find_package(FFI) - endif() -- -- if( NOT FFI_HEADER ) -- message(FATAL_ERROR "libffi includes are not found.") -- endif() -- -- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) -- if( NOT FFI_LIBRARY_PATH ) -- message(FATAL_ERROR "libffi is not found.") -- endif() -- -- list(APPEND CMAKE_REQUIRED_LIBRARIES ${FFI_LIBRARY_PATH}) -- list(APPEND CMAKE_REQUIRED_INCLUDES ${FFI_INCLUDE_PATH}) -- check_symbol_exists(ffi_call ${FFI_HEADER} HAVE_FFI_CALL) -- list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${FFI_INCLUDE_PATH}) -- list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${FFI_LIBRARY_PATH}) -+ set(LLVM_ENABLE_FFI "${FFI_FOUND}") - else() - unset(HAVE_FFI_FFI_H CACHE) - unset(HAVE_FFI_H CACHE) - unset(HAVE_FFI_CALL CACHE) --endif( LLVM_ENABLE_FFI ) -+endif() - - # Whether we can use std::is_trivially_copyable to verify llvm::is_trivially_copyable. - CHECK_CXX_SOURCE_COMPILES(" -diff --git a/llvm/cmake/modules/FindFFI.cmake b/llvm/cmake/modules/FindFFI.cmake -new file mode 100644 -index 000000000000..b0d859af8959 ---- /dev/null -+++ b/llvm/cmake/modules/FindFFI.cmake -@@ -0,0 +1,81 @@ -+# Attempts to discover ffi library with a linkable ffi_call function. -+# -+# Example usage: -+# -+# find_package(FFI) -+# -+# FFI_REQUIRE_INCLUDE may be set to consider ffi found if the includes -+# are present in addition to the library. This is useful to keep off -+# for the imported package on platforms that install the library but -+# not the headers. -+# -+# FFI_LIBRARY_DIR may be set to define search paths for the ffi library. -+# -+# If successful, the following variables will be defined: -+# FFI_FOUND -+# FFI_INCLUDE_DIRS -+# FFI_LIBRARIES -+# HAVE_FFI_CALL -+# -+# HAVE_FFI_H or HAVE_FFI_FFI_H is defined depending on the ffi.h include path. -+# -+# Additionally, the following import target will be defined: -+# FFI::ffi -+ -+find_path(FFI_INCLUDE_DIRS ffi.h PATHS ${FFI_INCLUDE_DIR}) -+if( EXISTS "${FFI_INCLUDE_DIRS}/ffi.h" ) -+ set(FFI_HEADER ffi.h CACHE INTERNAL "") -+ set(HAVE_FFI_H 1 CACHE INTERNAL "") -+else() -+ find_path(FFI_INCLUDE_DIRS ffi/ffi.h PATHS ${FFI_INCLUDE_DIR}) -+ if( EXISTS "${FFI_INCLUDE_DIRS}/ffi/ffi.h" ) -+ set(FFI_HEADER ffi/ffi.h CACHE INTERNAL "") -+ set(HAVE_FFI_FFI_H 1 CACHE INTERNAL "") -+ endif() -+endif() -+ -+find_library(FFI_LIBRARIES ffi PATHS ${FFI_LIBRARY_DIR}) -+ -+if(FFI_LIBRARIES) -+ include(CMakePushCheckState) -+ include(CheckCSourceCompiles) -+ cmake_push_check_state() -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${FFI_LIBRARIES}) -+ check_c_source_compiles(" -+ struct ffi_cif; -+ typedef struct ffi_cif ffi_cif; -+ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue); -+ int main() { ffi_call(0, 0, 0, 0); }" -+ HAVE_FFI_CALL) -+ cmake_pop_check_state() -+endif() -+ -+unset(required_includes) -+if(FFI_REQUIRE_INCLUDE) -+ set(required_includes FFI_INCLUDE_DIRS) -+endif() -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args(FFI -+ FOUND_VAR -+ FFI_FOUND -+ REQUIRED_VARS -+ FFI_LIBRARIES -+ ${required_includes} -+ HAVE_FFI_CALL) -+mark_as_advanced(FFI_LIBRARIES -+ FFI_INCLUDE_DIRS -+ HAVE_FFI_CALL -+ FFI_HEADER -+ HAVE_FFI_H -+ HAVE_FFI_FFI_H) -+ -+if(FFI_FOUND) -+ if(NOT TARGET FFI::ffi) -+ add_library(FFI::ffi UNKNOWN IMPORTED) -+ set_target_properties(FFI::ffi PROPERTIES IMPORTED_LOCATION "${FFI_LIBRARIES}") -+ if(FFI_INCLUDE_DIRS) -+ set_target_properties(FFI::ffi PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFI_INCLUDE_DIRS}") -+ endif() -+ endif() -+endif() -diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake -new file mode 100644 -index 000000000000..65edb80fa69a ---- /dev/null -+++ b/llvm/cmake/modules/FindTerminfo.cmake -@@ -0,0 +1,43 @@ -+# Attempts to discover terminfo library with a linkable setupterm function. -+# -+# Example usage: -+# -+# find_package(Terminfo) -+# -+# If successful, the following variables will be defined: -+# Terminfo_FOUND -+# Terminfo_LIBRARIES -+# -+# Additionally, the following import target will be defined: -+# Terminfo::terminfo -+ -+find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) -+ -+if(Terminfo_LIBRARIES) -+ include(CMakePushCheckState) -+ include(CheckCSourceCompiles) -+ cmake_push_check_state() -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${Terminfo_LIBRARIES}) -+ check_c_source_compiles(" -+ int setupterm(char *term, int filedes, int *errret); -+ int main() { return setupterm(0, 0, 0); }" -+ Terminfo_LINKABLE) -+ cmake_pop_check_state() -+endif() -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args(Terminfo -+ FOUND_VAR -+ Terminfo_FOUND -+ REQUIRED_VARS -+ Terminfo_LIBRARIES -+ Terminfo_LINKABLE) -+mark_as_advanced(Terminfo_LIBRARIES -+ Terminfo_LINKABLE) -+ -+if(Terminfo_FOUND) -+ if(NOT TARGET Terminfo::terminfo) -+ add_library(Terminfo::terminfo UNKNOWN IMPORTED) -+ set_target_properties(Terminfo::terminfo PROPERTIES IMPORTED_LOCATION "${Terminfo_LIBRARIES}") -+ endif() -+endif() -diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in -index ac053141b008..42c1ea819717 100644 ---- a/llvm/cmake/modules/LLVMConfig.cmake.in -+++ b/llvm/cmake/modules/LLVMConfig.cmake.in -@@ -2,6 +2,9 @@ - - @LLVM_CONFIG_CODE@ - -+# For finding self-installed Find*.cmake packages. -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") -+ - set(LLVM_VERSION_MAJOR @LLVM_VERSION_MAJOR@) - set(LLVM_VERSION_MINOR @LLVM_VERSION_MINOR@) - set(LLVM_VERSION_PATCH @LLVM_VERSION_PATCH@) -@@ -46,9 +49,17 @@ set(LLVM_ENABLE_ASSERTIONS @LLVM_ENABLE_ASSERTIONS@) - - set(LLVM_ENABLE_EH @LLVM_ENABLE_EH@) - -+set(LLVM_ENABLE_FFI @LLVM_ENABLE_FFI@) -+if(LLVM_ENABLE_FFI) -+ find_package(FFI) -+endif() -+ - set(LLVM_ENABLE_RTTI @LLVM_ENABLE_RTTI@) - - set(LLVM_ENABLE_TERMINFO @LLVM_ENABLE_TERMINFO@) -+if(LLVM_ENABLE_TERMINFO) -+ find_package(Terminfo) -+endif() - - set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@) - -diff --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -index 9930e01559e9..14522ba2a1bf 100644 ---- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -@@ -1,11 +1,3 @@ --# Make sure that the path to libffi headers is on the command --# line. That path can be a compiler's non-default path even when --# FFI_INCLUDE_DIR was not used, because cmake has its own paths for --# searching for headers (CMAKE_SYSTEM_INCLUDE_PATH, for instance): --if( FFI_INCLUDE_PATH ) -- include_directories( ${FFI_INCLUDE_PATH} ) --endif() -- - add_llvm_component_library(LLVMInterpreter - Execution.cpp - ExternalFunctions.cpp -@@ -22,5 +14,5 @@ add_llvm_component_library(LLVMInterpreter - ) - - if( LLVM_ENABLE_FFI ) -- target_link_libraries( LLVMInterpreter PRIVATE ffi ) -+ target_link_libraries( LLVMInterpreter PRIVATE FFI::ffi ) - endif() -diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt -index cdee11412eb5..5909eeef056a 100644 ---- a/llvm/lib/Support/CMakeLists.txt -+++ b/llvm/lib/Support/CMakeLists.txt -@@ -24,7 +24,7 @@ elseif( CMAKE_HOST_UNIX ) - set(system_libs ${system_libs} ${Backtrace_LIBFILE}) - endif() - if( LLVM_ENABLE_TERMINFO ) -- set(imported_libs ${imported_libs} "${TERMINFO_LIB}") -+ set(imported_libs ${imported_libs} Terminfo::terminfo) - endif() - if( LLVM_ENABLE_THREADS AND (HAVE_LIBATOMIC OR HAVE_CXX_LIBATOMICS64) ) - set(system_libs ${system_libs} atomic) -@@ -249,7 +249,10 @@ if(LLVM_ENABLE_ZLIB) - endif() - - if(LLVM_ENABLE_TERMINFO) -- get_library_name(${TERMINFO_LIB} terminfo_library) -+ if(NOT terminfo_library) -+ get_property(terminfo_library TARGET Terminfo::terminfo PROPERTY LOCATION) -+ endif() -+ get_library_name(${terminfo_library} terminfo_library) - set(llvm_system_libs ${llvm_system_libs} "${terminfo_library}") - endif() - diff --git a/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch new file mode 100644 index 00000000..cbc3da1c --- /dev/null +++ b/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch @@ -0,0 +1,35 @@ +From 5c0d026419a69d5b8722f1abb0000caa4c151885 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 11 Feb 2022 12:29:14 -0800 +Subject: [PATCH] clang: exclude openembedded distributions from setting rpath + on openmp executables + +OpenEmbedded based SDKs stage toolchains outsides the target rootfs and +libomp.so is part of the target rootfs and not part of compiler +toolchain install or relative to it. It finds the libraries via +--sysroot during compile. This ensures that -rpath is not added for such +systems, since it is adding cross-compile paths to rpath which is not +correct when the binaries are run on real targets. + +Upstream-Status: Submitted [https://reviews.llvm.org/D119590] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index dbc91e427dfb..b2cbfca9898c 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -648,6 +648,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, + void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, + const ArgList &Args, + ArgStringList &CmdArgs) { ++ // OpenEmbedded/Yocto installs libomp.so into /usr/lib ++ // therefore using -rpath is not needed, on the contrary it adds ++ // paths from cross compiler install location which is not correct ++ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ return; + + if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, + options::OPT_fno_openmp_implicit_rpath, true)) { diff --git a/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch new file mode 100644 index 00000000..bb1a26ab --- /dev/null +++ b/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch @@ -0,0 +1,58 @@ +From 734aaa66800b91abe42bdef1dd721c368fa17b07 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 9 Mar 2022 16:28:16 -0800 +Subject: [PATCH] compiler-rt: Enable __int128 for ppc32 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/CMakeLists.txt | 7 +++---- + compiler-rt/lib/builtins/int_types.h | 2 +- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt +index ea5ad9cdb864..4d1efc690d71 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -607,8 +607,6 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} + set(mips64el_SOURCES ${GENERIC_TF_SOURCES} + ${mips_SOURCES}) + +-set(powerpc_SOURCES ${GENERIC_SOURCES}) +- + set(powerpcspe_SOURCES ${GENERIC_SOURCES}) + + set(powerpc64_SOURCES +@@ -634,6 +632,7 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX") + ) + endif() + set(powerpc64le_SOURCES ${powerpc64_SOURCES}) ++set(powerpc_SOURCES ${powerpc64_SOURCES}) + + set(riscv_SOURCES + riscv/save.S +@@ -740,9 +739,9 @@ else () + list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) + endif() + +- # For RISCV32, we must force enable int128 for compiling long ++ # For RISCV32/PPC32, we must force enable int128 for compiling long + # double routines. +- if("${arch}" STREQUAL "riscv32") ++ if("${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc" ) + list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) + endif() + +diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h +index 7a72de480676..9ee5a327b28a 100644 +--- a/compiler-rt/lib/builtins/int_types.h ++++ b/compiler-rt/lib/builtins/int_types.h +@@ -64,7 +64,7 @@ typedef union { + } udwords; + + #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ +- defined(__riscv) || defined(_WIN64) ++ defined(__riscv) || defined(_WIN64) || defined(__powerpc__) + #define CRT_HAS_128BIT + #endif + diff --git a/recipes-devtools/clang/clang/0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch b/recipes-devtools/clang/clang/0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch deleted file mode 100644 index 0bd32d1c..00000000 --- a/recipes-devtools/clang/clang/0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 78560720a00c1a9b9e8ab416c4cae0eb1f2d1352 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 27 Sep 2022 12:03:15 -0700 -Subject: [PATCH] llvm: Do not use standard search paths in find_library for - ncurses - -This helps it find it in yocto sysroots - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - llvm/cmake/modules/FindTerminfo.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake -index 65edb80fa69a..a58180be8926 100644 ---- a/llvm/cmake/modules/FindTerminfo.cmake -+++ b/llvm/cmake/modules/FindTerminfo.cmake -@@ -11,7 +11,7 @@ - # Additionally, the following import target will be defined: - # Terminfo::terminfo - --find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) -+find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - - if(Terminfo_LIBRARIES) - include(CMakePushCheckState) diff --git a/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch b/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch new file mode 100644 index 00000000..36166455 --- /dev/null +++ b/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch @@ -0,0 +1,65 @@ +From 1c9415806ba6d0d48a160637eea7d1b70efaae69 Mon Sep 17 00:00:00 2001 +From: Pengxuan Zheng +Date: Mon, 4 Apr 2022 18:17:03 -0700 +Subject: [PATCH] [compiler-rt][builtins] Move DMB definition to syn-ops.h + +Upstream-Status: Backported + +Compiler-rt cross-compile for ARMv5 fails because D99282 made it an error if DMB +is used for any pre-ARMv6 targets. More specifically, the "#error only supported +on ARMv6+" added in D99282 will cause compilation to fail when any source file +which includes assembly.h are compiled for pre-ARMv6 targets. Since the only +place where DMB is used is syn-ops.h (which is only included by +arm/sync_fetch_and_* and these files are excluded from being built for older +targets), this patch moves the definition there to avoid the issues described +above. + +Reviewed By: efriedma + +Differential Revision: https://reviews.llvm.org/D123105 +--- + compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++++++ + compiler-rt/lib/builtins/assembly.h | 8 -------- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h +index d914f9d3a109..dca201d8aef7 100644 +--- a/compiler-rt/lib/builtins/arm/sync-ops.h ++++ b/compiler-rt/lib/builtins/arm/sync-ops.h +@@ -14,6 +14,14 @@ + + #include "../assembly.h" + ++#if __ARM_ARCH >= 7 ++#define DMB dmb ++#elif __ARM_ARCH >= 6 ++#define DMB mcr p15, #0, r0, c7, c10, #5 ++#else ++#error DMB is only supported on ARMv6+ ++#endif ++ + #define SYNC_OP_4(op) \ + .p2align 2; \ + .syntax unified; \ +diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h +index 06aa18162e3b..69a3d8620f92 100644 +--- a/compiler-rt/lib/builtins/assembly.h ++++ b/compiler-rt/lib/builtins/assembly.h +@@ -189,14 +189,6 @@ + JMP(ip) + #endif + +-#if __ARM_ARCH >= 7 +-#define DMB dmb +-#elif __ARM_ARCH >= 6 +-#define DMB mcr p15, #0, r0, c7, c10, #5 +-#else +-#error Only use this with ARMv6+ +-#endif +- + #if defined(USE_THUMB_2) + #define WIDE(op) op.w + #else +-- +2.25.1 + diff --git a/recipes-devtools/clang/clang/0036-libc-LWG2993-reference_wrapper-T-conversion-from-U.patch b/recipes-devtools/clang/clang/0036-libc-LWG2993-reference_wrapper-T-conversion-from-U.patch deleted file mode 100644 index aa9b2e79..00000000 --- a/recipes-devtools/clang/clang/0036-libc-LWG2993-reference_wrapper-T-conversion-from-U.patch +++ /dev/null @@ -1,379 +0,0 @@ -From eec04092d67b94f47439a9065b6bd4cd60165be2 Mon Sep 17 00:00:00 2001 -From: Arthur O'Dwyer -Date: Sat, 5 Dec 2020 19:37:41 -0500 -Subject: [PATCH] [libc++] [LWG2993] reference_wrapper conversion from U&& -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Implement the resolution of LWG2993. Replace a deleted constructor -with a constructor that SFINAEs away in appropriate circumstances. -Also, now that the constructor is templated, we must have an -explicit deduction guide to make CTAD work. - -Some tests have been merged in from Agustín Bergé's D40259. - -Differential Revision: https://reviews.llvm.org/D92725 - -Upstream-Status: Backport - ---- - libcxx/docs/Cxx2aStatusIssuesStatus.csv | 2 +- - libcxx/include/__functional_base | 21 ++++- - libcxx/include/functional | 7 +- - .../refwrap.assign/copy_assign.pass.cpp | 20 +++++ - .../refwrap/refwrap.const/deduct.pass.cpp | 31 +++++++ - .../refwrap.const/type_conv_ctor.pass.cpp | 81 +++++++++++++++++++ - .../refwrap.const/type_conv_ctor2.pass.cpp | 61 ++++++++++++++ - .../refwrap/refwrap.const/type_ctor.pass.cpp | 17 ++++ - 8 files changed, 234 insertions(+), 6 deletions(-) - create mode 100644 libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/deduct.pass.cpp - create mode 100644 libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp - create mode 100644 libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor2.pass.cpp - -diff --git a/libcxx/docs/Cxx2aStatusIssuesStatus.csv b/libcxx/docs/Cxx2aStatusIssuesStatus.csv -index d2adde69d9d2..b411f12d0ce3 100644 ---- a/libcxx/docs/Cxx2aStatusIssuesStatus.csv -+++ b/libcxx/docs/Cxx2aStatusIssuesStatus.csv -@@ -35,7 +35,7 @@ - "`2981 `__","Remove redundant deduction guides from standard library","Albuquerque","","" - "`2982 `__","Making size_type consistent in associative container deduction guides","Albuquerque","","" - "`2988 `__","Clause 32 cleanup missed one typename","Albuquerque","","" --"`2993 `__","reference_wrapper conversion from T&&","Albuquerque","","" -+"`2993 `__","reference_wrapper conversion from T&&","Albuquerque","|Complete|","13.0" - "`2998 `__","Requirements on function objects passed to {``forward_``,}list-specific algorithms","Albuquerque","|Nothing To Do|","" - "`3001 `__","weak_ptr::element_type needs remove_extent_t","Albuquerque","","" - "`3024 `__","variant's copies must be deleted instead of disabled via SFINAE","Albuquerque","|Complete|","" -diff --git a/libcxx/include/__functional_base b/libcxx/include/__functional_base -index 1c02e960d5f0..caa746036bf5 100644 ---- a/libcxx/include/__functional_base -+++ b/libcxx/include/__functional_base -@@ -380,13 +380,24 @@ public: - private: - type* __f_; - -+#ifndef _LIBCPP_CXX03_LANG -+ static void __fun(_Tp&) _NOEXCEPT; -+ static void __fun(_Tp&&) = delete; -+#endif -+ - public: - // construct/copy/destroy -- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -+#ifdef _LIBCPP_CXX03_LANG -+ _LIBCPP_INLINE_VISIBILITY - reference_wrapper(type& __f) _NOEXCEPT - : __f_(_VSTD::addressof(__f)) {} --#ifndef _LIBCPP_CXX03_LANG -- private: reference_wrapper(type&&); public: // = delete; // do not bind to temps -+#else -+ template ::value, decltype(__fun(_VSTD::declval<_Up>())) >> -+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -+ reference_wrapper(_Up&& __u) _NOEXCEPT_(noexcept(__fun(_VSTD::declval<_Up>()))) { -+ type& __f = static_cast<_Up&&>(__u); -+ __f_ = _VSTD::addressof(__f); -+ } - #endif - - // access -@@ -511,6 +522,10 @@ public: - #endif // _LIBCPP_CXX03_LANG - }; - -+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES -+template -+reference_wrapper(_Tp&) -> reference_wrapper<_Tp>; -+#endif - - template - inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -diff --git a/libcxx/include/functional b/libcxx/include/functional -index 67baa5bd4b77..f8565e7e6e67 100644 ---- a/libcxx/include/functional -+++ b/libcxx/include/functional -@@ -42,8 +42,8 @@ public: - typedef see below result_type; // Not always defined - - // construct/copy/destroy -- reference_wrapper(T&) noexcept; -- reference_wrapper(T&&) = delete; // do not bind to temps -+ template -+ reference_wrapper(U&&); - reference_wrapper(const reference_wrapper& x) noexcept; - - // assignment -@@ -59,6 +59,9 @@ public: - operator() (ArgTypes&&...) const; - }; - -+template -+ reference_wrapper(T&) -> reference_wrapper; -+ - template reference_wrapper ref(T& t) noexcept; - template void ref(const T&& t) = delete; - template reference_wrapper ref(reference_wrappert) noexcept; -diff --git a/libcxx/test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp -index f82ee72de915..5058a7477581 100644 ---- a/libcxx/test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp -+++ b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp -@@ -21,6 +21,12 @@ class functor1 - { - }; - -+struct convertible_to_int_ref { -+ int val = 0; -+ operator int&() { return val; } -+ operator int const&() const { return val; } -+}; -+ - template - void - test(T& t) -@@ -56,5 +62,19 @@ int main(int, char**) - const int j = 0; - test(j); - -+#if TEST_STD_VER >= 11 -+ convertible_to_int_ref convi; -+ test(convi); -+ convertible_to_int_ref const convic; -+ test(convic); -+ -+ { -+ using Ref = std::reference_wrapper; -+ static_assert((std::is_assignable::value), ""); -+ static_assert((!std::is_assignable::value), ""); -+ static_assert((!std::is_assignable::value), ""); -+ } -+#endif -+ - return 0; - } -diff --git a/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/deduct.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/deduct.pass.cpp -new file mode 100644 -index 000000000000..4e197e8fc3f3 ---- /dev/null -+++ b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/deduct.pass.cpp -@@ -0,0 +1,31 @@ -+//===----------------------------------------------------------------------===// -+// -+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+// See https://llvm.org/LICENSE.txt for license information. -+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+// -+//===----------------------------------------------------------------------===// -+ -+// UNSUPPORTED: c++03, c++11, c++14 -+// UNSUPPORTED: libcpp-no-deduction-guides -+ -+// -+ -+// template -+// reference_wrapper(T&) -> reference_wrapper; -+ -+#include -+ -+int main() -+{ -+ int i = 0; -+ std::reference_wrapper ri(i); -+ static_assert(std::is_same_v>); -+ std::reference_wrapper ri2(ri); -+ static_assert(std::is_same_v>); -+ const int j = 0; -+ std::reference_wrapper rj(j); -+ static_assert(std::is_same_v>); -+ std::reference_wrapper rj2(rj); -+ static_assert(std::is_same_v>); -+} -diff --git a/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp -new file mode 100644 -index 000000000000..d8ad18215fb7 ---- /dev/null -+++ b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp -@@ -0,0 +1,81 @@ -+//===----------------------------------------------------------------------===// -+// -+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+// See https://llvm.org/LICENSE.txt for license information. -+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+// -+//===----------------------------------------------------------------------===// -+ -+// UNSUPPORTED: c++03 -+ -+// -+// -+// reference_wrapper -+// -+// template -+// reference_wrapper(U&&) noexcept(see below); -+ -+#include -+#include -+ -+struct convertible_to_int_ref { -+ int val = 0; -+ operator int&() { return val; } -+ operator int const&() const { return val; } -+}; -+ -+template -+struct nothrow_convertible { -+ int val = 0; -+ operator int&() noexcept(IsNothrow) { return val; } -+}; -+ -+struct convertible_from_int { -+ convertible_from_int(int) {} -+}; -+ -+void meow(std::reference_wrapper) {} -+void meow(convertible_from_int) {} -+ -+int gi; -+std::reference_wrapper purr() { return gi; }; -+ -+template -+void -+test(T& t) -+{ -+ std::reference_wrapper r(t); -+ assert(&r.get() == &t); -+} -+ -+void f() {} -+ -+int main() -+{ -+ convertible_to_int_ref convi; -+ test(convi); -+ convertible_to_int_ref const convic; -+ test(convic); -+ -+ { -+ using Ref = std::reference_wrapper; -+ static_assert((std::is_nothrow_constructible>::value), ""); -+ static_assert((!std::is_nothrow_constructible>::value), ""); -+ } -+ -+ { -+ meow(0); -+ (true) ? purr() : 0; -+ } -+ -+#ifdef __cpp_deduction_guides -+ { -+ int i = 0; -+ std::reference_wrapper ri(i); -+ static_assert((std::is_same>::value), "" ); -+ const int j = 0; -+ std::reference_wrapper rj(j); -+ static_assert((std::is_same>::value), "" ); -+ } -+#endif -+} -diff --git a/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor2.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor2.pass.cpp -new file mode 100644 -index 000000000000..debdc12c8588 ---- /dev/null -+++ b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor2.pass.cpp -@@ -0,0 +1,61 @@ -+//===----------------------------------------------------------------------===// -+// -+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+// See https://llvm.org/LICENSE.txt for license information. -+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+// -+//===----------------------------------------------------------------------===// -+ -+// UNSUPPORTED: c++03 -+ -+// -+// -+// reference_wrapper -+// -+// template -+// reference_wrapper(U&&); -+ -+#include -+#include -+ -+struct B {} b; -+ -+struct A1 { -+ operator B& () const { return b; } -+}; -+struct A2 { -+ operator B& () const noexcept { return b; } -+}; -+ -+int main() -+{ -+ { -+ std::reference_wrapper b1 = A1(); -+ assert(&b1.get() == &b); -+ b1 = A1(); -+ assert(&b1.get() == &b); -+ -+ static_assert(std::is_convertible>::value, ""); -+ static_assert(!std::is_nothrow_constructible, A1>::value, ""); -+#if TEST_STD_VER >= 20 -+ static_assert(!std::is_nothrow_convertible_v>); -+#endif -+ static_assert(std::is_assignable, A1>::value, ""); -+ static_assert(!std::is_nothrow_assignable, A1>::value, ""); -+ } -+ -+ { -+ std::reference_wrapper b2 = A2(); -+ assert(&b2.get() == &b); -+ b2 = A2(); -+ assert(&b2.get() == &b); -+ -+ static_assert(std::is_convertible>::value, ""); -+ static_assert(std::is_nothrow_constructible, A2>::value, ""); -+#if TEST_STD_VER >= 20 -+ static_assert(std::is_nothrow_convertible_v>); -+#endif -+ static_assert(std::is_assignable, A2>::value, ""); -+ static_assert(std::is_nothrow_assignable, A2>::value, ""); -+ } -+} -diff --git a/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp -index 4d536a20411d..af2273452612 100644 ---- a/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp -+++ b/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp -@@ -14,6 +14,7 @@ - - #include - #include -+#include - - #include "test_macros.h" - -@@ -43,5 +44,21 @@ int main(int, char**) - const int j = 0; - test(j); - -+ { -+ using Ref = std::reference_wrapper; -+ static_assert((std::is_constructible::value), ""); -+ static_assert((!std::is_constructible::value), ""); -+ static_assert((!std::is_constructible::value), ""); -+ } -+ -+#if TEST_STD_VER >= 11 -+ { -+ using Ref = std::reference_wrapper; -+ static_assert((std::is_nothrow_constructible::value), ""); -+ static_assert((!std::is_nothrow_constructible::value), ""); -+ static_assert((!std::is_nothrow_constructible::value), ""); -+ } -+#endif -+ - return 0; - } --- -2.34.1 - diff --git a/recipes-devtools/clang/clang/0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch b/recipes-devtools/clang/clang/0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch new file mode 100644 index 00000000..fee7a95a --- /dev/null +++ b/recipes-devtools/clang/clang/0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch @@ -0,0 +1,62 @@ +From 2095a89e5724866ae20d7f123b1c12b2758b58bd Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Mon, 11 Jul 2022 12:53:34 -0700 +Subject: [PATCH] [sanitizer] Remove #include to resolve + fsconfig_command/mount_attr conflict with glibc 2.36 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It is generally not a good idea to mix usage of glibc headers and Linux UAPI +headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc +since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h +defines `fsconfig_command` which conflicts with linux/mount.h: + + .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ + +Remove #include which pulls in linux/mount.h. Expand its 4 macros manually. +Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h. +In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp +but this commit is easy to cherry pick into older compiler-rt releases. + +Fix https://github.com/llvm/llvm-project/issues/56421 + +Reviewed By: #sanitizers, vitalybuka, zatrazz + +Differential Revision: https://reviews.llvm.org/D129471 + +Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/9cf13067cb5088626ba7ee1ec4c42ec59c7995a0] +Signed-off-by: Khem Raj +--- + .../sanitizer_platform_limits_posix.cpp | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +index 32b8f47ed633..a29b31a432f0 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -73,7 +73,9 @@ + #include + #include + #include ++#if SANITIZER_ANDROID + #include ++#endif + #include + #include + #include +@@ -857,10 +859,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT; + unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT; + #endif +- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS; +- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION; +- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS; +- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION; ++ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long); ++ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long); ++ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long); ++ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long); + unsigned IOCTL_GIO_CMAP = GIO_CMAP; + unsigned IOCTL_GIO_FONT = GIO_FONT; + unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP; diff --git a/recipes-devtools/clang/clang/0038-Add-missing-cstdint.patch b/recipes-devtools/clang/clang/0038-Add-missing-cstdint.patch new file mode 100644 index 00000000..f6ef7ade --- /dev/null +++ b/recipes-devtools/clang/clang/0038-Add-missing-cstdint.patch @@ -0,0 +1,32 @@ +From ff1681ddb303223973653f7f5f3f3435b48a1983 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Mon, 23 May 2022 08:03:23 +0100 +Subject: [PATCH] [Support] Add missing header to Signals.h + +Without the change llvm build fails on this week's gcc-13 snapshot as: + + [ 0%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o + In file included from llvm/lib/Support/Signals.cpp:14: + llvm/include/llvm/Support/Signals.h:119:8: error: variable or field 'CleanupOnSignal' declared void + 119 | void CleanupOnSignal(uintptr_t Context); + | ^~~~~~~~~~~~~~~ + +Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983] + +Signed-off-by: Jose Quaresma +--- + llvm/include/llvm/Support/Signals.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/include/llvm/Support/Signals.h b/llvm/include/llvm/Support/Signals.h +index 44f5a750ff5cb..937e0572d4a72 100644 +--- a/llvm/include/llvm/Support/Signals.h ++++ b/llvm/include/llvm/Support/Signals.h +@@ -14,6 +14,7 @@ + #ifndef LLVM_SUPPORT_SIGNALS_H + #define LLVM_SUPPORT_SIGNALS_H + ++#include + #include + + namespace llvm { diff --git a/recipes-devtools/clang/clang/libunwind.pc.in b/recipes-devtools/clang/clang/libunwind.pc.in new file mode 100644 index 00000000..a93d6766 --- /dev/null +++ b/recipes-devtools/clang/clang/libunwind.pc.in @@ -0,0 +1,9 @@ +prefix=/usr +exec_prefix=/usr +libdir=@LIBDIR@ +includedir=/usr/include + +Name: libunwind +Description: libunwind base library +Version: @VERSION@ +Libs: -lunwind diff --git a/recipes-devtools/clang/clang/llvm-config b/recipes-devtools/clang/clang/llvm-config index a139514d..b405604c 100644 --- a/recipes-devtools/clang/clang/llvm-config +++ b/recipes-devtools/clang/clang/llvm-config @@ -5,11 +5,10 @@ # is needed because arguments like --ldflags, --cxxflags, etc. are set by the # native compile rather than the target compile. # - SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" -export YOCTO_ALTERNATE_EXE_PATH="$(readlink -f "$SCRIPT_DIR/../llvm-config")" - +export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" +export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" if [[ $# == 0 ]]; then exec "$NEXT_LLVM_CONFIG" fi @@ -23,6 +22,11 @@ if [[ $1 == "--bindir" ]]; then exec "$NEXT_LLVM_CONFIG" $@ fi +if [[ $1 == "--libfiles" ]]; then + exec "$NEXT_LLVM_CONFIG" $@ +fi + + for arg in "$@"; do case "$arg" in --cppflags) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index b0c81f1e..f6700474 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -10,11 +10,12 @@ require common-source.inc INHIBIT_DEFAULT_DEPS = "1" -BUILD_CC_class-nativesdk = "clang" -BUILD_CXX_class-nativesdk = "clang++" -BUILD_AR_class-nativesdk = "llvm-ar" -BUILD_RANLIB_class-nativesdk = "llvm-ranlib" -BUILD_NM_class-nativesdk = "llvm-nm" +BUILD_CC:class-nativesdk = "clang" +BUILD_CXX:class-nativesdk = "clang++" +BUILD_AR:class-nativesdk = "llvm-ar" +BUILD_RANLIB:class-nativesdk = "llvm-ranlib" +BUILD_NM:class-nativesdk = "llvm-nm" +LDFLAGS:remove:class-nativesdk = "-fuse-ld=lld" inherit cmake cmake-native pkgconfig python3native @@ -52,20 +53,23 @@ def get_clang_experimental_target_arch(bb, d): PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} \ + ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)} \ rtti eh libedit terminfo \ " -PACKAGECONFIG_class-native = "rtti eh libedit shared-libs" -PACKAGECONFIG_class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)}" +PACKAGECONFIG:class-native = "rtti eh libedit shared-libs ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" +PACKAGECONFIG:class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" -PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,,libcxx,compiler-rt" -PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,,libcxx" -PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,libcxx" +PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," +PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," +PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,," +PACKAGECONFIG[libomp] = "-DCLANG_DEFAULT_OPENMP_RUNTIME=libomp,," PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,," PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," PACKAGECONFIG[pfm] = "-DLLVM_ENABLE_LIBPFM=ON,-DLLVM_ENABLE_LIBPFM=OFF,libpfm," PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCHAR=0," +PACKAGECONFIG[lldb-lua] = "-DLLDB_ENABLE_LUA=ON,-DLLDB_ENABLE_LUA=OFF,lua" PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," PACKAGECONFIG[rtti] = "-DLLVM_ENABLE_RTTI=ON,-DLLVM_ENABLE_RTTI=OFF,," @@ -86,8 +90,10 @@ LLVM_ENABLE_RTTI;LLVM_ENABLE_EH;LLVM_BUILD_EXTERNAL_COMPILER_RT;CMAKE_SYSTEM_NAM CMAKE_BUILD_TYPE;BUILD_SHARED_LIBS;LLVM_ENABLE_PROJECTS;LLVM_BINUTILS_INCDIR;\ LLVM_TARGETS_TO_BUILD;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;PYTHON_EXECUTABLE;\ PYTHON_LIBRARY;PYTHON_INCLUDE_DIR;LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN;LLDB_EDITLINE_USE_WCHAR;\ -LLVM_ENABLE_LIBEDIT;LLDB_ENABLE_LIBEDIT; \ -CMAKE_C_FLAGS_RELEASE;CMAKE_CXX_FLAGS_RELEASE;CMAKE_ASM_FLAGS_RELEASE;\ +LLVM_ENABLE_LIBEDIT;LLDB_ENABLE_LIBEDIT;LLDB_PYTHON_RELATIVE_PATH;LLDB_PYTHON_EXE_RELATIVE_PATH;\ +LLDB_PYTHON_EXT_SUFFIX;CMAKE_C_FLAGS_RELEASE;CMAKE_CXX_FLAGS_RELEASE;CMAKE_ASM_FLAGS_RELEASE;\ +CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_UNWINDLIB;\ +CLANG_DEFAULT_OPENMP_RUNTIME;\ " # # Default to build all OE-Core supported target arches (user overridable). @@ -97,21 +103,30 @@ CMAKE_C_FLAGS_RELEASE;CMAKE_CXX_FLAGS_RELEASE;CMAKE_ASM_FLAGS_RELEASE;\ LLVM_TARGETS_TO_BUILD ?= "AMDGPU;AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86" LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" -LLVM_EXPERIMENTAL_TARGETS_TO_BUILD_append = ";${@get_clang_experimental_target_arch(bb, d)}" +LLVM_EXPERIMENTAL_TARGETS_TO_BUILD:append = ";${@get_clang_experimental_target_arch(bb, d)}" -HF = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" HF[vardepvalue] = "${HF}" -LLVM_PROJECTS ?= "clang;clang-tools-extra;lld;lldb" -# There is no LLDB support for RISCV -LLVM_PROJECTS_riscv32 ?= "clang;clang-tools-extra;lld" -LLVM_PROJECTS_riscv64 ?= "clang;clang-tools-extra;lld" +LLVM_PROJECTS ?= "clang;clang-tools-extra;lld${LLDB}" +LLDB ?= ";lldb" +# LLDB support for RISCV/Mips32 does not work yet +LLDB:riscv32 = "" +LLDB:riscv64 = "" +LLDB:mips = "" +LLDB:mipsel = "" +LLDB:powerpc = "" + +# linux hosts (.so) on Windows .pyd +SOLIBSDEV:mingw32 = ".pyd" #CMAKE_VERBOSE = "VERBOSE=1" EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ -DLLVM_ENABLE_PIC=ON \ + -DCLANG_DEFAULT_PIE_ON_LINUX=ON \ -DLLVM_BINDINGS_LIST='' \ -DLLVM_ENABLE_FFI=ON \ -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ @@ -129,12 +144,15 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ " -EXTRA_OECMAKE_append_class-native = "\ +EXTRA_OECMAKE:append:class-native = "\ -DPYTHON_EXECUTABLE='${PYTHON}' \ " -EXTRA_OECMAKE_append_class-nativesdk = "\ +EXTRA_OECMAKE:append:class-nativesdk = "\ -DCMAKE_CROSSCOMPILING:BOOL=ON \ - -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ @@ -143,11 +161,17 @@ EXTRA_OECMAKE_append_class-nativesdk = "\ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ -DLLDB_TABLEGEN=${STAGING_BINDIR_NATIVE}/lldb-tblgen \ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ + -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ -DPYTHON_EXECUTABLE='${PYTHON}' \ " -EXTRA_OECMAKE_append_class-target = "\ +EXTRA_OECMAKE:append:class-target = "\ -DCMAKE_CROSSCOMPILING:BOOL=ON \ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON}' \ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ -DLLDB_TABLEGEN=${STAGING_BINDIR_NATIVE}/lldb-tblgen \ @@ -158,6 +182,9 @@ EXTRA_OECMAKE_append_class-target = "\ -DLLVM_TARGET_ARCH=${@get_clang_target_arch(bb, d)} \ -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS}${HF} \ -DLLVM_HOST_TRIPLE=${TARGET_SYS}${HF} \ + -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ -DLLVM_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ @@ -165,17 +192,17 @@ EXTRA_OECMAKE_append_class-target = "\ " DEPENDS = "binutils zlib libffi libxml2 libxml2-native ninja-native swig-native" -DEPENDS_append_class-nativesdk = " clang-crosssdk-${SDK_ARCH} virtual/${TARGET_PREFIX}binutils-crosssdk nativesdk-python3" -DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} python3" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_ARCH} virtual/${TARGET_PREFIX}binutils-crosssdk nativesdk-python3" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 compiler-rt libcxx" -RRECOMMENDS_${PN} = "binutils" -RRECOMMENDS_${PN}_append_class-target = " libcxx-dev" +RRECOMMENDS:${PN} = "binutils" +RRECOMMENDS:${PN}:append:class-target = " libcxx-dev" -do_install_append() { +do_install:append() { rm -rf ${D}${libdir}/python*/site-packages/six.py } -do_install_append_class-target () { +do_install:append:class-target () { # Allow bin path to change based on YOCTO_ALTERNATE_EXE_PATH sed -i 's;${_IMPORT_PREFIX}/bin;${_IMPORT_PREFIX_BIN};g' ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake @@ -190,15 +217,16 @@ endif()\n" ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then mkdir -p ${D}${nonarch_libdir} mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang - lnr ${D}${nonarch_libdir}/clang ${D}${libdir}/clang + ln -rs ${D}${nonarch_libdir}/clang ${D}${libdir}/clang rmdir --ignore-fail-on-non-empty ${D}${libdir} fi - for t in clang clang++ llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip; do + for t in clang clang++ llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov; do ln -sf $t ${D}${bindir}/${TARGET_PREFIX}$t done } -do_install_append_class-native () { +do_install:append:class-native () { install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen install -Dm 0755 ${B}${BINPATHPREFIX}/bin/lldb-tblgen ${D}${bindir}/lldb-tblgen for f in `find ${D}${bindir} -executable -type f -not -type l`; do @@ -210,7 +238,7 @@ do_install_append_class-native () { ln -sf llvm-config ${D}${bindir}/llvm-config${PV} } -do_install_append_class-nativesdk () { +do_install:append:class-nativesdk () { install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen install -Dm 0755 ${B}${BINPATHPREFIX}/bin/lldb-tblgen ${D}${bindir}/lldb-tblgen for f in `find ${D}${bindir} -executable -type f -not -type l`; do @@ -226,15 +254,27 @@ do_install_append_class-nativesdk () { PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python libclang lldb lldb-server liblldb" PROVIDES += "llvm llvm${PV}" -PROVIDES_append_class-native = " llvm-native" +PROVIDES:append:class-native = " llvm-native" BBCLASSEXTEND = "native nativesdk" -RDEPENDS_lldb += "${PN}-lldb-python" +RDEPENDS:${PN} += "\ + perl-module-digest-md5 \ + perl-module-file-basename \ + perl-module-file-copy \ + perl-module-file-find \ + perl-module-file-path \ + perl-module-findbin \ + perl-module-hash-util \ + perl-module-sys-hostname \ + perl-module-term-ansicolor \ +" + +RDEPENDS:lldb += "${PN}-lldb-python" -FILES_${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" +FILES:${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" -FILES_${PN} += "\ +FILES:${PN} += "\ ${libdir}/BugpointPasses.so \ ${libdir}/LLVMHello.so \ ${libdir}/LLVMgold.so \ @@ -242,61 +282,65 @@ FILES_${PN} += "\ ${libdir}/${BPN} \ ${nonarch_libdir}/${BPN}/*/include/ \ ${datadir}/scan-* \ + ${nonarch_libdir}/libscanbuild \ ${datadir}/opt-viewer/ \ " -FILES_lldb = "\ +FILES:lldb = "\ ${bindir}/lldb \ " -FILES_lldb-server = "\ +FILES:lldb-server = "\ ${bindir}/lldb-server \ " -FILES_liblldb = "\ - ${libdir}/liblldbIntelFeatures.so* \ - ${libdir}/liblldb.so* \ +FILES:liblldb = "\ + ${libdir}/liblldbIntelFeatures.so.* \ + ${libdir}/liblldb.so.* \ " -FILES_${PN}-libllvm =+ "\ +FILES:${PN}-libllvm =+ "\ ${libdir}/libLLVM-${MAJOR_VER}.${MINOR_VER}.so \ ${libdir}/libLLVM-${MAJOR_VER}.so \ ${libdir}/libLLVM-${MAJOR_VER}git.so \ ${libdir}/libLLVM-${MAJOR_VER}.${MINOR_VER}git.so \ " -FILES_libclang = "\ +FILES:libclang = "\ ${libdir}/libclang.so.${MAJOR_VER} \ " -FILES_${PN}-dev += "\ +FILES:${PN}-dev += "\ ${datadir}/llvm/cmake \ ${libdir}/cmake \ + ${nonarch_libdir}/libear \ ${nonarch_libdir}/${BPN}/*.la \ " -FILES_${PN}-staticdev += "${nonarch_libdir}/${BPN}/*.a" +FILES:${PN}-staticdev += "${nonarch_libdir}/${BPN}/*.a" -FILES_${PN}-staticdev_remove = "${libdir}/${BPN}/*.a" -FILES_${PN}-dev_remove = "${libdir}/${BPN}/*.la" -FILES_${PN}_remove = "${libdir}/${BPN}/*" +FILES:${PN}-staticdev:remove = "${libdir}/${BPN}/*.a" +FILES:${PN}-dev:remove = "${libdir}/${BPN}/*.la" +FILES:${PN}:remove = "${libdir}/${BPN}/*" -INSANE_SKIP_${PN} += "already-stripped" -#INSANE_SKIP_${PN}-dev += "dev-elf" -INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" -INSANE_SKIP_liblldb = "dev-so" +INSANE_SKIP:${PN} += "already-stripped" +#INSANE_SKIP:${PN}-dev += "dev-elf" +INSANE_SKIP:${PN}-lldb-python += "dev-so dev-deps" +INSANE_SKIP:liblldb = "dev-so" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. -SSTATE_SCAN_FILES_remove = "*-config" +SSTATE_SCAN_FILES:remove = "*-config" TOOLCHAIN = "clang" -TOOLCHAIN_class-native = "gcc" -TOOLCHAIN_class-nativesdk = "clang" +TOOLCHAIN:class-native = "gcc" +TOOLCHAIN:class-nativesdk = "clang" +COMPILER_RT:class-nativesdk:toolchain-clang:runtime-llvm = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk:toolchain-clang:runtime-llvm = "-stdlib=libstdc++" -SYSROOT_DIRS_append_class-target = " ${nonarch_libdir}" +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" -SYSROOT_PREPROCESS_FUNCS_append_class-target = " clang_sysroot_preprocess" +SYSROOT_PREPROCESS_FUNCS:append:class-target = " clang_sysroot_preprocess" clang_sysroot_preprocess() { install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ diff --git a/recipes-devtools/clang/common-source.inc b/recipes-devtools/clang/common-source.inc index e7fb06fb..cd95453f 100644 --- a/recipes-devtools/clang/common-source.inc +++ b/recipes-devtools/clang/common-source.inc @@ -9,3 +9,9 @@ SRC_URI = "" do_configure[depends] += "llvm-project-source-${PV}:do_patch" do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack" +do_create_spdx[depends] += "llvm-project-source-${PV}:do_patch" + +# spdx shared workdir detection fails as not WORKDIR is altered but S and B +# return always true to fix that +def is_work_shared_spdx(d): + return True diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index ed3c2c05..ad35128e 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -9,42 +9,46 @@ BASEURI ??= "${LLVM_GIT}/llvm-project;protocol=${LLVM_GIT_PROTOCOL};branch=${BRA SRC_URI = "\ ${BASEURI} \ file://llvm-config \ - file://0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \ - file://0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ - file://0003-compiler-rt-support-a-new-embedded-linux-target.patch \ - file://0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ - file://0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ - file://0007-llvm-allow-env-override-of-exe-path.patch \ - file://0008-clang-driver-Check-sysroot-for-ldso-path.patch \ - file://0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ - file://0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch \ - file://0011-clang-Prepend-trailing-to-sysroot.patch \ - file://0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ - file://0013-clang-Define-releative-gcc-installation-dir.patch \ - file://0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch \ - file://0015-clang-scan-view-needs-python-2.x.patch \ - file://0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ - file://0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ - file://0018-Check-for-atomic-double-intrinsics.patch \ - file://0019-clang-Enable-SSP-and-PIE-by-default.patch \ - file://0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ - file://0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ - file://0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ - file://0023-fix-path-to-libffi.patch \ - file://0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ - file://0025-clang-Use-python3-in-python-scripts.patch \ - file://0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ - file://0027-compiler-rt-Include-stddef.h.patch \ - file://0028-llvm-Do-not-use-find_library-for-ncurses.patch \ - file://0029-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ - file://0030-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch \ - file://0031-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ - file://0032-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ - file://0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ - file://0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch \ - file://0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch \ - file://0036-libc-LWG2993-reference_wrapper-T-conversion-from-U.patch \ -" + file://libunwind.pc.in \ + file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ + file://0002-compiler-rt-support-a-new-embedded-linux-target.patch \ + file://0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ + file://0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ + file://0005-llvm-allow-env-override-of-exe-and-libdir-path.patch \ + file://0006-clang-driver-Check-sysroot-for-ldso-path.patch \ + file://0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ + file://0008-clang-Prepend-trailing-to-sysroot.patch \ + file://0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ + file://0010-clang-Define-releative-gcc-installation-dir.patch \ + file://0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ + file://0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0013-Check-for-atomic-double-intrinsics.patch \ + file://0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ + file://0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ + file://0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ + file://0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0018-clang-Use-python3-in-python-scripts.patch \ + file://0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ + file://0020-llvm-Do-not-use-find_library-for-ncurses.patch \ + file://0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ + file://0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ + file://0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ + file://0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ + file://0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ + file://0027-libunwind-Added-unw_backtrace-method.patch \ + file://0028-Do-not-force-thumb-mode-directive.patch \ + file://0029-clang-Do-not-use-install-relative-libc-headers.patch \ + file://0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ + file://0031-Fix-lib-paths-for-OpenEmbedded-Host.patch \ + file://0032-Correct-library-search-path-for-OpenEmbedded-Host.patch \ + file://0033-lldb-Link-with-libatomic-on-x86.patch \ + file://0034-clang-exclude-openembedded-distributions-from-settin.patch \ + file://0035-compiler-rt-Enable-__int128-for-ppc32.patch \ + file://0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch \ + file://0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch \ + file://0038-Add-missing-cstdint.patch \ + " # Fallback to no-PIE if not set GCCPIE ??= "" diff --git a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index aa3a9ac9..bf293646 100644 --- a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -13,18 +13,18 @@ inherit cmake pkgconfig python3native LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" -TUNE_CCARGS_remove = "-no-integrated-as" +TUNE_CCARGS:remove = "-no-integrated-as" -RUNTIME = "llvm" - -DEPENDS += "ninja-native clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" -DEPENDS_append_libc-glibc = " libxcrypt" -DEPENDS_append_class-nativesdk = " clang-native nativesdk-libxcrypt" +DEPENDS += "ninja-native virtual/crypt" +DEPENDS:append:class-native = " clang-native libxcrypt-native" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_ARCH} nativesdk-libxcrypt" PACKAGECONFIG ??= "" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" +PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON,," -HF = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" HF[vardepvalue] = "${HF}" OECMAKE_TARGET_COMPILE = "compiler-rt" @@ -34,8 +34,6 @@ EXTRA_OECMAKE += "-DCOMPILER_RT_STANDALONE_BUILD=OFF \ -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=${HOST_ARCH}${HF}${HOST_VENDOR}-${HOST_OS} \ -DCOMPILER_RT_BUILD_BUILTINS=OFF \ -DSANITIZER_CXX_ABI_LIBNAME=${@bb.utils.contains("RUNTIME", "llvm", "libc++", "libstdc++", d)} \ - -DSANITIZER_USE_STATIC_CXX_ABI=ON \ - -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON \ -DCOMPILER_RT_BUILD_XRAY=ON \ -DCOMPILER_RT_BUILD_SANITIZERS=ON \ -DCOMPILER_RT_BUILD_LIBFUZZER=ON \ @@ -48,36 +46,39 @@ EXTRA_OECMAKE += "-DCOMPILER_RT_STANDALONE_BUILD=OFF \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ " -EXTRA_OECMAKE_append_class-nativesdk = "\ +EXTRA_OECMAKE:append:class-nativesdk = "\ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ " -EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " -EXTRA_OECMAKE_append_powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " +EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " +EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " -do_install_append () { +do_install:append () { if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then mkdir -p ${D}${nonarch_libdir} mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang rmdir --ignore-fail-on-non-empty ${D}${libdir} fi + # Already shipped with compile-rt Orc support + rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.orc-*.a + rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include/orc/ } FILES_SOLIBSDEV = "" -FILES_${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ +FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" -FILES_${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" -FILES_${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ +FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" +FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.asan-preinit*.a \ " -INSANE_SKIP_${PN} = "dev-so libdir" -INSANE_SKIP_${PN}-dbg = "libdir" +INSANE_SKIP:${PN} = "dev-so libdir" +INSANE_SKIP:${PN}-dbg = "libdir" -#PROVIDES_append_class-target = "\ +#PROVIDES:append:class-target = "\ # virtual/${TARGET_PREFIX}compilerlibs \ # libgcc \ # libgcc-initial \ @@ -86,12 +87,18 @@ INSANE_SKIP_${PN}-dbg = "libdir" # " # -RDEPENDS_${PN}-dev += "${PN}-staticdev" +RDEPENDS:${PN}-dev += "${PN}-staticdev" BBCLASSEXTEND = "native nativesdk" -ALLOW_EMPTY_${PN} = "1" -ALLOW_EMPTY_${PN}-dev = "1" +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-dev = "1" + +TOOLCHAIN:forcevariable = "clang" +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" -TOOLCHAIN_forcevariable = "clang" -SYSROOT_DIRS_append_class-target = " ${nonarch_libdir}" +# riscv and x86_64 Sanitizers work on musl too +COMPATIBLE_HOST:libc-musl:x86-64 = "(.*)" +COMPATIBLE_HOST:libc-musl:riscv64 = "(.*)" +COMPATIBLE_HOST:libc-musl:riscv32 = "(.*)" +COMPATIBLE_HOST:libc-musl = "null" diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb index b61ede01..203a8df5 100644 --- a/recipes-devtools/clang/compiler-rt_git.bb +++ b/recipes-devtools/clang/compiler-rt_git.bb @@ -8,58 +8,81 @@ SECTION = "base" require clang.inc require common-source.inc -inherit cmake pkgconfig python3native +inherit cmake cmake-native pkgconfig python3native LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" LIBCPLUSPLUS = "" COMPILER_RT = "" -TUNE_CCARGS_remove = "-no-integrated-as" + +TUNE_CCARGS:remove = "-no-integrated-as" INHIBIT_DEFAULT_DEPS = "1" -DEPENDS += "ninja-native" -DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" -DEPENDS_append_class-nativesdk = " clang-native" -DEPENDS_append_class-native = " clang-native" +DEPENDS += "ninja-native libgcc" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_ARCH} nativesdk-gcc-runtime" +DEPENDS:append:class-native = " clang-native" + +# Trick clang.bbclass into not creating circular dependencies +UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" +COMPILER_RT:class-nativesdk:toolchain-clang:runtime-llvm = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk:toolchain-clang:runtime-llvm = "-stdlib=libstdc++" + +CXXFLAGS += "-stdlib=libstdc++" +LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" +BUILD_CXXFLAGS += "-stdlib=libstdc++" +BUILD_LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" +BUILD_CPPFLAGS:remove = "-stdlib=libc++" +BUILD_LDFLAGS:remove = "-stdlib=libc++ -lc++abi" + +BUILD_CC:toolchain-clang = "${CCACHE}clang" +BUILD_CXX:toolchain-clang = "${CCACHE}clang++" +BUILD_CPP:toolchain-clang = "${CCACHE}clang -E" +BUILD_CCLD:toolchain-clang = "${CCACHE}clang" +BUILD_RANLIB:toolchain-clang = "llvm-ranlib" +BUILD_AR:toolchain-clang = "llvm-ar" +BUILD_NM:toolchain-clang = "llvm-nm" PACKAGECONFIG ??= "" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" +PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" -HF = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" HF[vardepvalue] = "${HF}" OECMAKE_TARGET_COMPILE = "compiler-rt" OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" OECMAKE_SOURCEPATH = "${S}/llvm" EXTRA_OECMAKE += "-DCOMPILER_RT_STANDALONE_BUILD=OFF \ - -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=${HOST_ARCH}${HF}${HOST_VENDOR}-${HOST_OS} \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ + -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HF}${HOST_VENDOR}-${HOST_OS} \ -DCOMPILER_RT_BUILD_XRAY=OFF \ -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ -DCOMPILER_RT_BUILD_MEMPROF=OFF \ -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ - -DCOMPILER_RT_BUILD_PROFILE=ON \ -DLLVM_ENABLE_PROJECTS='compiler-rt' \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ " -EXTRA_OECMAKE_append_class-target = "\ +EXTRA_OECMAKE:append:class-target = "\ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ " -EXTRA_OECMAKE_append_class-nativesdk = "\ +EXTRA_OECMAKE:append:class-nativesdk = "\ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ " -EXTRA_OECMAKE_append_powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " +EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " -do_install_append () { +do_install:append () { if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then mkdir -p ${D}${nonarch_libdir} mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang @@ -68,19 +91,19 @@ do_install_append () { } FILES_SOLIBSDEV = "" -FILES_${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ +FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" -FILES_${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" -FILES_${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ +FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" +FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.asan-preinit*.a \ " -INSANE_SKIP_${PN} = "dev-so libdir" -INSANE_SKIP_${PN}-dbg = "libdir" +INSANE_SKIP:${PN} = "dev-so libdir" +INSANE_SKIP:${PN}-dbg = "libdir" -#PROVIDES_append_class-target = "\ +#PROVIDES:append:class-target = "\ # virtual/${TARGET_PREFIX}compilerlibs \ # libgcc \ # libgcc-initial \ @@ -89,12 +112,12 @@ INSANE_SKIP_${PN}-dbg = "libdir" # " # -RDEPENDS_${PN}-dev += "${PN}-staticdev" +RDEPENDS:${PN}-dev += "${PN}-staticdev" BBCLASSEXTEND = "native nativesdk" -ALLOW_EMPTY_${PN} = "1" -ALLOW_EMPTY_${PN}-dev = "1" +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-dev = "1" -TOOLCHAIN_forcevariable = "clang" -SYSROOT_DIRS_append_class-target = " ${nonarch_libdir}" +TOOLCHAIN:forcevariable = "clang" +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" diff --git a/recipes-devtools/clang/libclc_git.bb b/recipes-devtools/clang/libclc_git.bb index 9525b257..cd7ad498 100644 --- a/recipes-devtools/clang/libclc_git.bb +++ b/recipes-devtools/clang/libclc_git.bb @@ -17,11 +17,16 @@ OECMAKE_SOURCEPATH = "${S}/libclc" EXTRA_OECMAKE += " \ -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ + -DLLVM_CLANG=${STAGING_BINDIR_NATIVE}/clang \ + -DLLVM_AS=${STAGING_BINDIR_NATIVE}/llvm-as \ + -DLLVM_LINK=${STAGING_BINDIR_NATIVE}/llvm-link \ + -DLLVM_OPT=${STAGING_BINDIR_NATIVE}/opt \ + -DLLVM_SPIRV=${STAGING_BINDIR_NATIVE}/llvm-spirv \ -Dclc_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeCLCCompiler.cmake.in \ -Dll_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeLLAsmCompiler.cmake.in \ " -do_configure_prepend () { +do_configure:prepend () { # Write out a qemu wrapper that will be used by cmake # so that it can run target helper binaries through that. qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" @@ -32,6 +37,9 @@ EOF chmod +x ${WORKDIR}/qemuwrapper } -FILES_${PN} += "${datadir}/clc" +FILES:${PN} += "${datadir}/clc" BBCLASSEXTEND = "native nativesdk" + +export YOCTO_ALTERNATE_EXE_PATH +export YOCTO_ALTERNATE_LIBDIR diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 280f8de1..b8df601b 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb @@ -8,22 +8,39 @@ SECTION = "base" require clang.inc require common-source.inc -inherit cmake python3native +inherit cmake cmake-native python3native -PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("RUNTIME", "llvm", "unwind", "", d)}" -PACKAGECONFIG_append_armv5 = " no-atomics" - -PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=ON -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," +PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("RUNTIME", "llvm", "unwind unwind-shared", "", d)}" +PACKAGECONFIG:append:armv5 = " no-atomics" +PACKAGECONFIG:remove:class-native = "compiler-rt" +PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," PACKAGECONFIG[exceptions] = "-DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DDLIBCXX_ENABLE_EXCEPTIONS=ON,-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF -DLIBCXX_ENABLE_EXCEPTIONS=OFF -DCMAKE_REQUIRED_FLAGS='-fno-exceptions'," PACKAGECONFIG[no-atomics] = "-D_LIBCXXABI_HAS_ATOMIC_BUILTINS=OFF -DCMAKE_SHARED_LINKER_FLAGS='-latomic',," -PACKAGECONFIG[compiler-rt] = ",,compiler-rt" +PACKAGECONFIG[compiler-rt] = "-DLIBCXX_USE_COMPILER_RT=ON -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBUNWIND_USE_COMPILER_RT=ON,,compiler-rt" +PACKAGECONFIG[unwind-shared] = "-DLIBUNWIND_ENABLE_SHARED=ON,-DLIBUNWIND_ENABLE_SHARED=OFF,," DEPENDS += "ninja-native" -DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_ARCH} nativesdk-compiler-rt" +DEPENDS:append:class-native = " clang-native" LIBCPLUSPLUS = "" -COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "", d)} ${UNWINDLIB}" -UNWINDLIB ?= "${@bb.utils.contains("RUNTIME", "gnu", "--unwindlib=libgcc", "", d)}" +COMPILER_RT ?= "-rtlib=compiler-rt" + +# Trick clang.bbclass into not creating circular dependencies +UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" +COMPILER_RT:class-nativesdk = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" + +CC:append:toolchain-clang:class-native = " -unwindlib=libgcc -rtlib=libgcc" +CC:append:toolchain-clang:class-nativesdk = " -unwindlib=libgcc -rtlib=libgcc" + +CXXFLAGS += "-stdlib=libstdc++" +LDFLAGS += "-unwindlib=libgcc -stdlib=libstdc++" +BUILD_CXXFLAGS += "-stdlib=libstdc++" +BUILD_LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" +BUILD_CPPFLAGS:remove = "-stdlib=libc++" +BUILD_LDFLAGS:remove = "-stdlib=libc++ -lc++abi" INHIBIT_DEFAULT_DEPS = "1" @@ -32,18 +49,14 @@ LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da39 file://libunwind/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ " -LLVM_LIBDIR_SUFFIX_powerpc64 = "64" - OECMAKE_TARGET_COMPILE = "cxxabi cxx" -OECMAKE_TARGET_INSTALL = "install-cxx install-cxxabi" +OECMAKE_TARGET_INSTALL = "install-cxx install-cxxabi ${@bb.utils.contains("RUNTIME", "llvm", "install-unwind", "", d)}" + OECMAKE_SOURCEPATH = "${S}/llvm" EXTRA_OECMAKE += "\ -DCMAKE_CROSSCOMPILING=ON \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ -DLLVM_ENABLE_RTTI=ON \ - -DLIBUNWIND_ENABLE_SHARED=OFF \ - -DLIBUNWIND_ENABLE_THREADS=OFF \ - -DLIBUNWIND_WEAK_PTHREAD_LIB=ON \ -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON \ -DLIBCXXABI_INCLUDE_TESTS=OFF \ -DLIBCXXABI_ENABLE_SHARED=ON \ @@ -53,28 +66,47 @@ EXTRA_OECMAKE += "\ -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib${LLVM_LIBDIR_SUFFIX} \ -DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi;libunwind' \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ " -EXTRA_OECMAKE_append_class-target = " \ +EXTRA_OECMAKE:append:class-target = " \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${HOST_SYS} \ +" +EXTRA_OECMAKE:append:class-native = " -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF \ " -EXTRA_OECMAKE_append_class-native = " -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF" - -EXTRA_OECMAKE_append_class-nativesdk = " -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF \ +EXTRA_OECMAKE:append:class-nativesdk = " -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${HOST_SYS} \ " -EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " +EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " -CXXFLAGS_append_armv5 = " -mfpu=vfp2" +CXXFLAGS:append:armv5 = " -mfpu=vfp2" -ALLOW_EMPTY_${PN} = "1" +ALLOW_EMPTY:${PN} = "1" -BBCLASSEXTEND = "native nativesdk" -TOOLCHAIN = "clang" +PROVIDES:append:runtime-llvm = " libunwind" +do_install:append() { + if ${@bb.utils.contains("RUNTIME", "llvm", "true", "false", d)} + then + for f in libunwind.h __libunwind_config.h unwind.h unwind_itanium.h unwind_arm_ehabi.h + do + install -Dm 0644 ${S}/libunwind/include/$f ${D}${includedir}/$f + done + install -d ${D}${libdir}/pkgconfig + sed -e 's,@LIBDIR@,${libdir},g;s,@VERSION@,${PV},g' ${S}/../libunwind.pc.in > ${D}${libdir}/pkgconfig/libunwind.pc + fi +} + +PACKAGES:append:runtime-llvm = " libunwind" +FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*" + +BBCLASSEXTEND = "native nativesdk" +TOOLCHAIN:forcevariable = "clang" diff --git a/recipes-devtools/clang/llvm-project-source.inc b/recipes-devtools/clang/llvm-project-source.inc index d7b91e05..6bcb29f1 100644 --- a/recipes-devtools/clang/llvm-project-source.inc +++ b/recipes-devtools/clang/llvm-project-source.inc @@ -8,7 +8,6 @@ RM_WORK_EXCLUDE += "${PN}" inherit nopackages PN = "llvm-project-source-${PV}" - WORKDIR = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}" SSTATE_SWSPEC = "sstate:llvm-project-source::${PV}:${PR}::${SSTATE_VERSION}:" @@ -18,17 +17,29 @@ STAMPCLEAN = "${STAMPS_DIR}/work-shared/llvm-project-source-${PV}-*" INHIBIT_DEFAULT_DEPS = "1" DEPENDS = "" PACKAGES = "" +TARGET_ARCH = "allarch" +TARGET_AS_ARCH = "none" +TARGET_CC_ARCH = "none" +TARGET_LD_ARCH = "none" +TARGET_OS = "linux" +baselib = "lib" +PACKAGE_ARCH = "all" # space separated list of additional distro vendor values we want to support e.g. # "yoe webos" or "-yoe -webos" '-' is optional CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}" - +# Extra OE DISTRO that want to support as build host. space separated list of additional distro. +# ":" separated the ID in "/etc/os-release" and the triple for finding gcc on this OE DISTRO. +# eg: "poky:poky wrlinux:wrs" +CLANG_EXTRA_OE_DISTRO ?= "poky:poky" +# Match with MULTILIB_GLOBAL_VARIANTS +MULTILIB_VARIANTS = "lib32 lib64 libx32" python add_distro_vendor() { import subprocess case = "" triple = "" vendors = d.getVar('CLANG_EXTRA_OE_VENDORS') - multilib_variants = d.getVar('MULTILIB_VARIANTS').split() + multilib_variants = (d.getVar("MULTILIB_VARIANTS") or "").split() vendors_to_add = [] for vendor in vendors.split(): # convert -yoe into yoe @@ -51,6 +62,35 @@ python add_distro_vendor() { subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case)) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + + + case = "" + triple = "" + name = "" + check = "" + oe_names = "" + distros = d.getVar('CLANG_EXTRA_OE_DISTRO') + for distro in distros.split(): + distro_id = distro.split(":")[0].replace('-','_') + distro_triple = distro.split(":")[1] + case += '\\n .Case("' + distro_id + '", Distro::' + distro_id.upper() + ')' + triple += '\\n if (Distro.Is' + distro_id.upper() + '())\\n return "x86_64-' + distro_triple + '-linux",' + name += '\\n '+ distro_id.upper() + ',' + check += '\\nbool Is' + distro_id.upper() + '() const { return DistroVal == ' + distro_id.upper() + '; }' + oe_names += distro_id.upper() + ' ||' + + check += '\\nbool IsOpenEmbedded() const { return DistroVal == ' + oe_names[0:-3] + '; }' + + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_NAME#%s#g' ${S}/clang/include/clang/Driver/Distro.h" % (name)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_CHECK#%s#g' ${S}/clang/include/clang/Driver/Distro.h" % (check)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Linux.cpp" % (triple)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_CASES#%s#g' -i ${S}/clang/lib/Driver/Distro.cpp" % (case)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) } do_patch[postfuncs] += "add_distro_vendor" +do_create_spdx[depends] += "${PN}:do_patch" + diff --git a/recipes-devtools/clang/nativesdk-clang-glue.bb b/recipes-devtools/clang/nativesdk-clang-glue.bb index 169366a7..4e0c6faa 100644 --- a/recipes-devtools/clang/nativesdk-clang-glue.bb +++ b/recipes-devtools/clang/nativesdk-clang-glue.bb @@ -23,11 +23,13 @@ sysroot_stage_all () { sysroot_stage_dir ${D} ${SYSROOT_DESTDIR} } -FILES_${PN} += "${prefix_nativesdk} ${base_libdir_nativesdk}" -FILES_${PN}-dbg = "" +FILES:${PN} += "${prefix_nativesdk} ${base_libdir_nativesdk}" +FILES:${PN}-dbg = "" deltask do_configure deltask do_compile deltask do_patch deltask do_fetch deltask do_unpack +deltask do_create_spdx +deltask do_create_runtime_spdx diff --git a/recipes-devtools/clang/openmp_git.bb b/recipes-devtools/clang/openmp_git.bb index a1fa3b1b..90b839ca 100644 --- a/recipes-devtools/clang/openmp_git.bb +++ b/recipes-devtools/clang/openmp_git.bb @@ -10,31 +10,40 @@ require common-source.inc TOOLCHAIN = "clang" -LIC_FILES_CHKSUM = "file://openmp/LICENSE.txt;md5=d75288d1ce0450b28b8d58a284c09c79" +LIC_FILES_CHKSUM = "file://openmp/LICENSE.TXT;md5=d75288d1ce0450b28b8d58a284c09c79" + +LDFLAGS:append = " -fuse-ld=lld" inherit cmake pkgconfig perlnative -DEPENDS += "elfutils libffi" +DEPENDS += "elfutils libffi clang" -EXTRA_OECMAKE += "-DOPENMP_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')}" +EXTRA_OECMAKE += "-DOPENMP_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ + -DOPENMP_STANDALONE_BUILD=ON \ + -DCLANG_TOOL=${STAGING_BINDIR_NATIVE}/clang \ + -DLINK_TOOL=${STAGING_BINDIR_NATIVE}/llvm-link \ + -DOPT_TOOL=${STAGING_BINDIR_NATIVE}/opt \ + " OECMAKE_SOURCEPATH = "${S}/openmp" PACKAGECONFIG ?= "ompt-tools offloading-plugin" -PACKAGECONFIG_remove_arm = "ompt-tools offloading-plugin" -PACKAGECONFIG_remove_mipsarch = "ompt-tools offloading-plugin" -PACKAGECONFIG_remove_powerpc = "ompt-tools offloading-plugin" +PACKAGECONFIG:remove:arm = "ompt-tools offloading-plugin" +PACKAGECONFIG:remove:mipsarch = "ompt-tools offloading-plugin" +PACKAGECONFIG:remove:powerpc = "ompt-tools offloading-plugin" PACKAGECONFIG[ompt-tools] = "-DOPENMP_ENABLE_OMPT_TOOLS=ON,-DOPENMP_ENABLE_OMPT_TOOLS=OFF," PACKAGECONFIG[aliases] = "-DLIBOMP_INSTALL_ALIASES=ON,-DLIBOMP_INSTALL_ALIASES=OFF," PACKAGECONFIG[offloading-plugin] = ",,elfutils libffi,libelf libffi" +PACKAGES += "${PN}-libomptarget" FILES_SOLIBSDEV = "" -FILES_${PN} += "${libdir}/lib*${SOLIBSDEV}" -INSANE_SKIP_${PN} = "dev-so" +FILES:${PN} += "${libdir}/lib*${SOLIBSDEV}" +FILES:${PN}-libomptarget = "${libdir}/libomptarget-*.bc" +INSANE_SKIP:${PN} = "dev-so" -COMPATIBLE_HOST_mips64 = "null" -COMPATIBLE_HOST_riscv32 = "null" +COMPATIBLE_HOST:mips64 = "null" +COMPATIBLE_HOST:riscv32 = "null" BBCLASSEXTEND = "native nativesdk" diff --git a/recipes-devtools/gdb/gdb_%.bbappend b/recipes-devtools/gdb/gdb_%.bbappend index 63fbf481..ee1991b6 100644 --- a/recipes-devtools/gdb/gdb_%.bbappend +++ b/recipes-devtools/gdb/gdb_%.bbappend @@ -1,3 +1,3 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI_append_toolchain-clang_riscv64 = " file://0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch " +SRC_URI:append:toolchain-clang:riscv64 = " file://0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch " diff --git a/recipes-devtools/rpm/rpm_%.bbappend b/recipes-devtools/rpm/rpm_%.bbappend index 732af3f4..26c9e993 100644 --- a/recipes-devtools/rpm/rpm_%.bbappend +++ b/recipes-devtools/rpm/rpm_%.bbappend @@ -1,9 +1,9 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -DEPENDS_append_toolchain-clang = " openmp" -DEPENDS_remove_toolchain-clang_riscv32 = "openmp" -DEPENDS_remove_toolchain-clang_mipsarch = "openmp" +DEPENDS:append:toolchain-clang = " openmp" +DEPENDS:remove:toolchain-clang:riscv32 = "openmp" +DEPENDS:remove:toolchain-clang:mipsarch = "openmp" # rpm needs OMP -TOOLCHAIN_riscv32 = "gcc" -TOOLCHAIN_mipsarch = "gcc" +TOOLCHAIN:riscv32 = "gcc" +TOOLCHAIN:mipsarch = "gcc" diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch deleted file mode 100644 index b52d97ba..00000000 --- a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 1e38777c321605d13f9ad254880e73459877d7da Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 14 Feb 2021 18:43:21 -0800 -Subject: [PATCH] Use 12.0.0 for base llvm version - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0ddb55ce..a9cd1978 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,6 +1,6 @@ - cmake_minimum_required(VERSION 3.3) - --set (BASE_LLVM_VERSION 13.0.0) -+set (BASE_LLVM_VERSION 12.0.0) - set(LLVM_SPIRV_VERSION ${BASE_LLVM_VERSION}.0) - - option(LLVM_SPIRV_INCLUDE_TESTS --- -2.30.1 - diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-cmake-allow-to-enable-disable-ccache.patch b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-cmake-allow-to-enable-disable-ccache.patch deleted file mode 100644 index 68cdda4f..00000000 --- a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-cmake-allow-to-enable-disable-ccache.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 13b679eb76e6877b40fd41b91e71cb172bcf7b26 Mon Sep 17 00:00:00 2001 -From: Naveen Saini -Date: Thu, 4 Mar 2021 11:23:20 +0800 -Subject: [PATCH] cmake: allow to enable/disable ccache - -By default ccache is enabled. - -Upstream-Status: Submitted [https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/930] - -Signed-off-by: Naveen Saini ---- - CMakeLists.txt | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0ddb55c..c7d0498 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -50,8 +50,9 @@ if(LLVM_SPIRV_BUILD_EXTERNAL) - - message(STATUS "Found LLVM: ${LLVM_VERSION}") - -+ option(CCACHE_ALLOWED "allow use of ccache" TRUE) - find_program(CCACHE_EXE_FOUND ccache) -- if(CCACHE_EXE_FOUND) -+ if(CCACHE_EXE_FOUND AND CCACHE_ALLOWED) - message(STATUS "Found ccache: ${CCACHE_EXE_FOUND}") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) --- -2.17.1 - diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb index 171d54fd..d3d0f6b7 100644 --- a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb @@ -1,14 +1,16 @@ LICENSE = "NCSA" LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" -BRANCH = "llvm_release_120" -SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator/;protocol=https;branch=${BRANCH} \ - file://0001-Use-12.0.0-for-base-llvm-version.patch \ - file://0001-cmake-allow-to-enable-disable-ccache.patch \ +BRANCH = "llvm_release_140" +SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;branch=${BRANCH} \ + git://github.com/KhronosGroup/SPIRV-Headers;protocol=https;destsuffix=git/SPIRV-Headers;name=headers;branch=master \ " -PV = "12.0.0" -SRCREV = "c65388fcd4eac9ce070fc330d5fe263ba2c72d66" +PV = "14.0.0" +SRCREV = "8937ecf4698c9283c92c35b65e5b97e6e0acf869" +SRCREV_headers = "b42ba6d92faf6b4938e6f22ddd186dbdacc98d78" + +SRCREV_FORMAT = "default_headers" S = "${WORKDIR}/git" @@ -29,13 +31,14 @@ EXTRA_OECMAKE = "\ -DLLVM_INCLUDE_TESTS=ON \ -Wno-dev \ -DCCACHE_ALLOWED=FALSE \ + -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${S}/SPIRV-Headers \ " -do_compile_append() { +do_compile:append() { oe_runmake llvm-spirv } -do_install_append() { +do_install:append() { install -Dm755 ${B}/tools/llvm-spirv/llvm-spirv ${D}${bindir}/llvm-spirv } diff --git a/recipes-extended/ghostscript/ghostscript_%.bbappend b/recipes-extended/ghostscript/ghostscript_%.bbappend new file mode 100644 index 00000000..c1496d00 --- /dev/null +++ b/recipes-extended/ghostscript/ghostscript_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +do_configure:prepend:toolchain-clang () { + if ${@bb.utils.contains('RUNTIME', 'llvm', 'true', 'false', d)}; then + sed -i -e "s|-stdlib=libstdc++|-stdlib=libc++|g" ${S}/configure.ac + fi +} diff --git a/recipes-extended/mdadm/mdadm_%.bbappend b/recipes-extended/mdadm/mdadm_%.bbappend index 903836e5..2bdf6ca7 100644 --- a/recipes-extended/mdadm/mdadm_%.bbappend +++ b/recipes-extended/mdadm/mdadm_%.bbappend @@ -3,4 +3,4 @@ # | &dev->size_low, &dev->size_high); # | ^~~~~~~~~~~~~~ -CFLAGS_append_toolchain-clang = " -Wno-error=address-of-packed-member" +CFLAGS:append:toolchain-clang = " -Wno-error=address-of-packed-member" diff --git a/recipes-graphics/harfbuzz/harfbuzz/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch b/recipes-graphics/harfbuzz/harfbuzz/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch new file mode 100644 index 00000000..67455b86 --- /dev/null +++ b/recipes-graphics/harfbuzz/harfbuzz/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch @@ -0,0 +1,50 @@ +Upstream-status: Backport + +Fixes the following build error: + +| ../../harfbuzz-2.6.4/src/hb-subset-cff1.cc:472:33: error: variable 'supp_size' set but not used [-Werror,-Wunused-but-set-variable] +| unsigned int size0, size1, supp_size; +| ^ +| 1 error generated. + +Signed-off-by: Raphael Kubo da Costa +--- +From 243d056ff1c2af583ceb67e5dfbfaac51dc96e63 Mon Sep 17 00:00:00 2001 +From: Andi-Bogdan Postelnicu +Date: Wed, 2 Jun 2021 14:08:11 +0300 +Subject: [PATCH] Removed unused variable `supp_size` from + plan_subset_encoding(...). + +--- + src/hb-subset-cff1.cc | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc +index df322f845..35dae7b1f 100644 +--- a/src/hb-subset-cff1.cc ++++ b/src/hb-subset-cff1.cc +@@ -469,12 +469,11 @@ struct cff_subset_plan { + unsigned int plan_subset_encoding (const OT::cff1::accelerator_subset_t &acc, hb_subset_plan_t *plan) + { + const Encoding *encoding = acc.encoding; +- unsigned int size0, size1, supp_size; ++ unsigned int size0, size1; + hb_codepoint_t code, last_code = CFF_UNDEF_CODE; + hb_vector_t supp_codes; + + subset_enc_code_ranges.resize (0); +- supp_size = 0; + supp_codes.init (); + + subset_enc_num_codes = plan->num_output_glyphs () - 1; +@@ -510,7 +509,6 @@ struct cff_subset_plan { + code_pair_t pair = { supp_codes[i], sid }; + subset_enc_supp_codes.push (pair); + } +- supp_size += SuppEncoding::static_size * supp_codes.length; + } + } + supp_codes.fini (); +-- +2.41.0 + diff --git a/recipes-graphics/harfbuzz/harfbuzz_2.6.4.bbappend b/recipes-graphics/harfbuzz/harfbuzz_2.6.4.bbappend new file mode 100644 index 00000000..9d02c11a --- /dev/null +++ b/recipes-graphics/harfbuzz/harfbuzz_2.6.4.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:toolchain-clang = "\ + file://0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch \ +" diff --git a/recipes-graphics/mesa/mesa/clang13.patch b/recipes-graphics/mesa/mesa/clang13.patch new file mode 100644 index 00000000..8387b344 --- /dev/null +++ b/recipes-graphics/mesa/mesa/clang13.patch @@ -0,0 +1,15 @@ +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -351,8 +351,12 @@ lp_build_create_jit_compiler_for_module( + */ + TargetOptions options; + #if defined(PIPE_ARCH_X86) ++#if LLVM_VERSION_MAJOR >= 13 ++ // do nothing ++#else + options.StackAlignmentOverride = 4; + #endif ++#endif + + builder.setEngineKind(EngineKind::JIT) + .setErrorStr(&Error) diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend index 8af7a0eb..a314e09e 100644 --- a/recipes-graphics/mesa/mesa_%.bbappend +++ b/recipes-graphics/mesa/mesa_%.bbappend @@ -1,12 +1,14 @@ -LDFLAGS_append_toolchain-clang = " -latomic -lm" -DEPENDS_append_toolchain-clang = " libatomic-ops" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -EXTRA_OEMASON_append_toolchain-clang_x86 = " -Dasm=false" -EXTRA_OEMASON_append_toolchain-clang_x86-64 = " -Dasm=false" +SRC_URI:append:toolchain-clang = " file://clang13.patch " -export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" +LDFLAGS:append:toolchain-clang = " -latomic -lm" +DEPENDS:append:toolchain-clang = " libatomic-ops" + +EXTRA_OEMASON:append:toolchain-clang:x86 = " -Dasm=false" +EXTRA_OEMASON:append:toolchain-clang:x86-64 = " -Dasm=false" -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" SRC_URI += "file://0001-gallium-add-missing-header-for-powf.patch \ file://0001-gallivm-fix-build-on-llvm-12-due-to-LLVMAddConstantPropagationPass-removal.patch \ @@ -14,4 +16,4 @@ SRC_URI += "file://0001-gallium-add-missing-header-for-powf.patch \ file://0001-gallium-gallivm-remove-unused-header-include-for-newer-LLVM.patch \ " -PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, clang clang-native elfutils" +PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true -Ddraw-use-llvm=true,-Dllvm=false,clang clang-native elfutils" diff --git a/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend b/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend index 2077fdad..7854eb1c 100644 --- a/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend +++ b/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend @@ -1,3 +1,3 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI_append_toolchain-clang_mips64 = " file://clang_mips64.patch" +SRC_URI:append:toolchain-clang:mips64 = " file://clang_mips64.patch" diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend index dee9619a..c6acc2c4 100644 --- a/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend +++ b/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend @@ -1,4 +1,4 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI_append_toolchain-clang_mips64 = " file://0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch" +SRC_URI:append:toolchain-clang:mips64 = " file://0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch" diff --git a/recipes-multimedia/libvorbis/libvorbis_%.bbappend b/recipes-multimedia/libvorbis/libvorbis_%.bbappend index c6fe98c2..bfc832f4 100644 --- a/recipes-multimedia/libvorbis/libvorbis_%.bbappend +++ b/recipes-multimedia/libvorbis/libvorbis_%.bbappend @@ -1,4 +1,4 @@ # | clang-7: error: unknown argument: '-mfused-madd' -do_configure_prepend_toolchain-clang() { +do_configure:prepend:toolchain-clang() { sed -i -e "s/-mfused-madd//g" ${S}/configure.ac } diff --git a/recipes-support/libunwind/libunwind_%.bbappend b/recipes-support/libunwind/libunwind_%.bbappend new file mode 100644 index 00000000..51c3cee2 --- /dev/null +++ b/recipes-support/libunwind/libunwind_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +COMPATIBLE_HOST:runtime-llvm = "null"