This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Unreviewed patches^2 / [PATCH] Fix specs processing
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: gcc-patches at gcc dot gnu dot org, Zack Weinberg <zack at codesourcery dot com>, Roger Sayle <roger at eyesopen dot com>
- Cc: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Tue, 04 Mar 2003 15:32:43 +0000
- Subject: Re: Unreviewed patches^2 / [PATCH] Fix specs processing
- Organization: SuperH UK Ltd.
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