This is the mail archive of the gcc-patches@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: Unreviewed patches^2 / [PATCH] Fix specs processing


2003-02-08  Roger Sayle  <roger at eyesopen dot com>

* gcc.c (do_spec_1) ['{']:  Handle pending argument upon return
        from handle_braces in "%{...}".

This breaks most of the sh targets (sh-elf, sh64-elf, sh3-elf, ...) 

config/sh/sh.h has:

#if TARGET_CPU_DEFAULT & SH5_BIT
#if TARGET_CPU_DEFAULT & SH_E_BIT
#define LINK_DEFAULT_CPU_EMUL "32"
#else
#define LINK_DEFAULT_CPU_EMUL "64"
#endif /* SH_E_BIT */
#else
#define LINK_DEFAULT_CPU_EMUL ""
#endif /* SH5_BIT */

#define LINK_EMUL_PREFIX "sh%{ml:l}"
#define SUBTARGET_LINK_EMUL_SUFFIX ""

#define LINK_SPEC SH_LINK_SPEC
	
#define SH_LINK_SPEC "\
-m %(link_emul_prefix)\
%{m5-compact*|m5-32media*:32}\
%{m5-64media*:64}\
%{!m1:%{!m2:%{!m3*:%{!m4*:%{!m5*:%(link_default_cpu_emul)}}}}}\
%(subtarget_link_emul_suffix) \
%{mrelax:-relax} %(subtarget_link_spec)"

and config/sh/elf.h has:

#undef LINK_SPEC
#define LINK_SPEC SH_LINK_SPEC
#undef LINK_EMUL_PREFIX
#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT
#define LINK_EMUL_PREFIX "sh%{!mb:l}elf"
#else
#define LINK_EMUL_PREFIX "sh%{ml:l}elf"
#endif

linux.h has:
#undef SUBTARGET_LINK_EMUL_SUFFIX
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"

and netbsd-elf.h has:
#undef SUBTARGET_LINK_EMUL_SUFFIX
#define SUBTARGET_LINK_EMUL_SUFFIX "_nbsd"

This avoids a combinatorial explosion of settings fragment files and settings by
pasting together the names from the different components.  However, with your
patch, this no longer works, as extra whitespace is inserted.  I.e., for sh-elf
big endian, instead of "-m shelf" , the linker gets passed "-m sh elf" .


-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658


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