Skip to content

[build-script] Add buildbot_linux,lld preset #77635

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
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

etcwilde
Copy link
Contributor

This patch adds a preset that defaults the toolchain to use lld instead of gold on Linux.

Added presets are

  • buildbot_linux,lld
  • buildbot_linux,lld,no_assertions
  • buildbot_linux,lld,no_test
  • buildbot_linux,lld,no_assertions,no_test

@etcwilde etcwilde requested a review from shahmishal November 15, 2024 00:41
@etcwilde
Copy link
Contributor Author

@swift-ci please smoke test

@etcwilde
Copy link
Contributor Author

preset=buildbot_linux,lld
@swift-ci please test with preset Linux Platform

etcwilde and others added 2 commits March 19, 2025 08:31
This patch adds a preset that defaults the toolchain to use lld instead
of gold on Linux.

Added presets are
  - `buildbot_linux,lld`
  - `buildbot_linux,lld,no_assertions`
  - `buildbot_linux,lld,no_test`
  - `buildbot_linux,lld,no_assertions,no_test`
Switching presets to use the `use-linker` flag consistently instead of
setting the CMake variables directly.
@etcwilde etcwilde force-pushed the ewilde/linux-lld-preset branch from fdcd4a9 to db6d408 Compare March 19, 2025 15:32
@etcwilde
Copy link
Contributor Author

@swift-ci please test

@etcwilde
Copy link
Contributor Author

preset=buildbot_linux,lld
@swift-ci please test with preset Linux Platform

@xavgru12
Copy link

Why is the preset called build bot? Can this preset be used for local builds as well?

@etcwilde
Copy link
Contributor Author

Why is the preset called build bot? Can this preset be used for local builds as well?

Staying consistent with what was there and to indicate that it's for the CI buildbots. Yes, you can use it for local builds if you want to replicate the configuration that CI is using to produce toolchains, though it might take longer than needed for normal development since it builds the entire toolchain instead of just pieces of it. I usually use a more stripped down build-script --release --skip-test-cmark --skip-build-benchmarks for building just the compiler, for instance.

@xavgru12
Copy link

Talking about more stripped down builds. What if I just want to build in debug mode: lib/sema (which is part of swift host tools afaik)? I thought —debug-swift would do it but it regresses. Can I build in debug single libraries like lib/sema without having to fiddle in CMakeLists.txt?

@etcwilde
Copy link
Contributor Author

etcwilde commented Mar 20, 2025

Linux Preset Testing Failure:

******************** TEST 'Swift(linux-x86_64) :: Backtracing/ElfReader.swift' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: rm -rf "/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp" && mkdir -p "/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp"
+ rm -rf /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp
+ mkdir -p /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp
RUN: at line 2: clang++ -target x86_64-unknown-linux-gnu -fmodules-cache-path='/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -fPIE -fobjc-runtime=ios-5.0 -x c -Wno-unused-command-line-argument -Wl,--build-id -g /home/build-user/swift/test/Backtracing/Inputs/fib.c -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp/fib
+ clang++ -target x86_64-unknown-linux-gnu -fmodules-cache-path=/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache -fPIE -fobjc-runtime=ios-5.0 -x c -Wno-unused-command-line-argument -Wl,--build-id -g /home/build-user/swift/test/Backtracing/Inputs/fib.c -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp/fib
RUN: at line 3: clang++ -target x86_64-unknown-linux-gnu -fmodules-cache-path='/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -fPIE -fobjc-runtime=ios-5.0 -x c -Wno-unused-command-line-argument -g /home/build-user/swift/test/Backtracing/Inputs/fib.c -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp/fib-no-uuid
+ clang++ -target x86_64-unknown-linux-gnu -fmodules-cache-path=/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache -fPIE -fobjc-runtime=ios-5.0 -x c -Wno-unused-command-line-argument -g /home/build-user/swift/test/Backtracing/Inputs/fib.c -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp/fib-no-uuid
RUN: at line 4: clang++ -target x86_64-unknown-linux-gnu -fmodules-cache-path='/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -fPIE -fobjc-runtime=ios-5.0 -x c -Wno-unused-command-line-argument -Wl,--build-id -Wl,--compress-debug-sections=zlib-gnu -g /home/build-user/swift/test/Backtracing/Inputs/fib.c -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp/fib-compress-gnu
+ clang++ -target x86_64-unknown-linux-gnu -fmodules-cache-path=/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache -fPIE -fobjc-runtime=ios-5.0 -x c -Wno-unused-command-line-argument -Wl,--build-id -Wl,--compress-debug-sections=zlib-gnu -g /home/build-user/swift/test/Backtracing/Inputs/fib.c -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Backtracing/Output/ElfReader.swift.tmp/fib-compress-gnu
ld.lld: error: unknown --compress-debug-sections value: zlib-gnu
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

--

@etcwilde
Copy link
Contributor Author

@swift-ci please test

lld doesn't support zlib-gnu debug info compression. Gate that part of
the test on the ability to compile with that compression format.
@etcwilde etcwilde force-pushed the ewilde/linux-lld-preset branch from 300cdf6 to 1557fdf Compare March 20, 2025 19:14
@etcwilde
Copy link
Contributor Author

@swift-ci please test

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.

3 participants