From: J.A. M. <jam...@ab...> - 2002-10-10 22:33:23
|
On 2002.10.10 er...@he... wrote: >On Thu, Oct 10, 2002 at 02:37:04PM -0600, Andrew Shewmaker` wrote: >> I am attempting to use bproc-3.2.1 with Mandrake 9.0 (kernel 2.4.19-16mdk and gcc 3.2) >> I have successfully patched and compiled Mandrake's kernel with bproc, which meant I >> had to do some of it by hand since the grsecurity stuff confused patch. Then I tried to >> compile the bproc tools and I see the following error. >> >> ghost.c:63: initializer element is not constant >> ghost.c:63: (near initialization for `bproc_ghost_reqs') >> ghost.c:63: initializer element is not constant >> >> I assume this is simply due to gcc 3.2, and I will switch to an older compiler if I >> have to, but if someone could suggest a simple fix I would appreciate it. > >I have no idea how a constant can become non constant when changing >compilers. Anyway, I worked around it. Patch below (against bproc 3.2.1): > Much simpler solution (at least for that problem, do not know anything about constant strings and newlines): diff -ruN bproc-3.1.9/kernel/bproc.h bproc-3.1.9-j/kernel/bproc.h --- bproc/kernel/bproc.h 2002-02-19 23:25:47.000000000 +0100 +++ bproc-j/kernel/bproc.h 2002-03-29 11:52:43.000000000 +0100 @@ -582,10 +582,12 @@ #define BPROC_DEADREQ(r) ((r)->req.req == 0) #define BPROC_PENDING(r) ((!BPROC_DEADREQ(r))&&(!BPROC_ISRESPONSE((r)->req.req))) -#define EMPTY_BPROC_REQUEST_QUEUE(foo) \ - ((struct bproc_request_queue_t) {SPIN_LOCK_UNLOCKED,0, \ +#define EMPTY_BPROC_REQUEST_QUEUE_STATIC(foo) \ + {SPIN_LOCK_UNLOCKED,0, \ LIST_HEAD_INIT((foo).list),__WAIT_QUEUE_HEAD_INITIALIZER((foo).wait),\ - LIST_HEAD_INIT((foo).pending)}) + LIST_HEAD_INIT((foo).pending)} +#define EMPTY_BPROC_REQUEST_QUEUE(foo) \ + ((struct bproc_request_queue_t) EMPTY_BPROC_REQUEST_QUEUE_STATIC(foo)) extern atomic_t msg_count; static inline diff -ruN bproc-3.1.9/kernel/ghost.c bproc-3.1.9-j/kernel/ghost.c --- bproc/kernel/ghost.c 2002-03-08 20:26:31.000000000 +0100 +++ bproc-j/kernel/ghost.c 2002-03-29 11:52:59.000000000 +0100 @@ -60,7 +60,7 @@ DECLARE_WAIT_QUEUE_HEAD(ghost_wait); struct bproc_request_queue_t bproc_ghost_reqs = - EMPTY_BPROC_REQUEST_QUEUE(bproc_ghost_reqs); + EMPTY_BPROC_REQUEST_QUEUE_STATIC(bproc_ghost_reqs); int ghost_deliver_msg(pid_t pid, struct bproc_krequest_t *req) { -- J.A. Magallon <jam...@ab...> \ Software is like sex: werewolf.able.es \ It's better when it's free Mandrake Linux release 9.1 (Cooker) for i586 Linux 2.4.20-pre10-jam1 (gcc 3.2 (Mandrake Linux 9.0 3.2-2mdk)) |