base: Add an M5_WEAK macro to compiler.hh.
authorGabe Black <gabeblack@google.com>
Tue, 13 Oct 2020 10:59:34 +0000 (03:59 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 14 Oct 2020 00:45:54 +0000 (00:45 +0000)
On gnu compatible systems, this will be implemented with the
[[gnu::weak]] attribute.

Change-Id: I1add373d648bbca24feab63420a9d87363646b6a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35939
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
src/base/compiler.hh

index ead1507fd40e687a997584e5a2790f4510fec1c2..4565143b11a9672cb2eea83a4e7f234ec837bf99 100644 (file)
@@ -97,6 +97,7 @@
 // Set the visibility of a symbol.
 #  define M5_PUBLIC [[gnu:visibility("default")]]
 #  define M5_LOCAL [[gnu::visibility("hidden")]]
+#  define M5_WEAK [[gnu::weak]]
 
 // Marker for what should be an unreachable point in the code.
 #  define M5_UNREACHABLE __builtin_unreachable()