Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a workaround to use AK on Ubuntu-18.04 due to "gettid" #25527

Open
mingodad opened this issue Dec 2, 2024 · 7 comments
Open

Need a workaround to use AK on Ubuntu-18.04 due to "gettid" #25527

mingodad opened this issue Dec 2, 2024 · 7 comments

Comments

@mingodad
Copy link

mingodad commented Dec 2, 2024

To build on Ubuntu-18.04 I need to add this:

-------------------- bootstrap/stage0/runtime/AK/Format.cpp --------------------
index 43b125cb..58ac662a 100644
@@ -34,6 +34,11 @@
 #    include <AK/StringFloatingPointConversions.h>
 #endif
 
+#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 30
+#include <sys/syscall.h>
+#define gettid() syscall(SYS_gettid)
+#endif
+
 namespace AK {
 
 namespace {
@nico
Copy link
Contributor

nico commented Dec 2, 2024

Does adding a

#    include <unistd.h>

after the <time.h> include help too?

@alimpfard
Copy link
Member

@nico gettid was added in glibc 2.30: https://www.man7.org/linux/man-pages/man2/gettid.2.html

HISTORY
Linux 2.4.11, glibc 2.30.

@nico
Copy link
Contributor

nico commented Dec 2, 2024

Oh, Ubuntu-18.04 is ancient 😅

Up to you how far back you want to go with jakt support, I suppose :)

@alimpfard
Copy link
Member

I don't really mind supporting older systems in jakt, but AK has to support them too.

@nico
Copy link
Contributor

nico commented Dec 2, 2024

Understood. If it's just those 5 lines, that seems alright. If it's considerably more messy, maybe it isn't.

@LucasChollet
Copy link
Member

Ubuntu 18.04 is quite old indeed. It reached EOL more than one year ago (May 2023).
Isn't there a way for you to upgrade @mingodad ?

@mingodad
Copy link
Author

mingodad commented Dec 3, 2024

Hello @LucasChollet I have several programs and development tools that do not make it easy for me to upgrade right now and it's working so far for my use cases the needed fix doesn't seem too complicated or have undesired side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants