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

build: link error building on Fedora 32 #3597

Closed
fanquake opened this issue Mar 19, 2020 · 1 comment · Fixed by #3631
Closed

build: link error building on Fedora 32 #3597

fanquake opened this issue Mar 19, 2020 · 1 comment · Fixed by #3631
Assignees
Labels
Milestone

Comments

@fanquake
Copy link
Contributor

fanquake commented Mar 19, 2020

Issue and Steps to Reproduce

Setup following the Fedora build instructions.

docker run -it --rm fedora:32

# cat /etc/fedora-release 
Fedora release 32 (Thirty Two)

# uname -a
Linux e849d0005e50 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

dnf update -y
dnf groupinstall -y 'C Development Tools and Libraries' 'Development Tools'
dnf install -y \
                clang \
                gettext \
                git \
                gmp-devel \
                libsq3-devel \
                python3-devel \
                python3-pip \
                python3-setuptools \
                net-tools \
                valgrind \
                wget \
                zlib-devel \
		libsodium-devel
dnf clean all

pip install mako

git clone https://github.com/ElementsProject/lightning.git
cd lightning
./configure
make
cc   -Og  bitcoin/chainparams.o plugins/pay.o plugins/libplugin.o bitcoin/base58.o bitcoin/pubkey.o bitcoin/pullpush.o bitcoin/script.o bitcoin/shadouble.o bitcoin/short_channel_id.o bitcoin/signature.o bitcoin/tx.o bitcoin/varint.o common/amount.o common/base32.o common/bech32.o common/bech32_util.o common/bigsize.o common/bolt11.o common/daemon.o common/features.o common/hash_u5.o common/json.o common/json_helpers.o common/json_stream.o common/json_tok.o common/memleak.o common/node_id.o common/param.o common/pseudorand.o common/type_to_string.o common/utils.o common/version.o common/wireaddr.o wire/fromwire.o wire/towire.o ccan-asort.o ccan-autodata.o ccan-bitmap.o ccan-bitops.o ccan-breakpoint.o ccan-crc32c.o ccan-crypto-hmac.o ccan-crypto-hkdf.o ccan-crypto-ripemd160.o ccan-crypto-sha256.o ccan-crypto-shachain.o ccan-crypto-siphash24.o ccan-err.o ccan-fdpass.o ccan-htable.o ccan-ilog.o ccan-io-io.o ccan-intmap.o ccan-io-poll.o ccan-io-fdpass.o ccan-isaac.o ccan-isaac64.o ccan-json_escape.o ccan-json_out.o ccan-list.o ccan-mem.o ccan-membuf.o ccan-noerr.o ccan-opt-helpers.o ccan-opt-parse.o ccan-opt-usage.o ccan-opt.o ccan-pipecmd.o ccan-ptr_valid.o ccan-rbuf.o ccan-read_write_all.o ccan-str-base32.o ccan-str-hex.o ccan-str.o ccan-strmap.o ccan-take.o ccan-tal-grab_file.o ccan-tal-link.o ccan-tal-path.o ccan-tal-str.o ccan-tal.o ccan-time.o ccan-timer.o ccan-utf8.o  -Lexternal -lwallycore -lsecp256k1 -ljsmn -lbacktrace -L/usr/local/lib -lm -lgmp -lsqlite3 -lz  -lsodium -o plugins/pay
/usr/bin/ld: common/utils.o:(.bss+0x0): multiple definition of `chainparams'; plugins/libplugin.o:(.bss+0x8): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:408: plugins/pay] Error 1
@cdecker
Copy link
Member

cdecker commented Mar 21, 2020

Paging our resident Makefile expert Dr. @rustyrussell :-)

@cdecker cdecker added the build label Mar 21, 2020
@rustyrussell rustyrussell added this to the 0.8.2 milestone Apr 7, 2020
rustyrussell added a commit to rustyrussell/lightning that referenced this issue Apr 7, 2020
They now use -fno-common by default, so duplicated variables cause
a link error:

/usr/bin/ld: common/utils.o:(.bss+0x10): multiple definition of `chainparams'; plugins/libplugin.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:408: plugins/autoclean] Error 1

This was introduced in 9ebfdf0.

Fixes: ElementsProject#3597
Signed-off-by: Rusty Russell <[email protected]>
Changelog-Fixed: Multiple definition of chainparams on Fedora (or other really recent gcc)
niftynei pushed a commit that referenced this issue Apr 8, 2020
They now use -fno-common by default, so duplicated variables cause
a link error:

/usr/bin/ld: common/utils.o:(.bss+0x10): multiple definition of `chainparams'; plugins/libplugin.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:408: plugins/autoclean] Error 1

This was introduced in 9ebfdf0.

Fixes: #3597
Signed-off-by: Rusty Russell <[email protected]>
Changelog-Fixed: Multiple definition of chainparams on Fedora (or other really recent gcc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants