Commit 8997ef18 by Jiong Wang Committed by Jiong Wang

[AArch64] Restrict pic-small.c by new test directive

2015-07-01  Jiong Wang  <jiong.wang@arm.com>

      gcc/
	* doc/sourcebuild.texi (AArch64-specific attributes): New subsection.
	Document "aarch64_small_fpic".

      gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_aarch64_small_fpic): New function.
	* gcc.target/aarch64/pic-small.c: Restrict this test under
	check_effective_target_aarch64_small_fpic.

From-SVN: r225232
parent 34ecdb0f
2015-07-01 Jiong Wang <jiong.wang@arm.com> 2015-07-01 Jiong Wang <jiong.wang@arm.com>
* doc/sourcebuild.texi (AArch64-specific attributes): New subsection.
Document "aarch64_small_fpic".
2015-07-01 Jiong Wang <jiong.wang@arm.com>
* configure.ac: Add check for aarch64 assembler -fpic relocation * configure.ac: Add check for aarch64 assembler -fpic relocation
modifier support. modifier support.
* configure: Regenerate. * configure: Regenerate.
......
...@@ -1580,6 +1580,15 @@ ARM target prefers @code{LDRD} and @code{STRD} instructions over ...@@ -1580,6 +1580,15 @@ ARM target prefers @code{LDRD} and @code{STRD} instructions over
@end table @end table
@subsubsection AArch64-specific attributes
@table @code
@item aarch64_small_fpic
Binutils installed on test system supports relocation types required by -fpic
for AArch64 small memory model.
@end table
@subsubsection MIPS-specific attributes @subsubsection MIPS-specific attributes
@table @code @table @code
......
2015-07-01 Jiong Wang <jiong.wang@arm.com>
* lib/target-supports.exp (check_effective_target_aarch64_small_fpic): New function.
* gcc.target/aarch64/pic-small.c: Restrict this test under
check_effective_target_aarch64_small_fpic.
2015-07-01 Eric Botcazou <ebotcazou@adacore.com> 2015-07-01 Eric Botcazou <ebotcazou@adacore.com>
* gfortran.dg/gomp/pr66633.f90: New test. * gfortran.dg/gomp/pr66633.f90: New test.
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-require-effective-target aarch64_small_fpic } */
/* { dg-options "-O2 -fpic -fno-inline --save-temps" } */ /* { dg-options "-O2 -fpic -fno-inline --save-temps" } */
void abort (); void abort ();
......
...@@ -937,6 +937,26 @@ proc check_effective_target_fpic { } { ...@@ -937,6 +937,26 @@ proc check_effective_target_fpic { } {
return 0 return 0
} }
# On AArch64, if -fpic is not supported, then we will fall back to -fPIC
# silently. So, we can't rely on above "check_effective_target_fpic" as it
# assumes compiler will give warning if -fpic not supported. Here we check
# whether binutils supports those new -fpic relocation modifiers, and assume
# -fpic is supported if there is binutils support. GCC configuration will
# enable -fpic for AArch64 in this case.
#
# "check_effective_target_aarch64_small_fpic" is dedicated for checking small
# memory model -fpic relocation types.
proc check_effective_target_aarch64_small_fpic { } {
if { [istarget aarch64*-*-*] } {
return [check_no_compiler_messages aarch64_small_fpic object {
void foo (void) { asm ("ldr x0, [x2, #:gotpage_lo15:globalsym]"); }
}]
} else {
return 0
}
}
# Return 1 if -shared is supported, as in no warnings or errors # Return 1 if -shared is supported, as in no warnings or errors
# emitted, 0 otherwise. # emitted, 0 otherwise.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment