Discussion:
[sharutils] Does not compile with -fno-common
(too old to reply)
Christian Voegl
2020-01-20 18:47:15 UTC
Permalink
Trying to build sharutils 4.15.2 with  -fno-common fails with

[   30s]
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld:
shar-opts.o:(.data.rel.ro.local+0x0): multiple definition of
`program_name'; shar.o:(.rodata+0x10): first defined here
[   30s]
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld:
../lib/libgnu.a(md5.o): in function `md5_stream':
[   30s] md5.c:(.text+0x15d): multiple definition of `md5_stream';
shar.o:shar.c:(.text+0x28): first defined here


As -fno-common is going to be the default, I think this should be fixed.


Kind regards,

Christian Vögl
--
Christian Vögl <***@suse.de>
Working Student

SUSE Software Solutions Germany GmbH
Maxfeldstr. 5
90409 Nürnberg
Germany
(HRB 247165, AG München)
Geschäftsführer: Felix Imendörffer
Petr Pisar
2020-01-23 15:19:04 UTC
Permalink
Trying to build sharutils 4.15.2 with  -fno-common fails with
[   30s]
shar-opts.o:(.data.rel.ro.local+0x0): multiple definition of
`program_name'; shar.o:(.rodata+0x10): first defined here
[   30s]
[   30s] md5.c:(.text+0x15d): multiple definition of `md5_stream';
shar.o:shar.c:(.text+0x28): first defined here
As -fno-common is going to be the default, I think this should be fixed.
Please try the two patches attached. The first one should fix the program_name
symbol. The second the md5_stream symbol. I was able to reproduce the first
one, but not the second one. (Depiste tha fact I do not link to openssl.)

-- Petr
Bruce Korb
2020-01-29 02:06:53 UTC
Permalink
Post by Petr Pisar
Post by Christian Voegl
Trying to build sharutils 4.15.2 with  -fno-common fails with
[   30s]
shar-opts.o:(.data.rel.ro.local+0x0): multiple definition of
`program_name'; shar.o:(.rodata+0x10): first defined here
[   30s]
[   30s] md5.c:(.text+0x15d): multiple definition of `md5_stream';
shar.o:shar.c:(.text+0x28): first defined here
As -fno-common is going to be the default, I think this should be fixed.
Please try the two patches attached. The first one should fix the program_name
symbol. The second the md5_stream symbol. I was able to reproduce the first
one, but not the second one. (Depiste tha fact I do not link to openssl.)
-- Petr
Thank you guys. I'll queue this up for when I can figure out how to
re-run "autoreconf" once again. Meanwhile, use Petr's patch.

Continue reading on narkive:
Search results for '[sharutils] Does not compile with -fno-common' (Questions and Answers)
5
replies
"Conflicting types for function" C program issue?
started 2013-12-31 09:37:49 UTC
programming & design
Loading...