Hello Giacomo Travaglini,

I'd like you to do a code review. Please visit

    https://gem5-review.googlesource.com/11513

to review the following change.


Change subject: base: Add a M5_PUBLIC and M5_LOCAL attribute macro
......................................................................

base: Add a M5_PUBLIC and M5_LOCAL attribute macro

There are cases where we need to limit the symbol visibility to avoid
compilation errors. This is a problem for Python code that relies on
PyBind11 since recent versions enforce hidden symbols. As a
consequence, classes that have member variables from PyBind11 need to
be declared with the hidden attribute (or gem5 needs to be compiled
with -fvisibility=hidden).

Change-Id: I30e582fde494ff61ab7a596a595efc26a2952a5f
Signed-off-by: Andreas Sandberg <[email protected]>
Reviewed-by: Giacomo Travaglini <[email protected]>
---
M src/base/compiler.hh
1 file changed, 2 insertions(+), 0 deletions(-)



diff --git a/src/base/compiler.hh b/src/base/compiler.hh
index 4765adc..35156ee 100644
--- a/src/base/compiler.hh
+++ b/src/base/compiler.hh
@@ -56,6 +56,8 @@
 #  define M5_DEPRECATED __attribute__((deprecated))
 #  define M5_DEPRECATED_MSG(MSG) __attribute__((deprecated(MSG)))
 #  define M5_UNREACHABLE __builtin_unreachable()
+#  define M5_PUBLIC __attribute__ ((visibility ("default")))
+#  define M5_LOCAL __attribute__ ((visibility ("hidden")))
 #endif

 #if defined(__clang__)

--
To view, visit https://gem5-review.googlesource.com/11513
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I30e582fde494ff61ab7a596a595efc26a2952a5f
Gerrit-Change-Number: 11513
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to