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]

Re: Is -T meaningful as an assembler option?

Sandra Loosemore wrote:

>> I'm willing to prepare a patch that removes %{T} from all ASM_SPECs
>> and documents -T as a linker option, but....
>> (a) is this the right thing to do?
>> (b) is this appropriate to submit for stage 3?
> Following up on my own message, I'm now inclined to think the answer to
> both questions is "no".  :-(

> I have no idea what -T means as a flag for the System V "as" command,
> and whether there are other targets that really do use the native System
> V assembler.  But assuming a System V assembler, instead of gas, seems
> silly for powerpc-eabi and powerpc-linux, at least.  And both of those
> configs simultaneously think -T is a linker option, too.  :-P


> To make a long story short, it looks like a bigger fix is required here
> than just hacking up the ASM_SPEC strings -- probably some global
> default spec to use when the assembler is gas and some reorganization of
> configs for lots of targets not to override that default except when
> there's very good reason to assume some other assembler.  (E.g., why
> should the powerpc-eabi target be sucking in configuration bits specific
> to System V, anyway?)  This looks like a big task, with lots of
> target-specific hackery and testing required.

Yes, I think that's the best plan, but I don't think it's as bad as you
do.  And, there's nothing that says you have to do all targets to make
progress here.  I'd suggest:

1. In config/svr4.h:

* Define SVR4_ASM_SPEC like so:

#ifndef USE_GAS
#define SVR4_ASM_SPEC <its current value>
#define SVR4_ASM_SPEC <its current value without -T>


2. In config/rs6000/sysv4.h, in the midst of the big string, do:

#define ASM_SPEC "%(asm_cpu) \

%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} " \
 "%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC}

This is backwards-compatible in that configurations including
config/svr4.h still work as before -- except that they no longer pass -T
to GAS, which is good, since that doesn't work.  The Power bug is then
fixed.  Other configurations using config/svr4.h that are overriding
ASM_SPEC can, if they want, update to use SVR4_ASM_SPEC as above to
avoid code duplication.

The rs6000/sysv4.h file is mis-named; it's really more like "Power on
ELF systems" than "Power on AT&T System V Release 4 systems".  Heck,
it's got FreeBSD and Linux bits in there, even.  But, the naming of the
file is a separate issue.

Mark Mitchell
(650) 331-3385 x713

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