Gentoo Archives: gentoo-alt

From: "C. Bergström" <cbergstrom@×××××××××.com>
To: Mike Frysinger <vapier@g.o>
Cc: gentoo-alt@l.g.o, sandbox@g.o
Subject: Re: [gentoo-alt] Any interest in sandbox on (open)solaris?
Date: Tue, 18 Nov 2008 23:37:56
Message-Id: 4923507D.5030305@netsyncro.com
In Reply to: Re: [gentoo-alt] Any interest in sandbox on (open)solaris? by Mike Frysinger
1 Mike Frysinger wrote:
2 > On Tuesday 18 November 2008 17:33:55 C. Bergström wrote:
3 >
4 >> Fabian Groffen wrote:
5 >>
6 >>> On 18-11-2008 20:48:58 +0100, "C. Bergström" wrote:
7 >>>
8 >>>> If anyone is interested in sandbox working correctly on (open)solaris
9 >>>> please give both feedback and any technical details which may help. I'm
10 >>>> looking into how LD_PRELOAD works and any difference between
11 >>>> linux/solaris. I tried to compile the alpha version, but didn't read
12 >>>> the code at all.
13 >>>>
14 >>> Yes, very interesting in having it running. Please look at the current
15 >>> git sources, which had a recent spike of activity:
16 >>> http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=summary
17 >>>
18 >> Ok. I pulled the latest git work and with a few really dirty hacks to
19 >> the configure it was rolling..
20 >>
21 >> (Here's some of the output of the failure.. I haven't looked at it at all)
22 >> http://rafb.net/p/fELaK960.html
23 >>
24 >
25 > very first rule if you want to make this work: never post log files to an
26 > external site, especially one like rafb.net where things expire quickly.
27 >
28 > you're hitting an issue with what i hinted at earlier ... symbol versioning.
29 > iirc, the symbol version script (for our purposes) should be the same between
30 > the GNU linker and the Solaris linker. but how you tell the linker about the
31 > version script obviously wont be the same. you'll have to figure that out and
32 > we can add a configure test to detect the linker in use.
33 >
34 > all those warnings are kind of painful too ... probably have to find a
35 > autoconf macro for detecting attribute support in the compiler. iirc, glibc
36 > tends to use __GNUC__ type CPP macros though.
37 >
38 > the memory (xmalloc, etc...) arent too surprising. that's a bit of a mess atm
39 > and i intend to clean that stuff up anyways ...
40 >
41 > the symbols.h errors are odd. probably a CPP difference between your compiler
42 > and the GNU C compiler.
43 >
44 > you should figure out how solaris forces C++ exception handling. clearly it
45 > doesnt use the same flag as GCC: -fexceptions. that'll have to be turned into
46 > a configure compiler test as well.
47 >
48 > g'luck ... seems you got your work cut out for you :p
49 >
50 Aww.. not even a little optimism? :P
51
52 I could cheat and use cw which converts gcc flags over to sun cc flags
53 and vice versa, but that's cheating..
54
55 Down to the nitty gritty to get this to build.. Which is goal #1 to just
56 get the thing to build..
57
58 For "the symbols.h errors are odd. probably a CPP difference between
59 your compiler and the GNU C compiler." did you mean
60
61 "../libsbutil/sbutil.h", line 102: warning: attribute parameter "__printf__" is undefined
62
63 that's just a warning, but yeah. I can guess what's needed to make it go
64 away..
65 ------
66
67 Undefined symbols..
68
69 __check_arg_fd ../libsbutil/.libs/libsbutil.a(dynbuf.o)
70 __check_arg_ptr ../libsbutil/.libs/libsbutil.a(string.o)
71 __check_arg_str ../libsbutil/.libs/libsbutil.a(string.o)
72
73 check_strv ../libsbutil/.libs/libsbutil.a(file.o)
74 check_ptr
75 ../libsbutil/.libs/libsbutil.a(sb_open.o)
76
77 __xrealloc sandbox-environ.o
78 __xstrndup sandbox-environ.o
79 check_str sandbox-environ.o
80 __xcalloc sandbox-environ.o
81 __xmalloc sandbox-environ.o
82
83
84 cc options used to build
85
86 cc -DHAVE_CONFIG_H -I. -I.. -I.. -I./include "-DETCDIR=\"/usr/etc\""
87 "-DLIBSANDBOX_PATH=\"/usr/lib/amd64\""
88 "-DSANDBOX_BASHRC_PATH=\"/usr/share/sandbox\"" -DPIC -fPIC -D_GNU_SOURCE
89 -D_REENTRANT -i -xO4 -xspace -xstrconst -fast -xregs=no%frameptr -m64
90 -KPIC -c src/string.c -KPIC -DPIC -o .libs/string.o
91
92 cc -DHAVE_CONFIG_H -I. -I.. -I.. -I./include "-DETCDIR=\"/usr/etc\""
93 "-DLIBSANDBOX_PATH=\"/usr/lib/amd64\""
94 "-DSANDBOX_BASHRC_PATH=\"/usr/share/sandbox\"" -DPIC -fPIC -D_GNU_SOURCE
95 -D_REENTRANT -i -xO4 -xspace -xstrconst -fast -xregs=no%frameptr -m64
96 -KPIC -c src/dynbuf.c -KPIC -DPIC -o .libs/dynbuf.o
97
98 cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libsbutil -I../libsbutil/include
99 -DPIC -fPIC -D_GNU_SOURCE -D_REENTRANT -DOUTSIDE_LIBSANDBOX -i -xO4
100 -xspace -xstrconst -fast -xregs=no%frameptr -m64 -KPIC -c -o
101 sandbox-environ.o environ.c
102 --
103
104 processed output to see what's really happening.. (Here's the fun part
105 to play guess what makes sun cc happy :P ) I'll see if I can figure
106 this out tomorrow/soon.. I'll have to consult the CC manual for the
107 -fexception equivalent..
108
109 CC manual for the curious..
110 http://docs.sun.com/source/820-4180/man1/CC.1.html
111
112 cc manual
113 http://docs.sun.com/source/820-4180/man1/cc.1.html
114
115 --------------
116
117 I'm past my productive hour, but for anyone who wants to play what makes
118 sun cc unhappy.. here's the offending lines of code
119
120 7284 inline _Bool __check_arg_fd (int fd, const char *file, const char
121 *func, size_t line);
122
123 7962 if (! __check_arg_fd ( fd , "src/dynbuf.c" , __func__ , 182 ))
124 8113 if (! __check_arg_fd ( fd , "src/dynbuf.c" , __func__ , 333 ))
125 --
126
127 7278 inline _Bool __check_arg_ptr (const void *ptr, const char *file,
128 const char *func, size_t line);
129
130 7825 if (! __check_arg_ptr ( str , "src/string.c" , __func__ , 45 ))
131
132 --
133 7280 inline _Bool __check_arg_str (const char *str, const char *file,
134 const char *func, size_t line);
135
136 7800 if ((! __check_arg_str ( pathname1 , "src/string.c" , __func__ ,
137 20 )) || (! __check_arg_str ( pathname2 , "src/string.c " , __func__
138 , 20 )))
139 7846 if (! __check_arg_str ( path , "src/string.c" , __func__ , 66 ))
140 ----
141
142 7308 inline void *__xrealloc (void *ptr, size_t size, const char *file,
143 const char *func, size_t line);
144 7313 inline char *__xstrndup (const char *str, size_t size, const char
145 *file, const char *func, size_t line);
146 7280 inline _Bool check_str (const char *str);
147
148
149
150 8103 do { char * * _tmp_p ; int _i = 0 ; if ( ! check_str (
151 tmp_string ) ) { goto error ; } while ( ( 0L != ( * envp ) ) && (
152 0L != ( * envp ) [ _i ] ) ) { _i ++ ; } _tmp_p = __xrealloc ( ( * envp )
153 , sizeof ( char * ) * ( _i + 2 ) , "envir on.c" , __func__ , 235 ) ;
154 if ( 0L == _tmp_p ) { goto error ; } ( * envp ) = _tmp_p ; ( * envp ) [
155 _i ] = tmp_string ; ( * envp ) [ _i + 1 ] = 0L ; } while ( 0 );
156
157 8205 do { char * _tmp_str ; char * * _tmp_p ;
158 int _i = 0 ; if ( ! check_str ( ( * env_ptr ) ) ) { goto error ; }
159 while ( ( 0L != new_environ ) && ( 0L != new_environ [ _i ] ) ) { _i ++
160 ; } _tmp_p = __xrealloc ( new_environ , sizeof ( char * ) * ( _i +
161 2 ) , "environ.c" , __func__ , 342 ) ; if ( 0L == _tmp_p ) { goto error
162 ; } new_environ = _tmp _p ; _tmp_str = __xstrndup ( ( * env_ptr ) ,
163 strlen ( ( * env_ptr ) ) , "environ.c" , __func__ , 342 ) ; if ( 0L ==
164 _tmp_s tr ) { goto error ; } new_environ [ _i ] = _tmp_str ;
165 new_environ [ _i + 1 ] = 0L ; } while ( 0 );
166
167 ------------
168
169 7304 inline void *__xcalloc (size_t nmemb, size_t size, const char
170 *file, const char *func, size_t line);
171 8144 ld_preload_envvar = __xcalloc ( strlen (
172 orig_ld_preload_envvar ) + strlen ( sandbox_info -> sandbox_lib ) +
173 2 , sizeof ( char ) , "environ.c" , __func__ , 276 ) ;
174 ---------
175
176 7306 inline void *__xmalloc (size_t size, const char *file, const char
177 *func, size_t line);
178 8096 tmp_string = __xmalloc ( ( strlen ( name ) + strlen ( val
179 ) + 2 ) * sizeof ( char ) , "environ.c" , __func__ , 22 8 );

Replies

Subject Author
Re: [gentoo-alt] Any interest in sandbox on (open)solaris? Mike Frysinger <vapier@g.o>