New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 697485 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 686980
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

ThinLTO can't find symbols while linking swiftshader/libEGL.so

Project Member Reported by krasin@chromium.org, Mar 1 2017

Issue description

Chrome Version: tip
OS: Linux x86-64

What steps will reproduce the problem?
(1) Configure the build with Clang ToT:

gn gen out/thin-lto-tot '--args=is_chrome_branded=false is_official_build=false is_clang=true is_component_build=false is_debug=false allow_posix_link_time_opt=true is_cfi=false use_thin_lto=true symbol_level=2 clang_use_chrome_plugins=false use_lld=true clang_base_path="/usr/local/google/home/krasin/src/llvm.org/release-build"' --check

(modulo the path to the Clang toolchain)

(2) Try to build swiftshader/libEGL.so:

ninja -C out/thin-lto-tot/ swiftshader/libEGL.so

(3) Observe the link error:

[1/1] SOLINK swiftshader/libEGL.so
FAILED: swiftshader/libEGL.so swiftshader/libEGL.so.TOC 
python "/usr/local/google/home/krasin/chr33/src/build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm"  --sofile="swiftshader/libEGL.so" --tocfile="swiftshader/libEGL.so.TOC" --output="swiftshader/libEGL.so"  -- ../../../../src/llvm.org/release-build/bin/clang++ -shared -Wl,--version-script=../../third_party/swiftshader/src/OpenGL/libEGL/exports.map -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all -flto=thin -Wl,--thinlto-jobs=8 -Wl,-plugin-opt,-function-sections -m64 -pthread -Wl,-O1 -Wl,--gc-sections --sysroot=../../build/linux/debian_wheezy_amd64-sysroot -L/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/lib/x86_64-linux-gnu -Wl,-rpath-link=/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/lib/x86_64-linux-gnu -L/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib/x86_64-linux-gnu -Wl,-rpath-link=/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib/x86_64-linux-gnu -L/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6 -Wl,-rpath-link=/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib -Wl,-rpath-link=/usr/local/google/home/krasin/chr33/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib -Werror -Wl,--hash-style=both -Wl,--gc-sections -o "swiftshader/libEGL.so" -Wl,-soname="libEGL.so" @"swiftshader/libEGL.so.rsp"
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x338): undefined symbol 'egl::Image::~Image()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x340): undefined symbol 'egl::Image::~Image()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x348): undefined symbol 'sw::Surface::lockInternal(int, int, int, sw::Lock, sw::Accessor)'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x350): undefined symbol 'sw::Surface::unlockInternal()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x368): undefined symbol 'egl::Image::release()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x390): undefined symbol 'non-virtual thunk to egl::Image::release()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x398): undefined symbol 'non-virtual thunk to egl::Image::~Image()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x3A0): undefined symbol 'non-virtual thunk to egl::Image::~Image()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x3C0): undefined symbol 'sw::FrameBuffer::~FrameBuffer()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x3C8): undefined symbol 'sw::FrameBuffer::~FrameBuffer()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x408): undefined symbol 'sw::Surface::~Surface()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x410): undefined symbol 'sw::Surface::~Surface()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x418): undefined symbol 'sw::Surface::lockInternal(int, int, int, sw::Lock, sw::Accessor)'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ld-temp.o:(.data.rel.ro+0x420): undefined symbol 'sw::Surface::unlockInternal()'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ../../third_party/swiftshader/src/OpenGL/common/Image.hpp:140: undefined symbol 'sw::Surface::lockExternal(int, int, int, sw::Lock, sw::Accessor)'
/usr/local/google/home/krasin/chr33/src/out/thin-lto-tot/../../../../src/llvm.org/release-build/bin/ld.lld: error: ../../third_party/swiftshader/src/OpenGL/common/Image.hpp:150: undefined symbol 'sw::Surface::unlockExternal()'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Most likely, it's an LLVM-related issue, not Chrome. I will try to bisect.

For the record, the revision I tried is r296618.
 
Status: Started (was: Untriaged)
Mergedinto: 686980
Status: Duplicate (was: Started)
Actually, I have hit an issue we know about. My memory is unreliable as usual.

Sign in to add a comment