• Kirill Smelkov's avatar
    *: Fix build with recent gcc/binutils · b97c7f08
    Kirill Smelkov authored
    With current Debian testing I get:
    
    	tools/ccanlint/ccanlint -s --deps-fail-ignore   ccan/compiler/ && touch ccan/compiler/.ok
    	compiler: Module tests compile (tests_compile): FAIL
    	/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/ccan/compiler/test/run-is_compile_constant.c:Compile failed:
    	/usr/bin/ld: /tmp/ccanlint-129350.1804289383/tap.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/ccan/tap/tap.h:249: multiple definition of `tap_fail_callback'; /tmp/ccrAwqbl.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/ccan/tap/tap.h:249: first defined here
    	collect2: error: ld returned 1 exit status
    	...
    
    	cc -g3 -ggdb -Wall -Wstrict-prototypes -Wold-style-definition -Wundef -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -DCCAN_STR_DEBUG=1 -I.  -MMD -MP -MFtools/ccanlint/ccanlint.d -MTtools/ccanlint/ccanlint tools/ccanlint/ccanlint.c tools/ccanlint/async.o tools/ccanlint/file_analysis.o tools/ccanlint/licenses.o tools/ccanlint/tests/avoids_cpp_reserved.o tools/ccanlint/tests/depends_accurate.o tools/ccanlint/tests/depends_build.o tools/ccanlint/tests/depends_build_without_features.o tools/ccanlint/tests/depends_exist.o tools/ccanlint/tests/examples_compile.o tools/ccanlint/tests/examples_exist.o tools/ccanlint/tests/examples_relevant.o tools/ccanlint/tests/examples_run.o tools/ccanlint/tests/hash_if.o tools/ccanlint/tests/headers_idempotent.o tools/ccanlint/tests/info_compiles.o tools/ccanlint/tests/info_documentation_exists.o tools/ccanlint/tests/info_exists.o tools/ccanlint/tests/info_ported.o tools/ccanlint/tests/info_summary_single_line.o tools/ccanlin
     t/tests/license_comment.o tools/ccanlint/tests/license_depends_compat.o tools/ccanlint/tests/license_exists.o tools/ccanlint/tests/license_file_compat.o tools/ccanlint/tests/main_header_compiles.o tools/ccanlint/tests/main_header_exists.o tools/ccanlint/tests/module_builds.o tools/ccanlint/tests/module_links.o tools/ccanlint/tests/no_trailing_whitespace.o tools/ccanlint/tests/objects_build.o tools/ccanlint/tests/objects_build_with_stringchecks.o tools/ccanlint/tests/objects_build_without_features.o tools/ccanlint/tests/reduce_features.o tools/ccanlint/tests/tests_compile.o tools/ccanlint/tests/tests_compile_coverage.o tools/ccanlint/tests/tests_coverage.o tools/ccanlint/tests/tests_exist.o tools/ccanlint/tests/tests_helpers_compile.o tools/ccanlint/tests/tests_pass.o tools/ccanlint/tests/tests_pass_valgrind.o tools/ccanlint/tests/tests_pass_without_features.o ccan/autodata/autodata.o ccan/dgraph/dgraph.o ccan/ilog/ilog.o ccan/lbalance/lbalance.o ccan/ptr_valid/ptr_valid.o ccan/strma
     p/strmap.o tools/ccan_dir.o tools/compi
    	le.o tools/depends.o tools/doc_extract-core.o tools/gcov.o tools/manifest.o tools/read_config_header.o tools/tools.o ccan/asort/asort.o ccan/err/err.o ccan/foreach/foreach.o ccan/hash/hash.o ccan/htable/htable.o ccan/list/list.o ccan/membuf/membuf.o ccan/noerr/noerr.o ccan/opt/helpers.o ccan/opt/opt.o ccan/opt/parse.o ccan/opt/usage.o ccan/rbuf/rbuf.o ccan/read_write_all/read_write_all.o ccan/str/debug.o ccan/str/str.o ccan/take/take.o ccan/tal/tal.o ccan/tal/grab_file/grab_file.o ccan/tal/link/link.o ccan/tal/path/path.o ccan/tal/str/str.o ccan/time/time.o -lm -o tools/ccanlint/ccanlint
    	/usr/bin/ld: tools/ccanlint/async.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: multiple definition of `license_compatible'; /tmp/cc72h7qq.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: first defined here
    	/usr/bin/ld: tools/ccanlint/file_analysis.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: multiple definition of `license_compatible'; /tmp/cc72h7qq.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: first defined here
    	/usr/bin/ld: tools/ccanlint/licenses.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/licenses.h:33: multiple definition of `license_compatible'; /tmp/cc72h7qq.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: first defined here
    	/usr/bin/ld: tools/ccanlint/tests/avoids_cpp_reserved.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/./tools/ccanlint/../ccanlint/licenses.h:33: multiple definition of `license_compatible'; /tmp/cc72h7qq.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: first defined
    	here
    	/usr/bin/ld: tools/ccanlint/tests/depends_accurate.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/./tools/ccanlint/../ccanlint/licenses.h:33: multiple definition of `license_compatible'; /tmp/cc72h7qq.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: first defined here
    	/usr/bin/ld: tools/ccanlint/tests/depends_build.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/./tools/ccanlint/../ccanlint/licenses.h:33: multiple definition of `license_compatible'; /tmp/cc72h7qq.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: first defined here
    	/usr/bin/ld: tools/ccanlint/tests/depends_build_without_features.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/./tools/ccanlint/../ccanlint/licenses.h:33: multiple definition of `license_compatible'; /tmp/cc72h7qq.o:/home/kirr/src/wendelin/wendelin.core/3rdparty/ccan/tools/ccanlint/../ccanlint/licenses.h:33: first defined here
    	...
    
    The errors are valid becuase symbols are declared without extern in .h
    files and those .h files are included from multiple translation units.
    
    -> Fix it. I'm not sure why it used to compile ok before.
    Signed-off-by: Kirill Smelkov's avatarKirill Smelkov <kirr@nexedi.com>
    Message-Id: <20200910191610.131510-1-kirr@nexedi.com>
    Signed-off-by: 's avatarDavid Gibson <david@gibson.dropbear.id.au>
    b97c7f08
