Skip to content

Commit

Permalink
Ports/bdwgc: Build using automake
Browse files Browse the repository at this point in the history
This provides the necessary pkg-config files for other automake ports
that depend on it.
  • Loading branch information
petelliott authored and awesomekling committed May 22, 2022
1 parent bccf0a9 commit 8a007e7
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 32 deletions.
18 changes: 4 additions & 14 deletions Ports/bdwgc/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,8 @@ depends=(libatomic_ops)
workdir=gc-$version
auth_type=sha256

build() {
cd $workdir
mkdir build || true
cd build
cmake .. \
-Denable_threads=ON \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY="$DESTDIR/usr/local/bin" \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="$DESTDIR/usr/local/lib"
cmake --build .
}

install() {
cd ..
cp -r include "$DESTDIR/usr/local/include/gc"
useconfigure=true
configopts=("--enable-threads=posix")
pre_configure() {
run ./autogen.sh
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1e6a332dc87920d79eca1b1ddb66033c7f369d38 Mon Sep 17 00:00:00 2001
From a866ef2debf6c1639d14e6990be440614dce9a56 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <[email protected]>
Date: Thu, 24 Feb 2022 01:00:57 +0330
Subject: [PATCH 1/6] Teach os_dep and gcconfig.h about serenity
Subject: [PATCH 1/7] Teach os_dep and gcconfig.h about serenity

---
include/private/gcconfig.h | 48 +++++++++++++++++++++++++++++++++++---
Expand Down Expand Up @@ -211,5 +211,5 @@ index b183423..a6d62b9 100644
# elif defined(LINUX)
# define CODE_OK TRUE
--
2.35.1
2.36.1

6 changes: 3 additions & 3 deletions Ports/bdwgc/patches/0002-Error-on-unknown-arch.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 044ec10fa839e67da2adb0990a60d5a02de205a8 Mon Sep 17 00:00:00 2001
From ae7f99f75b0957d62364a19e9a75e74e2ef9bd8d Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <[email protected]>
Date: Thu, 24 Feb 2022 01:50:40 +0330
Subject: [PATCH 2/6] Error on unknown arch
Subject: [PATCH 2/7] Error on unknown arch

---
include/private/gcconfig.h | 2 ++
Expand All @@ -21,5 +21,5 @@ index e9d1d42..8e48b66 100644
#endif
# if defined(__HAIKU__) && (defined(__amd64__) || defined(__x86_64__))
--
2.35.1
2.36.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a7fd9227e9111502a6134666d6636a8695c36f4e Mon Sep 17 00:00:00 2001
From 1f1a8460083486969fd81d0e1bf74fff4fe18e3d Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <[email protected]>
Date: Thu, 24 Feb 2022 01:54:50 +0330
Subject: [PATCH 3/6] Teach dyn_load.c about serenity
Subject: [PATCH 3/7] Teach dyn_load.c about serenity

---
dyn_load.c | 23 ++++++++++++++++++++---
Expand Down Expand Up @@ -63,5 +63,5 @@ index d857246..734643d 100644
|| defined(NACL) || defined(NETBSD) \
|| defined(OPENBSD)))
--
2.35.1
2.36.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d37f9022e78b9df4959f9be265f91e611e84e03a Mon Sep 17 00:00:00 2001
From de33591aec7243f14206913f8188519744714389 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <[email protected]>
Date: Thu, 24 Feb 2022 03:30:02 +0330
Subject: [PATCH 4/6] Teach bdwgc about serenity signals
Subject: [PATCH 4/7] Teach bdwgc about serenity signals

Serenity doesn't have the realtime POSIX signals, so use SIGXCPU and
SIGXFSZ instead.
Expand Down Expand Up @@ -62,5 +62,5 @@ index 4b2c429..25eb2a5 100644
# if defined(_SIGRTMIN) && !defined(CPPCHECK)
# define SIG_THR_RESTART _SIGRTMIN + 5
--
2.35.1
2.36.1

6 changes: 3 additions & 3 deletions Ports/bdwgc/patches/0005-Explicitly-link-with-pthread.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3c107421a9541856ba7f5a495bb3aac35a377583 Mon Sep 17 00:00:00 2001
From 55a28f3dbf0ddcf24077281e38ba7bc7904308d6 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <[email protected]>
Date: Thu, 24 Feb 2022 03:47:50 +0330
Subject: [PATCH 5/6] Explicitly link with pthread
Subject: [PATCH 5/7] Explicitly link with pthread

The cmakelists was using the wrong variable to link against pthread.
---
Expand Down Expand Up @@ -69,5 +69,5 @@ index 3c84220..5e15727 100644
+TARGET_LINK_LIBRARIES(smashtest gc-lib ${LIBS})
ADD_TEST(NAME smashtest COMMAND smashtest)
--
2.35.1
2.36.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 825f33e226dbe842fb6588ba73c31b9fbb079f11 Mon Sep 17 00:00:00 2001
From a9832f6c77e837637544926717061d00951a6321 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <[email protected]>
Date: Fri, 25 Feb 2022 04:53:53 +0330
Subject: [PATCH 6/6] Make the collector build with threads
Subject: [PATCH 6/7] Make the collector build with threads

In an extremely limited way for now:
- No extra threads
Expand Down Expand Up @@ -48,5 +48,5 @@ index 8e2e3a6..f38fb22 100644
#endif

--
2.35.1
2.36.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From d55e0b907be765212bdd214c9b0c248646d294e8 Mon Sep 17 00:00:00 2001
From: Peter Elliott <[email protected]>
Date: Mon, 16 May 2022 23:55:41 -0600
Subject: [PATCH 7/7] Add serenity to the conigure list of pthread unixes

---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 3b38e6f..5b6daa4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,7 +201,7 @@ case "$THREADS" in
*-*-aix* | *-*-android* | *-*-cygwin* | *-*-darwin* | *-*-dragonfly* | \
*-*-freebsd* | *-*-haiku* | *-*-hpux11* | *-*-irix* | \
*-*-kfreebsd*-gnu | *-*-gnu* | *-*-*linux* | *-*-msys* | *-*-nacl* | \
- *-*-netbsd* | *-*-openbsd* | *-*-osf* | *-*-solaris*)
+ *-*-netbsd* | *-*-openbsd* | *-*-osf* | *-*-solaris* | *-*-serenity* )
AC_DEFINE(GC_THREADS)
AC_DEFINE([_REENTRANT], [1],
[Required define if using POSIX threads.])
--
2.36.1

5 changes: 5 additions & 0 deletions Ports/bdwgc/patches/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ In an extremely limited way for now:
- No fork handling
Seems borked for unknown reasons.

## `0007-Add-serenity-to-the-conigure-list-of-pthread-unixes.patch`

Add serenity to the conigure list of pthread unixes


0 comments on commit 8a007e7

Please sign in to comment.