Received: by 10.192.165.148 with SMTP id m20csp3456977imm; Mon, 23 Apr 2018 06:58:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CTj0IzmbiZf58+iA0B9LBti1/GdWQHDSKn/WfBb46QWU3Tx/2aVFBVzfHzF+IKHNgcEM0 X-Received: by 10.99.126.78 with SMTP id o14mr7799861pgn.18.1524491893681; Mon, 23 Apr 2018 06:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524491893; cv=none; d=google.com; s=arc-20160816; b=dvpY8W6cPHOKjrM1JanUiU0pbUj5fYZY7c0TKQM0jlFHq9M/kkQnYCBffuQKrIeprd j2HdVvARh7bYZI7T3sFOBzgfTrLc6YLoHo3zcWWR3+LK2wglq5Zm4F6Os500yf1S7D6z hB431/tFIiqudJj52l/TQpq8oalqaAnlHxOHQW/863hHhHpWlfNtx/FuqcB088MY9Ts1 xLwnw65/J800Wbb0XHWsW3Ie5B9hLtQLiEKQ2Rm+87vYH0MtxypEcEFhsUc3K1vO3/wS RXSdRlk4RIOhjboepmlt6Pu3x9XaA0pD4m45IDpVjQmklcjoVg1Ds91T6gwU4cS7PVyp 1Tqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:mime-version:dkim-signature:arc-authentication-results; bh=++WJZmqLfo7KJ+1K5tx/wRBtzJj/ZCFQfwOIIDSu1pA=; b=eL+ETBZRHX5IhwfBmwN2+V6byClqNRbxggevPHdGeP7Nub4j12heDHl8qGdXBT7rHZ PXE8/zlmxQaZQXFvoFvctDtDkkR7yFpqqPlevIMPt9n0fFAdAUTOOUexzRqfRWutQe6n 4G3GBkl8CTfvdranPRF9eDrdcOaLAARJrUTsq94j51mrAdEFlDM+XDtIvmbtSF727H76 Ci147+gSjiiVdl/aq7PqG8d3vlupuyMW9nhLEz6e59vgqhxKo5tsEGS40BtuvTX9MDnr sPcazTmgy53TCBp7i6V6auMJXhYn0ygyk+InUChnVjPDKEc2QsEW414zsdA7JhUNfEPa l+LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bQWJ7AhR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e19si10810070pff.275.2018.04.23.06.57.58; Mon, 23 Apr 2018 06:58:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bQWJ7AhR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755398AbeDWN4u (ORCPT + 99 others); Mon, 23 Apr 2018 09:56:50 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:46612 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755264AbeDWN4o (ORCPT ); Mon, 23 Apr 2018 09:56:44 -0400 Received: by mail-lf0-f44.google.com with SMTP id j68-v6so15069802lfg.13 for ; Mon, 23 Apr 2018 06:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to:cc; bh=++WJZmqLfo7KJ+1K5tx/wRBtzJj/ZCFQfwOIIDSu1pA=; b=bQWJ7AhR+AP3BapVehm6Dl0bD3vbBJ75Yg7AD9ivMOP0b3pgVbMenQ8m9P5AOO8qSF BqcurW7mZssoWu7WczIASSZiCwna9k8rcvVvrChZuJ88/sW28Z/Qy9lNdLUqO3wiaGWp rxmegHNA2qhs05Ee3ttYgCpBaSetjjiJtK8/IXffnyb3HEvBGTIFfJpE3l3EXLNDR2Vl zoiBHv7uJB7w75KXT4fEsSgWpc+J8rSpUYtIQXyokagou0PjzT9X8aoD2/pHvEedeJvo C58Xo8nDyPD2QzhrV1/l07vi2zJhpgwYDD6ouqvByaeQ/+OMGEBVf1T4xJvUkU+tYYq9 SuuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to:cc; bh=++WJZmqLfo7KJ+1K5tx/wRBtzJj/ZCFQfwOIIDSu1pA=; b=F/Ne/ea31b3lJX8PK09lpH9sZSuSlPmiqJW7oOnrRD7vAiWT5LvyFsPWHc9CwQKKIG d+ZXTyCpwqa0KXyVTx8Bk/QQK9BsRHCjf4WzikYqGv/xm6MwNL45XyNjNYWYGIBAHFUk 3U4atccU+71b2Hi6644DXcdF+lN37r381iiY6p0/hYUXu2SYF9OnUO8nLZQQRNPHKnbH nvViixNI/cCsdAGONdDHZlqKY+vnmPeIv0XmZ3fJ9Pb/ItYhOMkmhIewmRTGolFhex3L dv5/HDR6Bhf+pQKyXuJJV2AXiKRCaKvDqlHf7sISupptDcecX3Nz/P6WkVGoH75c9SfY ufXw== X-Gm-Message-State: ALQs6tAskUwvT36igE5S1XOJFBPM+/8uQdm2ke4OBOATUSeyKt+Rxoyf 5mGV3GQ/wF5lYiSjiGlNCEuxCa0pbTnOYLgoN30H4Q== X-Received: by 10.46.64.77 with SMTP id n74mr14326126lja.6.1524491802240; Mon, 23 Apr 2018 06:56:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:d58e:0:0:0:0:0 with HTTP; Mon, 23 Apr 2018 06:56:41 -0700 (PDT) Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Mon, 23 Apr 2018 15:56:41 +0200 Message-ID: Subject: Clang patch stacks for LTS kernels (v4.4 and v4.9) and status update To: Matthias Kaehlcke Cc: lkml , Arnd Bergmann , JF Bastien , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ CC Nick ] [ CC Arnd ] [ CC JF ] Hi Matthias, I was following [1] a bit and fell over your original posting in [2]. I wrote some early documentation (wiki) and tested/booted a clang-compiled kernel on x86-64 bare metal. The project was called "lll-project" these days. The followup - LLVMlinux project - seems to be somehow dead? After reading your posting, I got really excited and had a quick look over the Linux v4.9.y-LTS patch-stack with additional stuff: $ git fetch https://chromium.googlesource.com/chromiumos/third_party/kernel refs/sandbox/mka/llvm/v4.9_ext $ git checkout -b llvm_v4.9_ext FETCH_HEAD I like your commit subjects and messages. Before starting to compile I have some questions, I hope you can answer them. [ CLANG-VERSION ] Here on Debian/testing (will get Version 10 with codename "buster") AMD64 I have the choice of installing CLANG v4.0.1, v5.0.1 and v6.0.0. As you point out LLVM/CLANG v5.0 or higher are a good and faster choice than v4.0. Using CLANG >= 5.0 makes the *CLANG* patch-series obsolete? [ REFRESH PATCH-STACK ] What about the *FROMGIT* and *CUSTOM* patch-series? Are they in upstream in the meantime? If yes, will you refresh this v4.9.y-LTS patch-stack? [ ASM-GOTO ] Foremore, I have seen you have a "refs/sandbox/mka/llvm/v4.14" Git branch. Linux v4.14 is also an LTS release. After Linux v4.9 "asm-goto" support was added which is GCC specific. Is there a workaround to compile Linux-kernel with any CLANG version? You happen to know the status in LLVM upstream? [ X86-EFLAGS/IF ] AFAICS, I remember an EFLAGS/IF problem on X86 and interrupt handling. You happen to know if this is fixed in LLVM upstream? Some LLVM developers were interested in fixing this. Can you comment on this, JF (we had some email conversation in private in 2016)? I am looking forward to hearing from you. Best regards, - Sedat - References: [1] https://marc.info/?l=linux-kernel&m=152425978517449&w=2 [2] https://marc.info/?l=linux-kernel&m=150344365613264&w=2 [3] https://bugs.llvm.org/show_bug.cgi?id=9295 References from JF: [0] Hans' fix: http://reviews.llvm.org/D15240 [1] my original pushf/popf disable: http://reviews.llvm.org/D6629 [2] More effort, such as: http://reviews.llvm.org/D15157 P.S.: Your Linux v4.9.y-LTS patch-stack [ UPSTREAM ] 0001-UPSTREAM-kbuild-Add-better-clang-cross-build-support.patch 0002-UPSTREAM-kbuild-clang-add-no-integrated-as-to-KBUILD.patch 0003-UPSTREAM-kbuild-Consolidate-header-generation-from-A.patch 0004-UPSTREAM-kbuild-consolidate-redundant-sed-script-ASM.patch 0005-UPSTREAM-kbuild-fix-asm-offset-generation-to-work-wi.patch 0006-UPSTREAM-kbuild-drop-Wno-unknown-warning-option-from.patch 0007-UPSTREAM-kbuild-LLVMLinux-Add-Werror-to-cc-option-to.patch 0008-UPSTREAM-kbuild-use-Oz-instead-of-Os-when-using-clan.patch 0009-UPSTREAM-kbuild-Add-support-to-generate-LLVM-assembl.patch 0010-UPSTREAM-modules-mark-__inittest-__exittest-as-__may.patch 0011-UPSTREAM-compiler-clang-suppress-warning-for-unused-.patch 0012-UPSTREAM-compiler-clang-properly-override-inline-for.patch 0013-UPSTREAM-x86-kbuild-Use-cc-option-to-enable-falign-j.patch 0014-UPSTREAM-crypto-x86-aesni-fix-token-pasting-for-clan.patch 0015-UPSTREAM-x86-mm-kaslr-Use-the-_ASM_MUL-macro-for-mul.patch 0016-UPSTREAM-kbuild-Add-__cc-option-macro.patch 0017-UPSTREAM-x86-build-Use-__cc-option-for-boot-code-com.patch 0018-UPSTREAM-x86-build-Specify-stack-alignment-for-clang.patch 0019-UPSTREAM-kbuild-clang-Disable-address-of-packed-memb.patch 0020-UPSTREAM-crypto-arm64-sha-avoid-non-standard-inline-.patch 0021-UPSTREAM-llist-clang-introduce-member_address_is_non.patch 0022-UPSTREAM-x86-boot-undef-memcpy-et-al-in-string.c.patch 0023-UPSTREAM-compiler-clang-always-inline-when-CONFIG_OP.patch 0024-UPSTREAM-efi-libstub-arm64-Use-hidden-attribute-for-.patch 0025-UPSTREAM-efi-libstub-arm64-Force-hidden-visibility-f.patch 0026-UPSTREAM-efi-libstub-arm64-Set-fpie-when-building-th.patch 0027-UPSTREAM-x86-build-Fix-stack-alignment-for-CLang.patch 0028-UPSTREAM-x86-build-Use-cc-option-to-validate-stack-a.patch 0029-UPSTREAM-x86-asm-Fix-inline-asm-call-constraints-for.patch 0030-UPSTREAM-x86-asm-Fix-inline-asm-call-constraints-for.patch 0031-UPSTREAM-Kbuild-use-fshort-wchar-globally.patch 0043-UPSTREAM-arm64-ensure-extension-of-smp_store_release.patch 0044-UPSTREAM-arm64-xchg-hazard-against-entire-exchange-v.patch 0045-UPSTREAM-arm64-uaccess-ensure-extension-of-access_ok.patch 0046-UPSTREAM-arm64-armv8_deprecated-ensure-extension-of-.patch 0047-UPSTREAM-arm64-atomic_lse-match-asm-register-sizes.patch 0048-UPSTREAM-arm64-uaccess-suppress-spurious-clang-warni.patch 0049-UPSTREAM-drm-i915-Remove-unused-BSM_MASK-causing-war.patch 0050-UPSTREAM-audit-add-tty-field-to-LOGIN-event.patch 0051-UPSTREAM-audit-move-audit_get_tty-to-reduce-scope-an.patch 0052-UPSTREAM-media-uvcvideo-Fix-a-wrong-macro.patch 0053-UPSTREAM-dmaengine-Fix-array-index-out-of-bounds-war.patch 0054-UPSTREAM-hpet-Make-cmd-parameter-of-hpet_ioctl_commo.patch 0055-UPSTREAM-ALSA-hda-ca0132-Remove-double-parentheses.patch 0056-UPSTREAM-selinux-Remove-unnecessary-check-of-array-b.patch 0057-UPSTREAM-mac80211-Fix-clang-warning-about-constant-o.patch 0058-UPSTREAM-cpumask-Add-helper-cpumask_available.patch 0059-UPSTREAM-genirq-Use-cpumask_available-for-check-of-c.patch 0060-UPSTREAM-cfg80211-Fix-array-bounds-warning-in-fragme.patch 0061-UPSTREAM-mac80211-ibss-Fix-channel-type-enum-in-ieee.patch 0062-UPSTREAM-nl80211-Fix-enum-type-of-variable-in-nl8021.patch 0063-UPSTREAM-ALSA-hda-ca0132-Limit-values-for-chip-addre.patch 0064-UPSTREAM-media-vcodec-mediatek-Remove-double-parenth.patch 0065-UPSTREAM-misc-lkdtm-Add-volatile-to-intentional-NULL.patch 0066-UPSTREAM-jiffies.h-declare-jiffies-and-jiffies_64-wi.patch 0067-UPSTREAM-fs-compat-Remove-warning-from-COMPATIBLE_IO.patch 0068-UPSTREAM-dm-ioctl-remove-double-parentheses.patch 0069-UPSTREAM-ath9k-Add-cast-to-u8-to-FREQ2FBIN-macro.patch 0070-UPSTREAM-tracing-Use-cpumask_available-to-check-if-c.patch 0071-UPSTREAM-netfilter-ctnetlink-Make-some-parameters-in.patch 0072-UPSTREAM-selinux-Remove-redundant-check-for-unknown-.patch 0076-UPSTREAM-x86-boot-Disable-the-address-of-packed-memb.patch 0077-UPSTREAM-zram-rework-copy-of-compressor-name-in-comp.patch 0078-UPSTREAM-arm64-avoid-overflow-in-VA_START-and-PAGE_O.patch 0079-UPSTREAM-bitops-avoid-integer-overflow-in-GENMASK-_U.patch 0080-UPSTREAM-btrfs-Remove-extra-parentheses-from-conditi.patch 0081-UPSTREAM-netpoll-Fix-device-name-check-in-netpoll_se.patch [ BACKPORT ] 0032-BACKPORT-kbuild-fix-linker-feature-test-macros-when-.patch 0033-BACKPORT-kbuild-Set-KBUILD_CFLAGS-before-incl.-arch-.patch 0034-BACKPORT-crypto-arm64-aes-ce-cipher-move-assembler-c.patch 0073-BACKPORT-clocksource-Use-GENMASK_ULL-in-definition-o.patch 0074-BACKPORT-PCI-Make-PCI_ROM_ADDRESS_MASK-a-32-bit-cons.patch 0075-BACKPORT-iio-light-isl29018-Only-declare-ACPI-table-.patch 0082-BACKPORT-drm-i915-Consistently-use-enum-pipe-for-PCH.patch 0083-BACKPORT-drm-i915-Pass-enum-pipe-to-intel_set_pch_fi.patch [ FROMGIT ] 0084-FROMGIT-x86-boot-Disable-Clang-warnings-about-GNU-ex.patch 0085-FROMGIT-sched-sysctl-Fix-attributes-of-some-extern-d.patch [ CUSTOM ] 0035-CUSTOM-kbuild-clang-Disable-the-duplicate-decl-speci.patch 0036-CUSTOM-arm64-Disable-asm-operand-width-warning-for-c.patch [ CLANG ] 0037-CLANG4-crypto-arm64-crc32-explictly-pass-mcpu-option.patch 0038-CLANG4-kbuild-Add-meabi-gnu-to-the-clang-parameters.patch 0039-CLANG4-arm64-prefetch-Use-__builtin_arm_prefetch-for.patch 0040-CLANG4-Disable-lkdtm-when-ftrace-is-enabled.patch 0041-CLANG4-futex-don-t-optimize-futex_detect_cmpxchg-on-.patch 0042-CLANG3-core-clang-work-around-x86-regparm-intrinsics.patch 0086-CLANG4-x86-mce-Disable-gcc-compat-warning-for-mce.c-.patch 0087-CLANG4-task_work-Disable-gcc-compat-warning-locally.patch