FS#11816 - Building cpio 2.9 using abs and makepkg fails with collect2: ld returned 1 exit status

Attached to Project: Arch Linux
Opened by Baho Utot (baho-utot) - Monday, 20 October 2008, 22:51 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 11 May 2009, 07:09 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture i686
Severity Medium
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:I am trying to compile cpio using the PKGBUILD file
from /var/abs/core/cpio copied into /var/abs/local

there I run makepkg --clean --noconfirm --log --syncdeps --rmdeps

if gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -I. -I.. -I../lib
-march=pentium2 -O2 -pipe -fomit-frame-pointer -MT userspec.o -MD -MP
-MF ".deps/userspec.Tpo" -c -o userspec.o userspec.c; \ then mv -f
".deps/userspec.Tpo" ".deps/userspec.Po"; else rm -f
".deps/userspec.Tpo"; exit 1; fi gcc -std=gnu99 -march=pentium2 -O2
-pipe -fomit-frame-pointer -o cpio copyin.o copyout.o copypass.o
defer.o dstring.o global.o main.o tar.o util.o filemode.o idcache.o
makepath.o userspec.o ../lib/libcpio.a ../lib/libcpio.a(argp-help.o):
In function `_option_is_end': argp-help.c:(.text+0x0): multiple
definition of `_option_is_end' main.o:main.c:(.text+0x0): first defined
here ../lib/libcpio.a(argp-help.o): In function `_option_is_short':
argp-help.c:(.text+0x4e0): multiple definition of `_option_is_short'
main.o:main.c:(.text+0x1e30): first defined here
../lib/libcpio.a(argp-help.o): In function `argp_usage':
argp-help.c:(.text+0x3ad0): multiple definition of `argp_usage'
main.o:main.c:(.text+0x1370): first defined here
../lib/libcpio.a(argp-parse.o): In function `_option_is_end':
argp-parse.c:(.text+0x0): multiple definition of `_option_is_end'
main.o:main.c:(.text+0x0): first defined here
../lib/libcpio.a(argp-parse.o): In function `argp_usage':
argp-parse.c:(.text+0x230): multiple definition of `argp_usage'
main.o:main.c:(.text+0x1370): first defined here
../lib/libcpio.a(argp-parse.o): In function `_option_is_short':
argp-parse.c:(.text+0x380): multiple definition of `_option_is_short'
main.o:main.c:(.text+0x1e30): first defined here
../lib/libcpio.a(argp-pvh.o): In function `_option_is_end':
argp-pvh.c:(.text+0x0): multiple definition of `_option_is_end'
main.o:main.c:(.text+0x0): first defined here
../lib/libcpio.a(argp-pvh.o): In function `_option_is_short':
argp-pvh.c:(.text+0x30): multiple definition of `_option_is_short'
main.o:main.c:(.text+0x1e30): first defined here
../lib/libcpio.a(argp-pvh.o): In function `argp_usage':
argp-pvh.c:(.text+0x70): multiple definition of `argp_usage'
main.o:main.c:(.text+0x1370): first defined here
../lib/libcpio.a(argp-eexst.o): In function `_option_is_end':
argp-eexst.c:(.text+0x0): multiple definition of `_option_is_end'
main.o:main.c:(.text+0x0): first defined here
../lib/libcpio.a(argp-eexst.o): In function `_option_is_short':
argp-eexst.c:(.text+0x30): multiple definition of `_option_is_short'
main.o:main.c:(.text+0x1e30): first defined here
../lib/libcpio.a(argp-eexst.o): In function `argp_usage':
argp-eexst.c:(.text+0x70): multiple definition of `argp_usage'
main.o:main.c:(.text+0x1370): first defined here
../lib/libcpio.a(argp-fmtstream.o): In function `argp_fmtstream_putc':
argp-fmtstream.c:(.text+0x710): multiple definition of
`argp_fmtstream_putc' ../lib/libcpio.a(argp-help.o):argp-help.c:(.text+0x6d0):
first defined here ../lib/libcpio.a(argp-fmtstream.o): In function
`argp_fmtstream_point': argp-fmtstream.c:(.text+0x760): multiple
definition of
`argp_fmtstream_point' ../lib/libcpio.a(argp-help.o):argp-help.c:(.text+0x610):
first defined here ../lib/libcpio.a(argp-fmtstream.o): In function
`argp_fmtstream_set_wmargin': argp-fmtstream.c:(.text+0x790): multiple
definition of
`argp_fmtstream_set_wmargin'
../lib/libcpio.a(argp-help.o):argp-help.c:(.text+0x640):
first defined here ../lib/libcpio.a(argp-fmtstream.o): In function
`argp_fmtstream_set_rmargin': argp-fmtstream.c:(.text+0x7c0): multiple
definition of
`argp_fmtstream_set_rmargin'
../lib/libcpio.a(argp-help.o):argp-help.c:(.text+0x670):
first defined here ../lib/libcpio.a(argp-fmtstream.o): In function
`argp_fmtstream_set_lmargin': argp-fmtstream.c:(.text+0x7f0): multiple
definition of
`argp_fmtstream_set_lmargin'
../lib/libcpio.a(argp-help.o):argp-help.c:(.text+0x6a0):
first defined here ../lib/libcpio.a(argp-fmtstream.o): In function
`argp_fmtstream_write': argp-fmtstream.c:(.text+0x8e0): multiple
definition of
`argp_fmtstream_write' ../lib/libcpio.a(argp-help.o):argp-help.c:(.text+0x720):
first defined here ../lib/libcpio.a(argp-fmtstream.o): In function
`argp_fmtstream_puts': argp-fmtstream.c:(.text+0x9a0): multiple
definition of
`argp_fmtstream_puts' ../lib/libcpio.a(argp-help.o):argp-help.c:(.text+0x1930):
first defined here collect2: ld returned 1 exit status make[3]: ***
[cpio] Error 1


