Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LoongArch builds for latest developments #680

Merged

Conversation

nathanchance
Copy link
Member

CONFIG_RELOCATABLE has been fixed since 6.7 with two changes (the first one fixes the build and the second one fixes boot):

aa0cbc1b506b ("LoongArch: Record pc instead of offset in la_abs relocation")
eea673e9d5ea ("LoongArch: Apply dynamic relocations for LLD")

Re-enable CONFIG_RELOCATABLE (removing CONFIG_CRASH_DUMP=n as well, as it was only disabled to allow CONFIG_RELOCATABLE to be disabled) for all trees. eea673e9d5ea has been flagged by AUTOSEL for 6.6 but it has not been added to the tree yet, so just apply it locally for the time being.

The minimum supported version of clang for LoongArch has been updated to 18.0.0 in -next with commit 4d35d6e56447 ("scripts/min-tool-version.sh: Raise minimum clang version to 18.0.0 for loongarch") because it is the first version that supports __attribute__((model("extreme"))), which allows us to build with CONFIG_MODULES.

In order to support CONFIG_MODULES unconditionally (i.e., not disable it at all), we must drop support for clang-17 everywhere. We already have to do it for -next (and eventually mainline) due to the aforementioned commit. Do so, which helps drastically simplify the matrix.

Because CONFIG_MODULES does not need to be disabled anymore, we can build allmodconfig instead of allyesconfig, which also allows us to stop disabling CONFIG_KCOV because the image size is much smaller.

I am testing this locally with scripts/build-local.py, I plan to merge it once this pull is approved and those tests pass.

@nathanchance
Copy link
Member Author

nathanchance commented Jan 11, 2024

loongarch.yml
jobs:
- name: loongarch
  builds:
  - target_arch: loongarch
    toolchain: clang-nightly
    kconfig: defconfig
    targets:
    - kernel
    make_variables:
      LLVM: 1
      LLVM_IAS: 1
  - target_arch: loongarch
    toolchain: clang-nightly
    kconfig:
    - defconfig
    - CONFIG_LTO_CLANG_THIN=y
    targets:
    - kernel
    make_variables:
      LLVM: 1
      LLVM_IAS: 1
  - target_arch: loongarch
    toolchain: clang-nightly
    kconfig:
    - allmodconfig
    - CONFIG_WERROR=n
    targets:
    - default
    make_variables:
      LLVM: 1
      LLVM_IAS: 1
  - target_arch: loongarch
    toolchain: clang-nightly
    kconfig:
    - allmodconfig
    - CONFIG_FTRACE=n
    - CONFIG_GCOV_KERNEL=n
    - CONFIG_LTO_CLANG_THIN=y
    - CONFIG_WERROR=n
    targets:
    - default
    make_variables:
      LLVM: 1
      LLVM_IAS: 1

passes -next, mainline, linux-6.7.y, and linux-6.6.y for me locally. I had to add CONFIG_WERROR=n to workaround ClangBuiltLinux/linux#1966 (which is not a LoongArch specific problem anyways). If that is not dealt with relatively quickly, we can apply Kees's suggested workaround to get things back to green relatively quickly.

@nathanchance
Copy link
Member Author

The patch I am adding in this pull request is out for review: https://lore.kernel.org/all/20240118104323.024232838@linuxfoundation.org/

I will rebase and merge this once that patch is in a released version, so that we do not have to worry about the patch failing to apply.

@nathanchance nathanchance linked an issue Jan 18, 2024 that may be closed by this pull request
CONFIG_RELOCATABLE has been fixed since 6.7 with two changes (the first
one fixes the build and the second one fixes boot):

  aa0cbc1b506b ("LoongArch: Record pc instead of offset in la_abs relocation")
  eea673e9d5ea ("LoongArch: Apply dynamic relocations for LLD")

Re-enable CONFIG_RELOCATABLE (removing CONFIG_CRASH_DUMP=n as well, as
it was only disabled to allow CONFIG_RELOCATABLE to be disabled) for all
trees, as those changes have also been backported to linux-6.6.y.

The minimum supported version of clang for LoongArch has been updated to
18.0.0 in -next with commit 4d35d6e56447 ("scripts/min-tool-version.sh:
Raise minimum clang version to 18.0.0 for loongarch") because it is the
first version that supports __attribute__((model("extreme"))), which
allows us to build with CONFIG_MODULES.

In order to support CONFIG_MODULES unconditionally (i.e., not disable it
at all), we must drop support for clang-17 everywhere. We already have
to do it for -next and mainline due to the aforementioned commit. Do so,
which helps drastically simplify the matrix.

Because CONFIG_MODULES does not need to be disabled anymore, we can
build allmodconfig instead of allyesconfig, which also allows us to
stop disabling CONFIG_KCOV because the image size is much smaller.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nathanchance
Copy link
Member Author

Alright, this should be ready to go.

@nathanchance nathanchance merged commit 65a0692 into ClangBuiltLinux:main Jan 24, 2024
7 checks passed
@nathanchance nathanchance deleted the update-loongarch-builds branch January 24, 2024 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

re-enable RELOCATABLE for loongarch
2 participants