This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[PATCH V2 5/8] bpf: make target-supports.exp aware of eBPF


This patch makes the several effective target checks in
target-supports.exp to be aware of eBPF targets.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_malloc): New
	function.
	(check_effective_target_trampolines): Adapt to eBPF.
	(check_effective_target_stack_size): Likewise.
	(dg-effective-target-value): Likewise.
	(check_effective_target_indirect_jumps): Likewise.
	(check_effective_target_nonlocal_goto): Likewise.
	(check_effective_target_global_constructor): Likewise.
	(check_effective_target_return_address): Likewise.
---
 gcc/testsuite/ChangeLog               | 11 +++++++++++
 gcc/testsuite/lib/target-supports.exp | 27 +++++++++++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 300d22a2d65..8b6168626d8 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -526,7 +526,8 @@ proc check_effective_target_trampolines { } {
 	 || [istarget nvptx-*-*]
 	 || [istarget hppa2.0w-hp-hpux11.23]
 	 || [istarget hppa64-hp-hpux11.23]
-	 || [istarget pru-*-*] } {
+	 || [istarget pru-*-*]
+         || [istarget bpf-*-*] } {
 	return 0;
     }
     return 1
@@ -538,6 +539,9 @@ proc check_effective_target_stack_size { } {
     if [target_info exists gcc,stack_size] {
 	return 1
     }
+    if [istarget bpf-*-*] {
+	return 1
+    }
     return 0
 }
 
@@ -546,7 +550,11 @@ proc check_effective_target_stack_size { } {
 proc dg-effective-target-value { effective_target } {
     if { "$effective_target" == "stack_size" } {
 	if [check_effective_target_stack_size] {
-	    return [target_info gcc,stack_size]
+	    if [istarget bpf-*-*] {
+		return "512"
+	    } else {
+		return [target_info gcc,stack_size]
+	    }
 	}
     }
 
@@ -781,7 +789,7 @@ proc add_options_for_tls { flags } {
 # Return 1 if indirect jumps are supported, 0 otherwise.
 
 proc check_effective_target_indirect_jumps {} {
-    if { [istarget nvptx-*-*] } {
+    if { [istarget nvptx-*-*] || [istarget bpf-*-*] } {
 	return 0
     }
     return 1
@@ -790,7 +798,7 @@ proc check_effective_target_indirect_jumps {} {
 # Return 1 if nonlocal goto is supported, 0 otherwise.
 
 proc check_effective_target_nonlocal_goto {} {
-    if { [istarget nvptx-*-*] } {
+    if { [istarget nvptx-*-*] || [istarget bpf-*-*] } {
 	return 0
     }
     return 1
@@ -799,10 +807,9 @@ proc check_effective_target_nonlocal_goto {} {
 # Return 1 if global constructors are supported, 0 otherwise.
 
 proc check_effective_target_global_constructor {} {
-    if { [istarget nvptx-*-*] } {
-	return 0
-    }
-    if { [istarget amdgcn-*-*] } {
+    if { [istarget nvptx-*-*]
+	 || [istarget amdgcn-*-*]
+	 || [istarget bpf-*-*] } {
 	return 0
     }
     return 1
@@ -825,6 +832,10 @@ proc check_effective_target_return_address {} {
     if { [istarget nvptx-*-*] } {
 	return 0
     }
+    # No notion of return address in eBPF.
+    if { [istarget bpf-*-*] } {
+	return 0
+    }
     # It could be supported on amdgcn, but isn't yet.
     if { [istarget amdgcn*-*-*] } {
 	return 0
-- 
2.11.0


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