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

lld version 8 is installed but the build tools seems to have it hardcoded in the default which is version 6 - no variable to export in build.sh #21

Closed
Mikotochan opened this issue Sep 30, 2019 · 8 comments
Labels
bug Something isn't working

Comments

@Mikotochan
Copy link

Posting this for a friend, I am quoting them verbatim

  • ./tools/gn/bootstrap/bootstrap.py -o out/Default/gn --skip-generate-buildfiles
    ninja: Entering directory /home/elr/ungoogled-chromium-portablelinux/build/src/out/Release/gn_build' [184/184] LINK gn + ./out/Default/gn gen out/Default --fail-on-unused-args Done. Made 11238 targets from 1801 files in 10782ms + ninja -C out/Default chrome chrome_sandbox chromedriver ninja: Entering directory out/Default'
    [3525/21619] LINK ./chrome_sandbox
    FAILED: chrome_sandbox
    clang++-8 -pie -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--no-as-needed -fuse-ld=lld -Wl,--icf=all -Wl,--color-diagnostics -flto=thin -Wl,--thinlto-jobs=8 -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy,cache_size=10%:cache_size_bytes=10g:cache_size_files=100000 -Wl,--lto-O0 -fwhole-program-vtables -m64 -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ -fsanitize=cfi-vcall -fsanitize=cfi-icall -pie -Wl,--disable-new-dtags -o "./chrome_sandbox" -Wl,--start-group @"./chrome_sandbox.rsp" -Wl,--end-group -ldl -lpthread -lrt
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected
    /usr/bin/ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    [3530/21619] CXX obj/sandbox/linux/seccomp_bpf/codegen.o
    ninja: build stopped: subcommand failed.
@Eloston
Copy link
Member

Eloston commented Oct 6, 2019

I've never seen this error before, and Portable Linux seems to be compiling fine from what I've seen. What is your LLVM setup and how did you install it?

@Mikotochan
Copy link
Author

He says:

The llvm tools are installed using repo referenced in the readme and they dont create any symbolic link by default. In the distro I used the original default package for lld just create a symbolic link to the lld-6, the default in repos. Ofc this should be thought and a "llvm-xx" like path should be added to set up the lld version to use 8 and not the default symbolic link hardcoded by now to this old one.

In addition, this is a default installation with Ubuntu 18.04

I had to replace default symbolic link into the system to point to lld-8.

@Eloston
Copy link
Member

Eloston commented Oct 14, 2019

So if I'm understanding this correctly, you're trying to use LLVM's build of LLVM with Ubuntu's build of LLVM (specifically, Ubuntu's LLD with LLVM's Clang)?

@Eloston
Copy link
Member

Eloston commented Oct 14, 2019

Ideally they shouldn't conflict, but we don't really have control over that. Chromium uses the CXX command for linking: https://chromium.googlesource.com/chromium/src/build/+/master/toolchain/linux/unbundle/BUILD.gn

@EchedelleLR
Copy link
Contributor

EchedelleLR commented Oct 18, 2019

Hi, sorry for the delay in answer. I was who send the report to @Mikotochan.

I think you got confused with my monolithic explanation.

Clarification:

  • I have a default Ubuntu 18.04 installation.
  • Ubuntu default LLVM version --> 6
  • LLVM version which I want to use (as explained in this repo) --> 8
  • Which of them creates symbolic links for every tool by default? --> Ubuntu default LLVM
  • How I can use LLVM tools in the version I want? --> export blablabla as said in documentation in this repository
  • What is the main issue? --> LLD (one of the LLVM tools) is hardcoded to use the symbolic link. (no variable to export)
  • What was my solution? --> Make a symbolic link to LLD v8 replacing the default one

@EchedelleLR
Copy link
Contributor

EchedelleLR commented Oct 18, 2019

Ideally they shouldn't conflict, but we don't really have control over that. Chromium uses the CXX command for linking: https://chromium.googlesource.com/chromium/src/build/+/master/toolchain/linux/unbundle/BUILD.gn

This may be wrong in some way, following official steps you can see my log in a post before. it points by default to /usr/bin/ld.lld which is the symbolic link to the lld in the default llvm version.

I got full compilation just replacing the symbolic link, so, for me, that configuration is not working in the way that should be.

@Eloston
Copy link
Member

Eloston commented Oct 20, 2019

This may be wrong in some way, following official steps you can see my log in a post before. it points by default to /usr/bin/ld.lld which is the symbolic link to the lld in the default llvm version.

Sure, but see the messages above and below it:

Before (this invokes the linker):

clang++-8 -pie -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--no-as-needed -fuse-ld=lld -Wl,--icf=all -Wl,--color-diagnostics -flto=thin -Wl,--thinlto-jobs=8 -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy,cache_size=10%:cache_size_bytes=10g:cache_size_files=100000 -Wl,--lto-O0 -fwhole-program-vtables -m64 -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ -fsanitize=cfi-vcall -fsanitize=cfi-icall -pie -Wl,--disable-new-dtags -o "./chrome_sandbox" -Wl,--start-group @"./chrome_sandbox.rsp" -Wl,--end-group -ldl -lpthread -lrt

You can tell this is a linker command because of -o "./chrome_sandbox"

Also, this is further confirmation after the error messages:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

So clang invoked the linker, which makes sense if the above command invoked the linker.

So clang++-8 is from LLVM's LLVM build, which tries to use the symbolic link setup from Ubuntu's LLVM build. This should not happen, but I don't really see what option we have here other than remove either Ubuntu's build or LLVM's build.

@EchedelleLR
Copy link
Contributor

EchedelleLR commented Oct 22, 2019

I think it could be added to the README. Not install LLVM default version from Ubuntu 18.04 repositories (or earlier) and create a symbolic link to /usr/bin/ld.lld without replace that created by the default version. Or just replace it temporarily.

@Eloston Eloston added the bug Something isn't working label Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants