This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: collect2 "-o" argument position problem
- From: Andrew Pinski <pinskia at gmail dot com>
- To: David Guillen <david at davidgf dot net>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Wed, 2 Apr 2014 15:44:42 -0700
- Subject: Re: collect2 "-o" argument position problem
- Authentication-results: sourceware.org; auth=none
- References: <CADQAGRNGyj=uqqzryviaccZ=UwO21Hu6tTKazU0HOCjCXd7gkw at mail dot gmail dot com>
On Wed, Apr 2, 2014 at 3:26 PM, David Guillen <david@davidgf.net> wrote:
> Hello guys,
>
> I don't know whether this is the best place to ask for this, but
> anyway, here we go:
>
> I have two different commandlines for collect2 (I got them after using
> -v in gcc) and I found out that the original one does not work because
> of the position in the parameter list.
The simple answer is -dynamic-linker takes an operand.
So in the first case, the operand to dynamic-linker is -o and in the
second case it is
/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/crt1.o
.
Both seems wrong. How is GCC being invoked here? Do you have
-Wl,-dynamic-linker on the command line?
Thanks,
Andrew
>
>
> Error:
> /home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc/collect2
> --sysroot=/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot
> --eh-frame-hdr -m elf_i386 -dynamic-linker -o conftest
> /home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/crt1.o
> /home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/crti.o
> /home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc/crtbegin.o
> -L/home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/bin
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/lib
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/lib
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib
> conftest.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc
> --as-needed -lgcc_s --no-as-needed
> /home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc/crtend.o
> /home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/crtn.o
> /home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/bin/ld:
> cannot find conftest: No such file or directory
>
> No error:
> /home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc/collect2
> --sysroot=/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot
> --eh-frame-hdr -m elf_i386 -dynamic-linker
> /home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/crt1.o
> /home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/crti.o
> /home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc/crtbegin.o
> -L/home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/bin
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/lib
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/lib
> -L/home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib
> conftest.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc
> --as-needed -lgcc_s --no-as-needed
> /home/david/uclibc/uclibc-buildroot-custom/output/build/host-gcc-final-gcc-4_7_3-release/build/./gcc/crtend.o
> /home/david/uclibc/uclibc-buildroot-custom/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/crtn.o
> -o conftest
>
>
> Any idea on why the parameter parsing fails? Is it a problem or is it
> the expected behavior?
>
> Thanks a lot,
> David