Skip to content

Commit f02e420

Browse files
authored
Merge pull request #496 from cstes/sunupdate
Let's see if something breaks :D
2 parents f632ee2 + 371a270 commit f02e420

File tree

2 files changed

+96
-19
lines changed

2 files changed

+96
-19
lines changed

build.sunos64x64/HowToBuild

Lines changed: 94 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ Contents:
66
- Overview
77
- Audio Headers
88
- OpenSSL
9-
- Real-Time
9+
- Squeak Profile
10+
- Real-Time Class
1011
- Swapspace
1112
- C Compiler
1213
- GNU make
14+
- pkg-config
1315
- IPS package
1416

1517
Overview
1618
--------
1719

1820
These are some notes on building the OpenSmalltalk VM on Oracle Solaris 11.
1921

20-
For some history on this operating system, see
21-
https://en.wikipedia.org/wiki/Solaris_(operating_system)
22-
2322
On Solaris "uname -s" reports the value "SunOS".
2423

2524
To build,
@@ -45,16 +44,26 @@ Audio Headers
4544
The configure script will look for header files (#include) and enable
4645
the build of some sound plugins, depending on what it finds.
4746

48-
Personally I like the "pulse" server supported by the "vm-sound-pulse" plugin.
47+
For example it will check for /usr/include/sys/soundcard.h,
48+
and /usr/include/sys/audio/audio_oss.h.
4949

50-
Make sure that you *uninstall* the audio headers:
50+
You can find out which package installs that header file as follows:
5151

52-
# pkg list -a system/header/header-audio
53-
# pkg list -a library/audio/pulseaudio
52+
# pkg search /usr/include/sys/audio/audio_oss.h
53+
54+
Personally I like the "pulse" server supported by the "vm-sound-pulse" plugin.
55+
56+
In some cases, the audio header files are in a separate package header-audio,
57+
which is not strictly needed because the PulseAudio server is sufficient.
5458

5559
Make sure (before you configure and build) that header-audio is uninstalled,
5660
and that pulseaudio is installed.
5761

62+
You can see whether the audio headers are installed as follows :
63+
64+
# pkg list -a system/header/header-audio
65+
# pkg list -a library/audio/pulseaudio
66+
5867
The header files for pulseaudio are in the pulseaudio package.
5968

6069
OpenSSL
@@ -75,27 +84,86 @@ In order to avoid this problem, we build the VM with the option:
7584

7685
--without-libtls
7786

78-
Real-Time
79-
---------
87+
Squeak Profile
88+
--------------
8089

8190
When running the squeak vm, after copying a Squeak .image and .change file,
8291
and after copying the Squeak Smalltalk source file (SqueakV50.sources).
8392

84-
bash-4.4$ bin/squeak Squeak6.0alpha-19547-32bit.image
93+
$ bin/squeak Squeak6.0alpha-19547-32bit.image
8594
pthread_setschedparam failed: Not owner
95+
...
96+
97+
This indicates that the process does not have the necessary "privilege" to issue a pthread_setschedparam() call.
98+
99+
It is possible to get rid of this warning and run squeak as follows:
100+
101+
$ pfexec squeak Squeak6.0alpha-19547-32bit.image
102+
103+
without warning. This is a Solaris pfexec "execute squeak in a profile".
104+
105+
To do this, add a profile "Squeak" (or modify the "Basic Solaris User" profile):
106+
107+
# profiles -p Squeak
108+
profiles:Squeak> set desc="Allow Squeak VM to Set Priority"
109+
profiles:Squeak> add cmd=/usr/bin/squeak
110+
profiles:Squeak:squeak> set privs=proc_priocntl
111+
profiles:Squeak:squeak> end
112+
profiles:Squeak> commit
113+
profiles:Squeak> info
114+
name=Squeak
115+
desc=Allow Squeak VM to Set Priority
116+
cmd=/usr/bin/squeak
117+
profiles:Squeak> exit
118+
119+
The above commands adds the following entries to /etc/security :
120+
121+
# tail /etc/security/exec_attr
122+
Squeak:solaris:cmd:::/usr/bin/squeak:privs=proc_priocntl
86123

87-
Note that it is possible to suppress the "pthread_setschedparam" warning,
124+
# tail /etc/security/prof_attr
125+
Squeak:::Allow Squeak VM to Set Priority:
126+
127+
Once the profile is created, you can assign the profile to a user:
128+
129+
$ cp /etc/user_attr /etc/user_attr.backup
130+
$ usermod -P Squeak someuser
131+
132+
This changes the file /etc/user_attr; you can also edit /etc/user_attr.
133+
134+
The user can verify that the profile is available:
135+
136+
$ userattr profiles
137+
Squeak,System Administrator
138+
139+
Finally the following two pfexec usages both (!) require the Squeak profile to exist. So the second form with -P proc_priocntl as argument to pfexec only works if proc_priocntl is in the "intersection of the available profiles and proc_prioctnl". So it's not enough to simply pfexec -P proc_prioctnl the squeak vm, it is necessary that the root user assigns the Squeak profile to the user.
140+
141+
$ pfexec squeak Cuis5.0-4112.image
142+
143+
$ pfexec -P proc_priocntl squeak Cuis5.0-4112.image
144+
145+
Verify as follows the squeak threads (LWP light-weight processes)
146+
147+
$ ps -eLo pid,pri,lwp,class,comm | grep squeak
148+
3849 44 1 IA /usr/lib/squeak/5.0-202004221445-sunos/squeak
149+
3849 49 2 IA /usr/lib/squeak/5.0-202004221445-sunos/squeak
150+
3849 49 3 IA /usr/lib/squeak/5.0-202004221445-sunos/squeak
151+
3849 50 4 IA /usr/lib/squeak/5.0-202004221445-sunos/squeak
152+
153+
Note that there are 4 threads (LWP) and they are in the schedule class IA;
154+
the last thread is running at priority 50 (the others at 49).
155+
156+
Real-Time Class
157+
---------------
158+
159+
Note that it is also possible to suppress the "pthread_setschedparam" warning,
88160
by running the squeak vm in the RT (real-time) class.
89161

90162
One way would be to use priocntl -e and execute the squeak in the -c RT class.
91163

92-
Or perhaps at the "authorization" (auths) level it could perhaps
93-
be possible to have an entry in /etc/security/exec_attr.d for
94-
an authorization that gives "proc_priocntl" to squeak.
95-
96164
You must do this as "root".
97165

98-
Another way is to change a "bash" shell to RT class,
166+
You can change a "bash" shell to RT class,
99167

100168
bash-4.4$ priocntl -d $$
101169
INTERACTIVE CLASS PROCESSES:
@@ -171,6 +239,15 @@ GNU Make
171239

172240
For the Makefiles, pkg:/developer/build/gnu-make must be installed.
173241

242+
pkg-config
243+
----------
244+
245+
The configure script uses the pkg-config tool for some plugins.
246+
247+
Be sure to install it:
248+
249+
pkg install developer/build/pkg-config
250+
174251
IPS Package
175252
-----------
176253

platforms/unix/plugins/SqueakSSL/openssl_overlay.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
#define sqo_SSL_library_init SSL_library_init
165165
#define sqo_SSL_load_error_strings SSL_load_error_strings
166166

167-
#define sk_GENERAL_NAME_freefunc void(*)(void*)
167+
#define sk_GENERAL_NAME_freefunc void(*)(GENERAL_NAME*)
168168

169169
#endif
170170

@@ -188,7 +188,7 @@
188188

189189
#if OPENSSL_VERSION_NUMBER < 0x10100000L
190190
# define OPENSSL_STACK _STACK
191-
# define sk_GENERAL_NAME_freefunc void(*)(void*)
191+
# define sk_GENERAL_NAME_freefunc void(*)(GENERAL_NAME*)
192192
# define OPENSSL_INIT_SETTINGS struct ossl_init_settings_st
193193
OPENSSL_INIT_SETTINGS;
194194

0 commit comments

Comments
 (0)