LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
20.51k stars 848 forks source link

Using Clang-18 as recommended by build instructions does not work on Ubuntu 22.04 #508

Open AlekEagle opened 2 months ago

AlekEagle commented 2 months ago

When using clang-18 provided by llvm as recommended by the build instructions, both by following the exact instructions provided, as well as installing the rest of the clang family (clang-18 clang-tools-18 clang-18-doc libclang-common-18-dev libclang-18-dev libclang1-18 clang-format-18 python3-clang-18 clangd-18 clang-tidy-18) continuously failed with vcpkg failing to compile a demo program using -lstdc++.

Switching to the ppa that provides gcc-13 and g++-13 (ppa:ubuntu-toolchain-r/test) and installing both resolved the issue and I am now currently building ladybird to run.

ADKaster commented 2 months ago

If it's unable to find libstdc++, that probably means you were missing libstdc++-dev as a package. What distro are you on that that package is not included in build-essential ?

AlekEagle commented 2 months ago

I am using KDE neon 6.0, and libstdc++-dev is a virtual package that is provided by version specific libstdc++-X-dev packages. Specific output of sudo apt install libstdc++-dev is below:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libstdc++-dev is a virtual package provided by:
  libstdc++-13-dev 13.1.0-8ubuntu1~22.04
  libstdc++-9-dev 9.5.0-1ubuntu1~22.04
  libstdc++-12-dev 12.3.0-1ubuntu1~22.04
  libstdc++-10-dev 10.5.0-1ubuntu1~22.04
  libstdc++-11-dev 11.4.0-1ubuntu1~22.04
You should explicitly select one to install.

E: Package 'libstdc++-dev' has no installation candidate
ADKaster commented 2 months ago

Sure, but build-essential should install the default g++ package, which will be a virtual package pointing to some version of g++, which will depend on that version of libstdc++-xx-dev. Which should(?) install an appropriate libstdc++.so.6 shared lib in the usual distro places.

So I guess I'm mostly confused why this didn't happen and you had to install g++ manually :shrug:

AlekEagle commented 2 months ago

I had libstdc++-11-dev installed already, and it works as expected when using g++ to build other projects. The issue specifically rose with the building of Ladybird.

artenax commented 2 months ago

I have the same problem. I installed clang18 from the ppa in Ubuntu 22.04. Also, the program complains about an old cmake. And I highly doubt it will be satisfied with the old Qt 6.2.4. I tried in Mageia Cauldron (testing, like rolling) and the program complained about the old ICU. I understand that the latest libraries are required (not every rolling will fit), then what kind of support for Ubuntu 20.04 and 22.04 can we talk about? Maybe specify the minimum requirements of all dependent libraries, or at least what exactly works.

Most likely the old system libstdc++ is used. Using a new third-party clang18 does not always mean that a new libstdc++ will be used. It's clang18 with old libs.