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

[ci] Change llvm-12 to llvm-17 #81

Merged
merged 4 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build instructions in our README could be updated as well.

Please also check the recent changes in the upstream buildroot (I created this repo 3 years ago) to see if the build can be further optimized (or more restrictions applied) for clang-17. Here are the examples.

if (clang_version >= 11) {
cflags += [ "-Wno-psabi" ]
}
if (clang_version >= 14) {
cflags += [
"-Wno-unused-but-set-parameter",
"-Wno-unused-but-set-variable",
"-Wno-non-c-typedef-for-linkage",
]
}
if (clang_version >= 15) {
cflags += [ "-Wno-unqualified-std-cast-call" ]
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated PR by referencing the commit history here.
https://github.com/flutter/buildroot/blob/master/build/config/compiler/BUILD.gn
If there's anything else I should check, please let me know.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-12 rpm2cpio cpio binutils-${{ matrix.triple }}
sudo apt-get install -y clang-17 rpm2cpio cpio binutils-${{ matrix.triple }}

- name: Install depot_tools
run: |
Expand All @@ -56,7 +56,7 @@ jobs:
run: |
src/tools/gn \
--target-cpu ${{ matrix.arch }} \
--target-toolchain /usr/lib/llvm-12 \
--target-toolchain /usr/lib/llvm-17 \
--target-sysroot src/sysroot-6.0/${{ matrix.arch }} \
--target-dir build
ninja -C src/out/build
Expand All @@ -66,7 +66,7 @@ jobs:
run: |
src/tools/gn \
--target-cpu ${{ matrix.arch }} \
--target-toolchain /usr/lib/llvm-12 \
--target-toolchain /usr/lib/llvm-17 \
--target-sysroot src/sysroot-6.5/${{ matrix.arch }} \
--api-version 6.5 \
--target-dir build
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The Flutter embedder for Tizen.

- Linux (x64)
- [depot_tools](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up)
- [LLVM](https://apt.llvm.org) (10 or later)
- `sudo apt install clang-12`
- [LLVM](https://apt.llvm.org) (17 or later)
- `sudo apt install clang-17`
- Additional dependencies
- `sudo apt install git python3 rpm2cpio cpio`
- `sudo apt install binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu binutils-i686-linux-gnu`
Expand All @@ -37,21 +37,21 @@ The Flutter embedder for Tizen.
- **For arm**

```sh
tools/gn --target-cpu arm --target-toolchain /usr/lib/llvm-12
tools/gn --target-cpu arm --target-toolchain /usr/lib/llvm-17
ninja -C out/tizen_arm
```

- **For arm64**

```sh
tools/gn --target-cpu arm64 --target-toolchain /usr/lib/llvm-12
tools/gn --target-cpu arm64 --target-toolchain /usr/lib/llvm-17
ninja -C out/tizen_arm64
```

- **For x86**

```sh
tools/gn --target-cpu x86 --target-toolchain /usr/lib/llvm-12
tools/gn --target-cpu x86 --target-toolchain /usr/lib/llvm-17
ninja -C out/tizen_x86
```

Expand Down
33 changes: 10 additions & 23 deletions build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ config("compiler") {
# Stack protection.
cflags += [
"-fstack-protector",
"--param=ssp-buffer-size=4",

# 8 is the default, but make this explicit here so that we don't have to
# go hunting for the flag name if we ever want a value that is
# different from the default.
"--param=ssp-buffer-size=8",
]

# Cross compilation.
Expand Down Expand Up @@ -75,24 +79,15 @@ config("compiler") {
"-Werror",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-Wno-unused-but-set-parameter",
"-Wno-unused-but-set-variable",
"-Wno-implicit-int-float-conversion",
"-Wno-c99-designator",
"-Wno-deprecated-copy",
"-Wno-psabi",
"-Wno-unqualified-std-cast-call",
"-Wno-non-c-typedef-for-linkage",
"-Wno-range-loop-construct",
]
if (clang_version >= 11) {
cflags += [ "-Wno-psabi" ]
}
if (clang_version >= 14) {
cflags += [
"-Wno-unused-but-set-parameter",
"-Wno-unused-but-set-variable",
"-Wno-non-c-typedef-for-linkage",
]
}
if (clang_version >= 15) {
cflags += [ "-Wno-unqualified-std-cast-call" ]
}

# Extra warnings.
cflags += [
Expand All @@ -108,14 +103,6 @@ config("cxx_version_default") {
cflags_cc = [ "-std=c++17" ]
}

config("cxx_version_11") {
cflags_cc = [ "-std=c++11" ]
}

config("cxx_version_20") {
cflags_cc = [ "-std=c++20" ]
}

config("no_system_cxx") {
cflags_cc = [ "-nostdinc++" ]
ldflags = [ "-nostdlib++" ]
Expand Down
2 changes: 1 addition & 1 deletion build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare_args() {
target_triple = ""

# The compiler version.
clang_version = 10
clang_version = 17

# The target API version.
api_version = ""
Expand Down
Loading