Name
Last commit
Last update
..
a_star Loading commit data...
aga Loading commit data...
agar Loading commit data...
alignof Loading commit data...
altstack Loading commit data...
antithread Loading commit data...
argcheck Loading commit data...
array_size Loading commit data...
asearch Loading commit data...
asort Loading commit data...
asprintf Loading commit data...
autodata Loading commit data...
avl Loading commit data...
base64 Loading commit data...
bdelta Loading commit data...
bitmap Loading commit data...
bitops Loading commit data...
block_pool Loading commit data...
breakpoint Loading commit data...
btree Loading commit data...
build_assert Loading commit data...
bytestring Loading commit data...
cast Loading commit data...
ccan_tokenizer Loading commit data...
cdump Loading commit data...
charset Loading commit data...
check_type Loading commit data...
ciniparser Loading commit data...
compiler Loading commit data...
container_of Loading commit data...
coroutine Loading commit data...
cppmagic Loading commit data...
cpuid Loading commit data...
crc Loading commit data...
crc32c Loading commit data...
crcsync Loading commit data...
crypto Loading commit data...
daemon_with_notify Loading commit data...
daemonize Loading commit data...
darray Loading commit data...
deque Loading commit data...
dgraph Loading commit data...
edit_distance Loading commit data...
endian Loading commit data...
eratosthenes Loading commit data...
err Loading commit data...
failtest Loading commit data...
fdpass Loading commit data...
foreach Loading commit data...
generator Loading commit data...
grab_file Loading commit data...
hash Loading commit data...
heap Loading commit data...
htable Loading commit data...
idtree Loading commit data...
ilog Loading commit data...
intmap Loading commit data...
invbloom Loading commit data...
io Loading commit data...
isaac Loading commit data...
iscsi Loading commit data...
jacobson_karels Loading commit data...
jmap Loading commit data...
jset Loading commit data...
json Loading commit data...
json_escape Loading commit data...
json_out Loading commit data...
lbalance Loading commit data...
likely Loading commit data...
list Loading commit data...
lpq Loading commit data...
lqueue Loading commit data...
lstack Loading commit data...
md4 Loading commit data...
mem Loading commit data...
membuf Loading commit data...
minmax Loading commit data...
net Loading commit data...
nfs Loading commit data...
noerr Loading commit data...
objset Loading commit data...
ogg_to_pcm Loading commit data...
opt Loading commit data...
order Loading commit data...
permutation Loading commit data...
pipecmd Loading commit data...
pr_log Loading commit data...
ptr_valid Loading commit data...
ptrint Loading commit data...
pushpull Loading commit data...
rbtree Loading commit data...
rbuf Loading commit data...
read_write_all Loading commit data...
rfc822 Loading commit data...
rszshm Loading commit data...
short_types Loading commit data...
siphash Loading commit data...
sparse_bsearch Loading commit data...
str Loading commit data...
strgrp Loading commit data...
stringbuilder Loading commit data...
stringmap Loading commit data...
strmap Loading commit data...
strset Loading commit data...
structeq Loading commit data...
take Loading commit data...
tal Loading commit data...
talloc Loading commit data...
tally Loading commit data...
tap Loading commit data...
tcon Loading commit data...
time Loading commit data...
timer Loading commit data...
tlist Loading commit data...
tlist2 Loading commit data...
ttxml Loading commit data...
typesafe_cb Loading commit data...
utf8 Loading commit data...
version Loading commit data...
wwviaudio Loading commit data...
xstring Loading commit data...
.gitignore Loading commit data...