Skip to content

LLVM 20 transition #3594

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

Open
12 of 14 tasks
ziyao233 opened this issue Apr 2, 2025 · 4 comments
Open
12 of 14 tasks

LLVM 20 transition #3594

ziyao233 opened this issue Apr 2, 2025 · 4 comments

Comments

@ziyao233
Copy link
Member

ziyao233 commented Apr 2, 2025

TODO

2025.05.11: The transition has been completed!

Workarounds/Bugs to recheck after upgrading

@ziyao233
Copy link
Member Author

ziyao233 commented Apr 3, 2025

Noted some warnings when building 20.1.2,

CMake Warning at CMakeLists.txt:161 (message):                                                                                                                 
  Using LLVM_ENABLE_PROJECTS=compiler-rt is deprecated now, and will become a                                                                                  
  fatal error in the LLVM 21 release.  Please use                                                                                                              
  -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at                                                                                                
  https://compiler-rt.llvm.org/ for building the runtimes.    

we'd better to fix it in #3600 as well.

@ziyao233
Copy link
Member Author

ziyao233 commented May 8, 2025

Noted some warnings when building 20.1.2,

CMake Warning at CMakeLists.txt:161 (message):                                                                                                                 
  Using LLVM_ENABLE_PROJECTS=compiler-rt is deprecated now, and will become a                                                                                  
  fatal error in the LLVM 21 release.  Please use                                                                                                              
  -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at                                                                                                
  https://compiler-rt.llvm.org/ for building the runtimes.    

we'd better to fix it in #3600 as well.

Building compiler-rt as a project instead of runtime seems to mess the buildsystem up, leading to visibility of symbols in compiler-rt are incorrectly set to default. This is the root cause #3839.

The change is temporarily reverted1. We should finish the transition first.

@ziyao233
Copy link
Member Author

ziyao233 commented May 8, 2025

    * [ ]  Rework pacman.conf and remove `-fno-plt` on riscv64 and loongarch64, where LLVM doesn't support the option and [emits a warning starting from LLVM 20](https://github.com/llvm/llvm-project/pull/124081)* [ ]  Rust compatibility

Our builders have upgraded to LLVM 20, so we must workaround this when reworking pacman.conf or meson may misdetect the environment,

Running compile:
Working directory:  /root/packages/src/pacman-v7.0.0/build/meson-private/tmprojqrsat
Code:
#include <sys/types.h>
        void bar(void) {
            (void) sizeof(uid_t);
        }
-----------
Command line: `cc /root/packages/src/pacman-v7.0.0/build/meson-private/tmprojqrsat/testfile.c -o /root/packages/src/pacman-v7.0.0/build/meson-private/tmprojqrs
at/output.obj -c -Os -pipe -fno-plt -march=la464 -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused
-command-line-argument -Werror=ignored-optimization-argument -std=gnu99` -> 1
stderr:
cc: error: argument unused during compilation: '-fno-plt' [-Werror,-Wunused-command-line-argument]
-----------
Checking for type "uid_t" : NO 

ziyao233 added a commit to ziyao233/eweos-packages that referenced this issue May 8, 2025
LLVM doesn't support -fno-plt on RISC-V and LoongArch and starts
emitting a warning if it's supplied on unsupported targets since LLVM
20, causing various errors when configuring packages. Let's remove the
flag on riscv64 and loongarch64.

As we have started moving to LLVM 20, the problem must be mitigated by
stripping -fno-plt away from CFLAGS/LDFLAGS on riscv64 and loongarch64.

Link: llvm/llvm-project#124081
Reference: eweOS#3594 (comment)
ziyao233 added a commit that referenced this issue May 8, 2025
LLVM doesn't support -fno-plt on RISC-V and LoongArch and starts
emitting a warning if it's supplied on unsupported targets since LLVM
20, causing various errors when configuring packages. Let's remove the
flag on riscv64 and loongarch64.

As we have started moving to LLVM 20, the problem must be mitigated by
stripping -fno-plt away from CFLAGS/LDFLAGS on riscv64 and loongarch64.

Link: llvm/llvm-project#124081
Reference: #3594 (comment)
ziyao233 added a commit to ziyao233/eweos-packages that referenced this issue May 10, 2025
ziyao233 added a commit that referenced this issue May 10, 2025
@ziyao233
Copy link
Member Author

ziyao233 commented May 12, 2025

Clang 20 starts to error on void functions whose parameters are applied with [[lifetimebound]] modifier.

This affects libtg_owt: issue desktop-app/tg_owt#150, workaround PR #3991

Reference: llvm/llvm-project#113460
Reference: https://github.com/llvm/llvm-project/blob/d102e90de5d1fd0ea1e0395d64d4be7af88669c7/clang/include/clang/Basic/AttrDocs.td#L4225-L4286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant