* Tidy up CC1_SPEC. Remove the -mno-pic flag, which didn't actually

work properly.
* Add a new -mno-asm-pic flag which tells the assembler to assemble
  the code non-PIC even if it was compiled PIC.
This commit is contained in:
thorpej 2002-11-05 14:31:58 +00:00
parent 54a7ee3470
commit b4f17138b9
2 changed files with 17 additions and 7 deletions

View File

@ -8,16 +8,25 @@
#define CPP_PREDEFINES "-D__vax__ -D__NetBSD__ -Asystem(unix) -Asystem(NetBSD) -Acpu(vax) -Amachine(vax)"
#undef CC1_SPEC
#define CC1_SPEC "\
%{!fno-pic: \
%{!mno-pic: %{!fpic: %{!fPIC:-fPIC}}} \
%{!mindirect: %{!mno-indirect:-mno-indirect}}} \
%{mno-pic: -fno-pic -mindirect} \
%{fno-pic: \
%{!mindirect: %{!mno-indirect:-mindirect}}}"
#define CC1_SPEC \
"%{!fno-pic: \
%{!fpic: \
%{!fPIC:-fPIC}} \
%{!mindirect: \
%{!mno-indirect:-mno-indirect}}} \
%{fno-pic: \
%{!mno-indirect: \
%{!mindirect:-mindirect}}}"
#define CC1PLUS_SPEC CC1_SPEC
/* Pass -k to the assembler by default, since we generate PIC code by
default (-fPIC above), unless -fno-pic or -mno-asm-pic is passed. */
#undef ASM_SPEC
#define ASM_SPEC \
"%{!fno-pic: \
%{!mno-asm-pic:-k}}"
/* Make gcc agree with <machine/ansi.h> */
#undef SIZE_TYPE

View File

@ -82,6 +82,7 @@ extern int target_flags;
{"d-float", -MASK_G_FLOAT, "Generate DFLOAT double precision code"}, \
{"indirect", MASK_INDIRECT, "Allow indirect memory references in PIC code"}, \
{"no-indirect", -MASK_INDIRECT, "Disallow indirect memory references in PIC code"}, \
{"no-asm-pic", 0, "Don't assemble as PIC code"}, \
{ "", TARGET_DEFAULT, 0}}
/* Default target_flags if no switches specified. */