This is the mail archive of the 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]

spec file help for QNX patch


I am working on qnx-nto support, and am currently wrestling with the lib
search paths.  I would like gcc to be able to find the appropriate libs and
objects on the fly, and am not sure how to do that correctly.  I can use "-B"
on the gcc command line, but I would like to automate this.

Any ideas or suggestions?

Our cross development TARGET_SYSTEM_ROOT for a dual-endian target like
arm[be,le] looks like:


I want to set gcc up to find the necessary search paths, but so far I think my
solution is not quite correct.  I have gcc/config/t-nto, and in there I have:

Then in gcc/config/arm/nto.h I set up my STARTFILE_SPEC, ENDFILE_SPEC and
LIB_SPEC as follows:

  "%{!shared: \
    %{!symbolic: \
     %{pg:" QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/lib/mcrt1.o%s} \
     %{!pg:%{p:" QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/lib/mcrt1.o%s} \
     %{!p:" QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/lib/crt1.o%s}}}} \
   " QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/lib/crti.o%s \
     %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"

#define ENDFILE_SPEC \
  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} " QNX_SYSTEM_ROOT

#undef LIB_SPEC
#define LIB_SPEC                                                        \
  "-L " QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/lib \
   -L " QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/usr/lib \

This sorta works, but "-L" is searched before the gcc "-B" paths, and so xgcc
finds the wrong libs during the build process (for example abi-check finds a
legacy and so fails).  Also, this ties the specs to a qnx-nto
specific cross development libdir layout.

Anyone?  I will eventually be submitting patches for all qnx-nto targets, and
any advice on doing this correctly is appreciated.

Thanks in advance.
Graeme Peterson
QNX Tools Group

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