summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdeel <adeelbm@outlook.com>2019-05-25 14:00:00 +0300
committerDave Watson <dade.watson@gmail.com>2019-06-12 09:00:40 -0700
commitedc427a9eccd6db583fd0cd920e2af23b4b544a9 (patch)
tree06c88d139c0d7c950b56f89d645f80ab492fbe09 /include
parent434e9095cbaaa74a99d13dd5bab4db071b999be4 (diff)
downloadlibunwind-edc427a9eccd6db583fd0cd920e2af23b4b544a9.tar.gz
Add initial support for Solaris x86-64
Diffstat (limited to 'include')
-rw-r--r--include/libunwind-common.h.in13
-rw-r--r--include/libunwind_i.h2
-rw-r--r--include/tdep-x86_64/jmpbuf.h5
-rw-r--r--include/tdep-x86_64/libunwind_i.h4
4 files changed, 18 insertions, 6 deletions
diff --git a/include/libunwind-common.h.in b/include/libunwind-common.h.in
index c82a8b90..9dbb415f 100644
--- a/include/libunwind-common.h.in
+++ b/include/libunwind-common.h.in
@@ -30,6 +30,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min))
#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR)
+#ifdef __sun
+// On SmartOS, gcc fails with the following error:
+//
+// ../include/libunwind-common.h:43:41: error: expected identifier or '(' before numeric constant
+// # define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_)
+// ^
+//
+// workaround is to undefine _U explicitly.
+// see https://github.com/libunwind/libunwind/issues/118 for more details.
+//
+#undef _U
+#endif
+
#define UNW_PASTE2(x,y) x##y
#define UNW_PASTE(x,y) UNW_PASTE2(x,y)
#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn)
diff --git a/include/libunwind_i.h b/include/libunwind_i.h
index 966cf889..e0f45401 100644
--- a/include/libunwind_i.h
+++ b/include/libunwind_i.h
@@ -90,8 +90,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# else
# error Host has unknown byte-order.
# endif
-# elif defined(__sun)
-# define __BYTE_ORDER __LITTLE_ENDIAN
# else
# error Host has unknown byte-order.
# endif
diff --git a/include/tdep-x86_64/jmpbuf.h b/include/tdep-x86_64/jmpbuf.h
index d5719667..b2e5332b 100644
--- a/include/tdep-x86_64/jmpbuf.h
+++ b/include/tdep-x86_64/jmpbuf.h
@@ -23,9 +23,10 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-#if defined __linux__
+#if defined __linux__ || defined __sun
-/* Use glibc's jump-buffer indices; NPTL peeks at SP: */
+/* Use glibc's jump-buffer indices; NPTL peeks at SP:
+ https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blob;f=sysdeps/x86_64/jmpbuf-offsets.h;h=ea94a1f90554deecceaf995ca5ee485ae8bffab7;hb=HEAD */
#define JB_SP 6
#define JB_RP 7
diff --git a/include/tdep-x86_64/libunwind_i.h b/include/tdep-x86_64/libunwind_i.h
index 1d5e711d..8713b39d 100644
--- a/include/tdep-x86_64/libunwind_i.h
+++ b/include/tdep-x86_64/libunwind_i.h
@@ -200,7 +200,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
#define tdep_get_exe_image_path UNW_ARCH_OBJ(get_exe_image_path)
#define tdep_access_reg UNW_OBJ(access_reg)
#define tdep_access_fpreg UNW_OBJ(access_fpreg)
-#if defined(__linux__) || defined(__sun)
+#if __linux__ || __sun
# define tdep_fetch_frame UNW_OBJ(fetch_frame)
# define tdep_cache_frame UNW_OBJ(cache_frame)
# define tdep_reuse_frame UNW_OBJ(reuse_frame)
@@ -252,7 +252,7 @@ extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg,
unw_word_t *valp, int write);
extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg,
unw_fpreg_t *valp, int write);
-#if __linux__
+#if __linux__ || __sun
extern void tdep_fetch_frame (struct dwarf_cursor *c, unw_word_t ip,
int need_unwind_info);
extern int tdep_cache_frame (struct dwarf_cursor *c);