[PATCH] setup.py: support Ubuntu 21.10

5 views
Skip to first unread message

Waldemar Kozaczuk

unread,
Jan 3, 2022, 10:18:39 PM1/3/22
to osv...@googlegroups.com, Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>
---
scripts/setup.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/setup.py b/scripts/setup.py
index 43b1b0a6..8cb7ca78 100755
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -272,6 +272,13 @@ class Ubuntu(object):
test_packages = ['libssl-dev', 'zip']
ec2_post_install = None

+ class Ubuntu_21_10(object):
+ packages = ['bridge-utils', 'libvirt-daemon-system', 'libvirt-clients', 'python3-dpkt']
+ ec2_packages = ['ec2-api-tools', 'awscli']
+ test_packages = []
+ ec2_post_install = None
+ version = '21.10'
+
class Ubuntu_21_04(object):
packages = ['bridge-utils', 'libvirt-daemon-system', 'libvirt-clients', 'python3-dpkt']
ec2_packages = ['ec2-api-tools', 'awscli']
@@ -335,7 +342,7 @@ class Ubuntu(object):
ec2_post_install = None
version = '16.04'

- versions = [Ubuntu_21_04, Ubuntu_20_10, Ubuntu_20_04, Ubuntu_19_10, Ubuntu_19_04, Ubuntu_18_10, Ubuntu_18_04, Ubuntu_17_04, Ubuntu_16_04]
+ versions = [Ubuntu_21_10, Ubuntu_21_04, Ubuntu_20_10, Ubuntu_20_04, Ubuntu_19_10, Ubuntu_19_04, Ubuntu_18_10, Ubuntu_18_04, Ubuntu_17_04, Ubuntu_16_04]

class LinuxMint(Ubuntu):
name = 'LinuxMint'
--
2.32.0

Waldemar Kozaczuk

unread,
Jan 3, 2022, 10:18:43 PM1/3/22
to osv...@googlegroups.com, Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>
---
exported_symbols/osv_libc.so.6.symbols | 1 +
libc/aliases.ld | 1 +
2 files changed, 2 insertions(+)

diff --git a/exported_symbols/osv_libc.so.6.symbols b/exported_symbols/osv_libc.so.6.symbols
index 1854f6a8..8b6c8af4 100644
--- a/exported_symbols/osv_libc.so.6.symbols
+++ b/exported_symbols/osv_libc.so.6.symbols
@@ -887,6 +887,7 @@ symlink
sync
syscall
sysconf
+__sysconf
sysctl
sys_errlist
sysinfo
diff --git a/libc/aliases.ld b/libc/aliases.ld
index 8c54f1f4..5f3fc744 100644
--- a/libc/aliases.ld
+++ b/libc/aliases.ld
@@ -75,3 +75,4 @@ _exit = exit;
_Exit = exit;

__dn_expand = dn_expand;
+__sysconf = sysconf;
--
2.32.0

Waldemar Kozaczuk

unread,
Jan 3, 2022, 10:18:43 PM1/3/22
to osv...@googlegroups.com, Waldemar Kozaczuk
New java 11 on latest Ubuntu calls sysconf to get value
of _SC_THREAD_STACK_MIN parameter to inquire about minimal
stack size and crashes when gets -1 from OSv. This patch
makes sysconf() return the same value Linux returns.

Similarly one of the libraries libtsm.so used by cli
needs value of _SC_LINE_MAX and this patch makes sysconf
handle this parameter as well.

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>
---
runtime.cc | 2 ++
1 file changed, 2 insertions(+)

