1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>12.�README.solaris</title>
5<link rel="stylesheet" type="text/css" href="vg_basic.css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="index.html" title="Valgrind Documentation">
8<link rel="up" href="dist.html" title="Valgrind Distribution Documents">
9<link rel="prev" href="dist.readme-mips.html" title="11.�README.mips">
10<link rel="next" href="licenses.html" title="GNU Licenses">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<div><table class="nav" width="100%" cellspacing="3" cellpadding="3" border="0" summary="Navigation header"><tr>
14<td width="22px" align="center" valign="middle"><a accesskey="p" href="dist.readme-mips.html"><img src="images/prev.png" width="18" height="21" border="0" alt="Prev"></a></td>
15<td width="25px" align="center" valign="middle"><a accesskey="u" href="dist.html"><img src="images/up.png" width="21" height="18" border="0" alt="Up"></a></td>
16<td width="31px" align="center" valign="middle"><a accesskey="h" href="index.html"><img src="images/home.png" width="27" height="20" border="0" alt="Up"></a></td>
17<th align="center" valign="middle">Valgrind Distribution Documents</th>
18<td width="22px" align="center" valign="middle"><a accesskey="n" href="licenses.html"><img src="images/next.png" width="18" height="21" border="0" alt="Next"></a></td>
19</tr></table></div>
20<div class="chapter">
21<div class="titlepage"><div><div><h1 class="title">
22<a name="dist.readme-solaris"></a>12.�README.solaris</h1></div></div></div>
23<div class="literallayout"><p><br>
24������Requirements<br>
25------------<br>
26-�You�need�a�recent�Solaris-like�OS�to�compile�this�port.�Solaris�11�or<br>
27��any�illumos-based�distribution�should�work,�Solaris�10�is�not�supported.<br>
28��Running�`uname�-r`�has�to�print�'5.11'.<br>
29-�Recent�GCC�tools�are�required,�GCC�3�will�probably�not�work.�GCC�version<br>
30��4.5�(or�higher)�is�recommended.<br>
31-�Solaris�ld�has�to�be�the�first�linker�in�the�PATH.�GNU�ld�cannot�be�used.<br>
32��There�is�currently�no�linker�check�in�the�configure�script�but�the�linking<br>
33��phase�fails�if�GNU�ld�is�used.�Recent�Solaris/illumos�distributions�are�ok.<br>
34-�A�working�combination�of�autotools�is�required:�aclocal,�autoheader,<br>
35��automake�and�autoconf�have�to�be�found�in�the�PATH.�You�should�be�able�to<br>
36��install�pkg:/developer/build/automake�and�pkg:/developer/build/autoconf<br>
37��packages�to�fulfil�this�requirement.<br>
38-�System�header�files�are�required.�On�Solaris,�these�can�be�installed�with:<br>
39����#�pkg�install�system/header<br>
40-�GNU�make�is�also�required.�On�Solaris,�this�can�be�quickly�achieved�with:<br>
41����$�PATH=/usr/gnu/bin:$PATH;�export�PATH<br>
42-�For�remote�debugging�support,�working�GDB�is�required�(see�below).<br>
43-�For�running�regression�tests,�GNU�sed,�grep,�awk,�diff�are�required.<br>
44��This�can�be�quickly�achieved�on�Solaris�by�prepending�/usr/gnu/bin�to�PATH.<br>
45<br>
46<br>
47Compilation<br>
48-----------<br>
49Please�follow�the�generic�instructions�in�the�README�file.<br>
50<br>
51The�configure�script�detects�a�canonical�host�to�determine�which�version�of<br>
52Valgrind�should�be�built.�If�the�system�compiler�by�default�produces�32-bit<br>
53binaries�then�only�a�32-bit�version�of�Valgrind�will�be�built.�To�enable<br>
54compilation�of�both�64-bit�and�32-bit�versions�on�such�a�system,�issue�the<br>
55configure�script�as�follows:<br>
56./configure�CC='gcc�-m64'�CXX='g++�-m64'<br>
57<br>
58<br>
59Oracle�Solaris�and�illumos�support<br>
60----------------------------------<br>
61One�of�the�main�goal�of�this�port�is�to�support�both�Oracle�Solaris�and<br>
62illumos�kernels.�This�is�a�very�hard�task�because�Solaris�kernel�traditionally<br>
63does�not�provide�a�stable�syscall�interface�and�because�Valgrind�contains<br>
64several�parts�that�are�closely�tied�to�the�underlying�kernel.�For�these<br>
65reasons,�the�port�needs�to�detect�which�syscall�interfaces�are�present.�This<br>
66detection�cannot�be�done�easily�at�run�time�and�is�currently�implemented�as<br>
67a�set�of�configure�tests.�This�means�that�a�binary�version�of�this�port�can�be<br>
68executed�only�on�a�kernel�that�is�compatible�with�a�kernel�that�was�used<br>
69during�the�configure�and�compilation�time.<br>
70<br>
71Main�currently-known�incompatibilities:<br>
72-�Solaris�11�(released�in�November�2011)�removed�a�large�set�of�syscalls�where<br>
73��*at�variant�of�the�syscall�was�also�present,�for�example,�open()�versus<br>
74��openat(AT_FDCWD)�[1]<br>
75-�syscall�number�for�unlinkat()�is�76�on�Solaris�11,�but�65�on�illumos�[2]<br>
76-�illumos�(in�April�2013)�changed�interface�of�the�accept()�and�pipe()<br>
77��syscalls�[3]<br>
78-�posix_spawn()�functionality�is�backed�up�by�true�spawn()�syscall�on�Solaris�12<br>
79��whereas�illumos�and�Solaris�11�leverage�vfork()<br>
80-�illumos�and�older�Solaris�use�utimesys()�syscall�whereas�newer�Solaris<br>
81��uses�utimensat()<br>
82<br>
83[1]�http://docs.oracle.com/cd/E26502_01/html/E28556/gkzlf.html#gkzip<br>
84[2]�https://www.illumos.org/issues/521<br>
85[3]�https://github.com/illumos/illumos-gate/commit/5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e<br>
86<br>
87<br>
88Limitations<br>
89-----------<br>
90-�The�port�is�Work-In-Progress,�many�things�may�not�work�or�they�can�be�subtly<br>
91��broken.<br>
92-�Coredumps�produced�by�Valgrind�do�not�contain�all�information�available,<br>
93��especially�microstate�accounting�and�processor�bindings.<br>
94-�Accessing�contents�of�/proc/self/psinfo�is�not�thread-safe.��That�is�because<br>
95��Valgrind�emulates�this�file�on�behalf�of�the�client�programs.��Entire<br>
96��open()�-�read()�-�close()�sequence�on�this�file�needs�to�be�performed<br>
97��atomically.<br>
98-�Fork�limitations:�vfork()�is�translated�to�fork(),�forkall()�is�not<br>
99��supported.<br>
100-�Valgrind�does�not�track�definedness�of�some�eflags�(OF,�SF,�ZF,�AF,�CF,�PF)<br>
101��individually�for�each�flag.�After�a�syscall�is�finished,�when�a�carry�flag<br>
102��is�set�and�defined,�all�other�mentioned�flags�will�be�also�defined�even<br>
103��though�they�might�be�undefined�before�making�the�syscall.<br>
104-�System�call�"execve"�with�a�file�descriptor�which�points�to�a�hardlink<br>
105��is�currently�not�supported.�That�is�because�from�the�opened�file�descriptor<br>
106��itself�it�is�not�possible�to�reverse�map�the�intended�pathname.<br>
107��Examples�are�fexecve(3C)�and�isaexec(3C).<br>
108-�Program�headers�PT_SUNW_SYSSTAT�and�PT_SUNW_SYSSTAT_ZONE�are�not�supported.<br>
109��That�is,�programs�linked�with�mapfile�directive�RESERVE_SEGMENT�and�attribute<br>
110��TYPE�equal�to�SYSSTAT�or�SYSSTAT_ZONE�will�cause�Valgrind�exit.�It�is�not<br>
111��possible�for�Valgrind�to�arrange�mapping�of�a�kernel�shared�page�at�the<br>
112��address�specified�in�the�mapfile�for�the�guest�application.�There�is�currently<br>
113��no�such�mechanism�in�Solaris.�Hacky�workarounds�are�possible,�though.<br>
114-�When�a�thread�has�no�stack�then�all�system�calls�will�result�in�Valgrind<br>
115��crash,�even�though�such�system�calls�use�just�parameters�passed�in�registers.<br>
116��This�should�happen�only�in�pathological�situations�when�a�thread�is�created<br>
117��with�custom�mmap'ed�stack�and�this�stack�is�then�unmap'ed�during�thread<br>
118��execution.<br>
119<br>
120<br>
121Remote�debugging�support<br>
122------------------------<br>
123Solaris�port�of�GDB�has�a�major�flaw�which�prevents�remote�debugging�from<br>
124working�correctly.�Fortunately�this�flaw�has�an�easy�fix�[4].�Unfortunately<br>
125it�is�not�present�in�the�current�GDB�7.6.2.�This�boils�down�to�several<br>
126options:<br>
127-�Use�GDB�shipped�with�Solaris�11.2�which�has�this�flaw�fixed.<br>
128-�Wait�until�GDB�7.7�becomes�available�(there�won't�be�other�7.6.x�releases).<br>
129-�Build�GDB�7.6.2�with�the�fix�by�yourself�using�the�following�steps:<br>
130����#�pkg�install�developer/gnu-binutils<br>
131����$�wget�http://ftp.gnu.org/gnu/gdb/gdb-7.6.2.tar.gz<br>
132����$�gzip�-dc�gdb-7.6.2.tar.gz�|�tar�xf�-<br>
133����$�cd�gdb-7.6.2<br>
134����$�patch�-p1�-i�/path/to/valgrind-solaris/solaris/gdb-sol-thread.patch<br>
135����$�export�LIBS="-lncurses"<br>
136����$�export�CC="gcc�-m64"<br>
137����$�./configure�--with-x=no�--with-curses�--with-libexpat-prefix=/usr/lib<br>
138����$�gmake�&amp;&amp;�gmake�install<br>
139<br>
140[4]�https://sourceware.org/ml/gdb-patches/2013-12/msg00573.html<br>
141<br>
142<br>
143TODO�list<br>
144---------<br>
145-�Fix�few�remaining�failing�tests.<br>
146-�Add�more�Solaris-specific�tests�(especially�for�the�door�and�spawn<br>
147��syscalls).<br>
148-�Provide�better�error�reporting�for�various�subsyscalls.<br>
149-�Implement�storing�of�extra�register�state�in�signal�frame.<br>
150-�Performance�comparison�against�other�platforms.<br>
151-�Prevent�SIGPIPE�when�writing�to�a�socket�(coregrind/m_libcfile.c).<br>
152-�Implement�ticket�locking�for�fair�scheduling�(--fair-sched=yes).<br>
153-�Implement�support�in�DRD�and�Helgrind�tools�for�thr_join()�with�thread�==�0.<br>
154-�Add�support�for�accessing�thread-local�variables�via�gdb�(auxprogs/getoff.c).<br>
155��Requires�research�on�internal�libc�TLS�representation.<br>
156-�VEX�supports�AVX,�BMI�and�AVX2.�Investigate�if�they�can�be�enabled�on<br>
157��Solaris/illumos.<br>
158-�Investigate�support�for�more�flags�in�AT_SUN_AUXFLAGS.<br>
159-�Fix�Valgrind�crash�when�a�thread�has�no�stack�and�syswrap-main.c�accesses<br>
160��all�possible�syscall�parameters.�Enable�helgrind/tests/stackteardown.c<br>
161��to�see�this�in�effect.�Would�require�awareness�of�syscall�parameter�semantics.<br>
162-�Correctly�print�arguments�of�DW_CFA_ORCL_arg_loc�in�show_CF_instruction()�when<br>
163��it�is�implemented�in�libdwarf.<br>
164-�Handle�a�situation�when�guest�program�sets�SC_CANCEL_FLG�in�schedctl�and<br>
165��Valgrind�needs�to�invoke�a�syscall�on�its�own.<br>
166<br>
167<br>
168Contacts<br>
169--------<br>
170Please�send�bug�reports�and�any�questions�about�the�port�to:<br>
171Ivo�Raisr�&lt;ivosh@ivosh.net&gt;<br>
172Petr�Pavlu�&lt;setup@dagobah.cz&gt;<br>
173<br>
174����</p></div>
175</div>
176<div>
177<br><table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer">
178<tr>
179<td rowspan="2" width="40%" align="left">
180<a accesskey="p" href="dist.readme-mips.html">&lt;&lt;�11.�README.mips</a>�</td>
181<td width="20%" align="center"><a accesskey="u" href="dist.html">Up</a></td>
182<td rowspan="2" width="40%" align="right">�<a accesskey="n" href="licenses.html">GNU Licenses�&gt;&gt;</a>
183</td>
184</tr>
185<tr><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td></tr>
186</table>
187</div>
188</body>
189</html>
190