Skip to content

Commit

Permalink
[WIP] Ports: Update bdwgc
Browse files Browse the repository at this point in the history
With the exception of a tweak in gctest all patches were upstreamed.
See: ivmai/bdwgc#685
  • Loading branch information
linusg committed Dec 13, 2024
1 parent 056cba3 commit 7388ec3
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 442 deletions.
7 changes: 3 additions & 4 deletions Ports/bdwgc/package.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/usr/bin/env -S bash ../.port_include.sh
port='bdwgc'
version='8.2.8'
use_fresh_config_sub='true'
version='437c08c24537cde1fd54795782f94a575ce5ca87'
files=(
"https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz#7649020621cb26325e1fb5c8742590d92fb48ce5c259b502faf7d9fb5dabb160"
"https://github.com/ivmai/bdwgc/archive/${version}.tar.gz#3d0794582a956ad009817f4bcd894bea4007d43d1583a7121491fadee572b48a"
)
depends=(
'libatomic_ops'
)
workdir="gc-${version}"
workdir="bdwgc-${version}"
useconfigure='true'
configopts=(
'--enable-threads=posix'
Expand Down

This file was deleted.

32 changes: 32 additions & 0 deletions Ports/bdwgc/patches/0001-gctest-Set-NTHREADS-to-0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Linus Groh <[email protected]>
Date: Fri, 13 Dec 2024 19:22:08 +0000
Subject: [PATCH] gctest: Set NTHREADS to 0

It crashes otherwise:

```
0x000000078c79c017: [/usr/lib/libsystem.so] syscall1 +0x7 (syscall.cpp:20 => syscall.cpp:19)
0x00000012967e283d: [/usr/lib/libc.so] pthread_mutex_lock.localalias +0x6d (serenity.h:43 => pthread_integration.cpp:158)
0x0000000143bf0344: [/home/anon/gctest] GC_thread_is_registered +0x74 (pthread_support.c:911)
0x0000000143bdb46f: [/home/anon/gctest] run_one_test +0x1f (gctest.c:1576)
0x0000000143bd8e5d: [/home/anon/gctest] main +0x1ed (gctest.c:2731)
0x0000000143bd9854: [/home/anon/gctest] _entry +0x24 (crt0.cpp:47)
```
---
tests/gctest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gctest.c b/tests/gctest.c
index 2965407e25bf6d4db75ff8711635d02c771673c3..e6cc8d7375788cacf4ab78f38ca574c719a24b58 100644
--- a/tests/gctest.c
+++ b/tests/gctest.c
@@ -50,7 +50,7 @@
#ifndef NTHREADS
/* This excludes the main thread, which also runs a test. */
/* In the single-threaded case, a number of times to rerun it. */
-# define NTHREADS 5
+# define NTHREADS 0
#endif

#if defined(_WIN32_WCE) && !defined(__GNUC__)
22 changes: 0 additions & 22 deletions Ports/bdwgc/patches/0002-Error-on-unknown-arch.patch

This file was deleted.

64 changes: 0 additions & 64 deletions Ports/bdwgc/patches/0003-Teach-dyn_load.c-about-serenity.patch

This file was deleted.

63 changes: 0 additions & 63 deletions Ports/bdwgc/patches/0004-Teach-bdwgc-about-serenity-signals.patch

This file was deleted.

Loading

2 comments on commit 7388ec3

@ivmai
Copy link

@ivmai ivmai commented on 7388ec3 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the exception of a tweak in gctest all patches were upstreamed.

The 2nd exception is cmake script, I have not modified it to disable forking.

@ivmai
Copy link

@ivmai ivmai commented on 7388ec3 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest not to merge this patch, at least because of the fact it is based on upstream master, not a stable branch.
I plan to backport these patches from upstream master to upstream release-8_2 branch till NY, and then you could use it in serenity ports.

Please sign in to comment.