Andreas Schwab <[email protected]> writes:
> "H.J. Lu" <[email protected]> writes:
>
>> diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
>> index 88356cc..74ebff7 100644
>> --- a/gcc/config/m68k/m68k.h
>> +++ b/gcc/config/m68k/m68k.h
>> @@ -40,7 +40,8 @@ along with GCC; see the file COPYING3. If not see
>> %{m68020-40:-m68040}%{m68020-60:-m68040}\
>> %{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\
>> "
>> -#define ASM_PCREL_SPEC "%{fPIC|fpic|mpcrel:--pcrel} \
>> +#define ASM_PCREL_SPEC "%{" FPIC_SPEC ":--pcrel} \
>> + %{mpcrel:%{" NO_FPIC_SPEC ":--pcrel}} \
>> %{msep-data|mid-shared-library:--pcrel} \
>
> That expands to a spurious --pcrel with -fno-PIE, causing the assembler
> to error out while compiling crtstuff if the compiler is configured with
> --enable-default-pie.
This was already buggy before, -fpie should always have implied --pcrel.
Fixed as below.
Andreas.
* config/m68k/m68k.h (ASM_PCREL_SPEC): Pass --pcrel also for
implict or explicit -fPIE or -fpie.
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 74ebff7..b227c67 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -40,8 +40,8 @@ along with GCC; see the file COPYING3. If not see
%{m68020-40:-m68040}%{m68020-60:-m68040}\
%{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\
"
-#define ASM_PCREL_SPEC "%{" FPIC_SPEC ":--pcrel} \
- %{mpcrel:%{" NO_FPIC_SPEC ":--pcrel}} \
+#define ASM_PCREL_SPEC "%{" FPIE_OR_FPIC_SPEC ":--pcrel} \
+ %{mpcrel:%{" NO_FPIE_AND_FPIC_SPEC ":--pcrel}} \
%{msep-data|mid-shared-library:--pcrel} \
"
--
2.4.2
--
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."