This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: collect2 "-o" argument position problem


David Guillen <david@davidgf.net> writes:
> The thing is that I had a similar problem before with the "-m"
> parameter, which didn't had any parameter, therefore I used to had -m
> -dynamic-linker (which is wrong) and I fixed it by adding:
>
> -#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
> +#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
>
> in the i386/gnu-user.h file.
>
> Now taking a look at it I just realized a dirty way to fix it, it is:
>
> #undef  LINK_SPEC
> #define LINK_SPEC "-m elf_i386  %{shared:-shared} \
>   %{!shared: \
>     %{!static: \
>       %{rdynamic:-export-dynamic} \
>       -dynamic-linker /lib/ld-linux.so.2} \     // Hardcoding here the argument
>       %{static:-static}}"
>
> I do not know why it doesn't read the values of parameters such as
> %(dynamic_linker) although they are defined:
>
> #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
> #define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKE
> #define SUBTARGET_EXTRA_SPECS \
>   { "link_emulation", GNU_USER_LINK_EMULATION },\
>   { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
>
> Any ideas?

Probably worth double-checking that your backend header file has the
equivalent of:

#define EXTRA_SPECS	\
  ...			\							
  SUBTARGET_EXTRA_SPECS

Thanks,
Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]