Additional info:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}

* package version(s)
gcc 4.3.2

* config and/or log files etc.

Steps to reproduce:
cp -vr /var/abs/core/cpio /var/abs/local
cd /var/abs/local/cpio
makepkg --clean --noconfirm --log --syncdeps --rmdeps
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Monday, 11 May 2009, 07:09 GMT
Reason for closing:  Fixed
Additional comments about closing:  2.9-4
Comment by Jan de Groot (JGC) - Tuesday, 21 October 2008, 06:40 GMT
What happens when you remove -fomit-frame-pointer from your CFLAGS?
Comment by Baho Utot (baho-utot) - Tuesday, 21 October 2008, 20:26 GMT

CFLAGS="-march=pentium2 -O2 -pipe"

collect2: ld returned 1 exit status
make[2]: *** [cpio] Error 1
make[2]: Leaving directory `/home/scrat/cpio/src/cpio-2.9/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/scrat/cpio/src/cpio-2.9'
make: *** [all] Error 2
Comment by Baho Utot (baho-utot) - Tuesday, 21 October 2008, 21:04 GMT

CFLAGS="-march=pentium2 -O2 -pipe"

collect2: ld returned 1 exit status
make[2]: *** [cpio] Error 1
make[2]: Leaving directory `/home/scrat/cpio/src/cpio-2.9/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/scrat/cpio/src/cpio-2.9'
make: *** [all] Error 2
Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 21:59 GMT
Confirmed, with default flags (-O2 -march=i686 -mtune=generic -pipe) the same thing happens.
Comment by Massimiliano Brocchini (proc) - Sunday, 25 January 2009, 21:18 GMT
The problem is caused by inlining: see this old (2007) http://www.nabble.com/Patch:-compile-cpio-2.9-with-new-gcc-4.3-td12876731.html discussion and this one http://www.nabble.com/Compilation-errors-with-GCC-4.3.1-td19145084.html.
Using ac_cv_prog_cc_c99=no ./configure lead to a successful compilation.
Comment by Andrej Gelenberg (nikel) - Sunday, 22 March 2009, 16:31 GMT
My patch for PKGBUILD whith patch for gcc-4.3. In Original package is info help missing.
   patch (1.4 KiB)

Loading...