Bug#928693: clang-7: Using --coverage causes "/usr/bin/ld: …: hidden symbol `llvm_gcda_end_file'" error

James McCoy jamessan at debian.org
Thu May 9 03:19:50 BST 2019


Package: clang-7
Version: 1:7.0.1-8
Severity: normal

This is easily demonstrated with the libvterm package.

$ debcheckout libvterm
…
$ cd libvterm
$ env CC=clang-7 CFLAGS=--coverage make VERBOSE=1
TBL src/encoding/DECdrawing.tbl
TBL src/encoding/uk.tbl
CC src/encoding.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/encoding.c  -fPIC -DPIC -o src/.libs/encoding.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/encoding.c -o src/encoding.o >/dev/null 2>&1
CC src/keyboard.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/keyboard.c  -fPIC -DPIC -o src/.libs/keyboard.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/keyboard.c -o src/keyboard.o >/dev/null 2>&1
CC src/mouse.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/mouse.c  -fPIC -DPIC -o src/.libs/mouse.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/mouse.c -o src/mouse.o >/dev/null 2>&1
CC src/parser.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/parser.c  -fPIC -DPIC -o src/.libs/parser.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/parser.c -o src/parser.o >/dev/null 2>&1
CC src/pen.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/pen.c  -fPIC -DPIC -o src/.libs/pen.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/pen.c -o src/pen.o >/dev/null 2>&1
CC src/screen.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/screen.c  -fPIC -DPIC -o src/.libs/screen.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/screen.c -o src/screen.o >/dev/null 2>&1
CC src/state.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/state.c  -fPIC -DPIC -o src/.libs/state.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/state.c -o src/state.o >/dev/null 2>&1
CC src/unicode.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/unicode.c  -fPIC -DPIC -o src/.libs/unicode.o
src/unicode.c:215:12: warning: unused function 'mk_wcswidth' [-Wunused-function]
static int mk_wcswidth(const uint32_t *pwcs, size_t n)
           ^
src/unicode.c:306:12: warning: unused function 'mk_wcswidth_cjk' [-Wunused-function]
static int mk_wcswidth_cjk(const uint32_t *pwcs, size_t n)
           ^
2 warnings generated.
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/unicode.c -o src/unicode.o >/dev/null 2>&1
CC src/vterm.c
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/vterm.c  -fPIC -DPIC -o src/.libs/vterm.o
libtool: compile:  clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -c src/vterm.c -o src/vterm.o >/dev/null 2>&1
LINK libvterm.la
libtool: link: gcc -shared  -fPIC -DPIC  src/.libs/encoding.o src/.libs/keyboard.o src/.libs/mouse.o src/.libs/parser.o src/.libs/pen.o src/.libs/screen.o src/.libs/state.o src/.libs/unicode.o src/.libs/vterm.o      -Wl,-soname -Wl,libvterm.so.0 -o .libs/libvterm.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libvterm.so.0" && ln -s "libvterm.so.0.0.0" "libvterm.so.0")
libtool: link: (cd ".libs" && rm -f "libvterm.so" && ln -s "libvterm.so.0.0.0" "libvterm.so")
libtool: link: ar cru .libs/libvterm.a  src/encoding.o src/keyboard.o src/mouse.o src/parser.o src/pen.o src/screen.o src/state.o src/unicode.o src/vterm.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libvterm.a
libtool: link: ( cd ".libs" && rm -f "libvterm.la" && ln -s "../libvterm.la" "libvterm.la" )
CC bin/unterm.c
libtool: link: clang-7 --coverage -Wall -Iinclude -std=c99 -Wpedantic -o bin/.libs/unterm bin/unterm.c  /home/jamessan/src/debian.org/libvterm/.libs/libvterm.so
bin/unterm.c:157:32: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  VTermScreenCell prevcell = { 0 };
                               ^
                               {}
bin/unterm.c:175:32: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  VTermScreenCell prevcell = { 0 };
                               ^
                               {}
2 warnings generated.
/usr/bin/ld: bin/.libs/unterm: hidden symbol `llvm_gcda_end_file' in /usr/lib/llvm-7/lib/clang/7.0.1/lib/linux/libclang_rt.profile-x86_64.a(GCDAProfiling.c.o) is referenced by DSO
/usr/bin/ld: final link failed: bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:76: bin/unterm] Error 1

-- System Information:
Debian Release: 10.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled


More information about the Pkg-llvm-team mailing list