# Trouble building lib/liblldb.so.17.0.0 on 6.0.1 using manually built 5.10.1

**URL:** <https://forums.swift.org/t/trouble-building-lib-liblldb-so-17-0-0-on-6-0-1-using-manually-built-5-10-1/75610>\
**Category:** LLDB\
**Created:** [October 25, 2024, 7:32am UTC](https://forums.swift.org/t/trouble-building-lib-liblldb-so-17-0-0-on-6-0-1-using-manually-built-5-10-1/75610 "2024-10-25T07:32:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![itaiferber](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/itaiferber/32/33840_2.png) [@itaiferber](https://forums.swift.org/u/itaiferber)\
**Post date:** [October 25, 2024, 11:45am UTC](https://forums.swift.org/t/trouble-building-lib-liblldb-so-17-0-0-on-6-0-1-using-manually-built-5-10-1/75610/2 "2024-10-25T11:45:48Z")

</div>

Just to verify: are you trying to build specifically with `lld` as your linker, or is your `/usr/bin/ld` an alias for `gold`?

If your `/usr/bin/ld` is `lld`, you need to set the `LLVM_USE_LINKER=lld` CMake variable in the build script to have LLVM, lldb, and the rest of the components know they're building with `lld` (which alters some of the linking behavior).

> [@vaikas](#):
>
> I'm using the utils/build-script like so (leaving out the install location for clarity):
> 
> `swift/utils/build-script --preset=buildbot_linux,no_test`

Is this your full build invocation (minus the install location), or are there any additional flags?

If you want to use the preset approach, you can add the CMake flag by editing `swift/utils/build-presets.ini` to add another preset at the bottom like so:

```swift
[preset: buildbot_linux,no_test,lld]
mixin-preset=buildbot_linux,no_test
extra-cmake-options=-DLLVM_USE_LINKER=lld

```

The name of the preset you create doesn't matter, just that you use it when building.

For reference, this is the preset I put together for [building Swift 6.0.1 on Gentoo](https://forums.swift.org/t/swift-6-0-1-for-gentoo-on-guru/75334):

> [@Swift 6.0.1 for Gentoo on GURU](https://forums.swift.org/t/swift-6-0-1-for-gentoo-on-guru/75334/5):
>
> ```swift
> [preset: gentoo]
> mixin-preset=buildbot_linux,no_assertions,no_test
> build-ninja=0
> extra-cmake-options=
> -DLLVM_USE_LINKER=lld
> -DBUILD_TESTING:BOOL=NO
> -DSWIFT_INCLUDE_TESTS:BOOL=NO
> -DSWIFT_INCLUDE_TEST_BINARIES:BOOL=NO
> -DCOMPILER_RT_BUILD_ORC:BOOL=NO
> -DPython3_FIND_UNVERSIONED_NAMES=FIRST
> libicu=0
> llvm-targets-to-build=host
> skip-build-curl
> skip-build-zlib
> 
> ```

(Here you can see I'm passing multiple additional CMake options to the script; most of the other flags are likely irrelevant to your situation, though I would consider basing your build off the `buildbot_linux,no_assertions,no_test` preset to also disable assertions.)

Happy to try to help get you set up with a build!

---

_[View the full topic](https://forums.swift.org/t/trouble-building-lib-liblldb-so-17-0-0-on-6-0-1-using-manually-built-5-10-1/75610)._
