Skip to content

Commit

Permalink
fix static build on NetBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
christos committed Jul 14, 2020
1 parent ede1c3a commit 0502ede
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shells/tcsh/distinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.45 2020/07/08 04:06:48 mrg Exp $
$NetBSD: distinfo,v 1.46 2020/07/14 21:48:29 christos Exp $

SHA1 (tcsh-6.22.02.tar.gz) = d3c916c82eec7e20c49dedf660edd51a7971f8ab
RMD160 (tcsh-6.22.02.tar.gz) = f6c7d6521e1e092dd2c68727e45fbadd54af82e4
Expand All @@ -9,3 +9,4 @@ SHA1 (patch-ab) = 715d939e8a8f4917bd219dccd91d5c49ae502939
SHA1 (patch-configure) = 6970c041a66910325d1fb53ebf8ab3627d764778
SHA1 (patch-nls_Makefile.in) = 58d859e8a50e6436b9bc6514497eb876426d92d7
SHA1 (patch-sh.h) = ac6211ddd5e552e9baec2d35aed5e7e573cab04e
SHA1 (patch-tc.alloc.c) = 14c19c860b1a963428cce77b23df4a250abd4561
20 changes: 20 additions & 0 deletions shells/tcsh/patches/patch-tc.alloc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$NetBSD: patch-tc.alloc.c,v 1.3 2020/07/14 21:48:30 christos Exp $

Fix static linking since NetBSD's libc needs these for pthread_atfork();

--- tc.alloc.c.orig 2019-12-04 12:51:54.000000000 -0500
+++ tc.alloc.c 2020-07-14 17:42:39.103744313 -0400
@@ -655,3 +655,13 @@
USE(c);
USE(v);
}
+
+#ifndef SYSMALLOC
+/* jemalloc defines these */
+void _malloc_prefork(void);
+void _malloc_postfork(void);
+void _malloc_postfork_child(void);
+void _malloc_prefork(void) {}
+void _malloc_postfork(void) {}
+void _malloc_postfork_child(void) {}
+#endif

0 comments on commit 0502ede

Please sign in to comment.