diff --git a/runtime.cc b/runtime.cc
index 64a9b225..10c72cca 100644
--- a/runtime.cc
+++ b/runtime.cc
@@ -362,6 +362,8 @@ long sysconf(int name)
switch (name) {
case _SC_CLK_TCK: return CLOCKS_PER_SEC;
case _SC_PAGESIZE: return mmu::page_size;
+ case _SC_THREAD_STACK_MIN: return 16384;
+ case _SC_LINE_MAX: return 2048;
case _SC_THREAD_PROCESS_SHARED: return true;
case _SC_NPROCESSORS_ONLN: return sched::cpus.size();
case _SC_NPROCESSORS_CONF: return sched::cpus.size();
--
2.32.0

Waldemar Kozaczuk

unread,
Jan 3, 2022, 10:18:45 PM1/3/22
to osv...@googlegroups.com, Waldemar Kozaczuk
New version of libtsm.so used by cli app needs tfind() and
tsearch() symbols and this patch modifies the Makefile to add their
musl implementations.

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>
---
Makefile | 3 +++
exported_symbols/osv_ld-musl.so.1.symbols | 2 ++
exported_symbols/osv_libc.so.6.symbols | 2 ++
3 files changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index 597854d6..a0878787 100644
--- a/Makefile
+++ b/Makefile
@@ -1455,6 +1455,9 @@ libc += arch/$(arch)/ucontext/ucontext.o
libc += string/memmove.o
endif

+musl += search/tfind.o
+musl += search/tsearch.o
+
musl += stdio/__fclose_ca.o
libc += stdio/__fdopen.o
$(out)/libc/stdio/__fdopen.o: CFLAGS += --include libc/syscall_to_function.h
diff --git a/exported_symbols/osv_ld-musl.so.1.symbols b/exported_symbols/osv_ld-musl.so.1.symbols
index 3c2c5f53..f1c61a3f 100644
--- a/exported_symbols/osv_ld-musl.so.1.symbols
+++ b/exported_symbols/osv_ld-musl.so.1.symbols
@@ -1104,6 +1104,7 @@ tcsetpgrp
telldir
tempnam
textdomain
+tfind
tgamma
tgammaf
tgammal
@@ -1140,6 +1141,7 @@ truncate
truncate64
truncf
truncl
+tsearch
ttyname
ttyname_r
__tzname
diff --git a/exported_symbols/osv_libc.so.6.symbols b/exported_symbols/osv_libc.so.6.symbols
index 8b6c8af4..39e79692 100644
--- a/exported_symbols/osv_libc.so.6.symbols
+++ b/exported_symbols/osv_libc.so.6.symbols
@@ -906,6 +906,7 @@ tcsetpgrp
telldir
tempnam
textdomain
+tfind
time
timegm
timerfd_create
@@ -936,6 +937,7 @@ __towupper_l
towupper_l
truncate
truncate64
+tsearch
ttyname
ttyname_r
__tzname
--
2.32.0

Commit Bot

unread,
Jan 4, 2022, 10:06:31 AM1/4/22
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

setup.py: support Ubuntu 21.10

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/scripts/setup.py b/scripts/setup.py
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -272,6 +272,13 @@ class Ubuntu(object):
test_packages = ['libssl-dev', 'zip']
ec2_post_install = None

+ class Ubuntu_21_10(object):
+ packages = ['bridge-utils', 'libvirt-daemon-system', 'libvirt-clients', 'python3-dpkt']
+ ec2_packages = ['ec2-api-tools', 'awscli']
+ test_packages = []
+ ec2_post_install = None
+ version = '21.10'
+
class Ubuntu_21_04(object):
packages = ['bridge-utils', 'libvirt-daemon-system', 'libvirt-clients', 'python3-dpkt']
ec2_packages = ['ec2-api-tools', 'awscli']
@@ -335,7 +342,7 @@ class Ubuntu_16_04(object):

Commit Bot

unread,
Jan 4, 2022, 10:06:32 AM1/4/22
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

libc: add __sysconf alias

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/exported_symbols/osv_libc.so.6.symbols b/exported_symbols/osv_libc.so.6.symbols
--- a/exported_symbols/osv_libc.so.6.symbols
+++ b/exported_symbols/osv_libc.so.6.symbols
@@ -887,6 +887,7 @@ symlink
sync
syscall
sysconf
+__sysconf
sysctl
sys_errlist
sysinfo
diff --git a/libc/aliases.ld b/libc/aliases.ld

Commit Bot

unread,
Jan 4, 2022, 10:06:34 AM1/4/22
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

sysconf: support _SC_THREAD_STACK_MIN and _SC_LINE_MAX

New java 11 on latest Ubuntu calls sysconf to get value
of _SC_THREAD_STACK_MIN parameter to inquire about minimal
stack size and crashes when gets -1 from OSv. This patch
makes sysconf() return the same value Linux returns.

Similarly one of the libraries libtsm.so used by cli
needs value of _SC_LINE_MAX and this patch makes sysconf
handle this parameter as well.

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/runtime.cc b/runtime.cc

Commit Bot

unread,
Jan 4, 2022, 10:06:35 AM1/4/22
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

musl: add tfind and tsearch

New version of libtsm.so used by cli app needs tfind() and
tsearch() symbols and this patch modifies the Makefile to add their
musl implementations.

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1455,6 +1455,9 @@ libc += arch/$(arch)/ucontext/ucontext.o
libc += string/memmove.o
endif

+musl += search/tfind.o
+musl += search/tsearch.o
+
musl += stdio/__fclose_ca.o
libc += stdio/__fdopen.o
$(out)/libc/stdio/__fdopen.o: CFLAGS += --include libc/syscall_to_function.h
diff --git a/exported_symbols/osv_ld-musl.so.1.symbols b/exported_symbols/osv_ld-musl.so.1.symbols
--- a/exported_symbols/osv_ld-musl.so.1.symbols
+++ b/exported_symbols/osv_ld-musl.so.1.symbols
@@ -1104,6 +1104,7 @@ tcsetpgrp
telldir
tempnam
textdomain
+tfind
tgamma
tgammaf
tgammal
@@ -1140,6 +1141,7 @@ truncate
truncate64
truncf
truncl
+tsearch
ttyname
ttyname_r
__tzname
diff --git a/exported_symbols/osv_libc.so.6.symbols b/exported_symbols/osv_libc.so.6.symbols
--- a/exported_symbols/osv_libc.so.6.symbols
+++ b/exported_symbols/osv_libc.so.6.symbols
Reply all
Reply to author
Forward
0 new messages