pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/54823 (MesaLib-19.2.7: building failure due to ALIGN() on FreeBSD)



The following reply was made to PR pkg/54823; it has been noted by GNATS.

From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Fauberteau?= <triaxx%NetBSD.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/54823 (MesaLib-19.2.7: building failure due to ALIGN() on
 FreeBSD)
Date: Thu, 02 Jan 2020 21:59:19 +0100

 By inspecting the preprocessor output, it seems that 
 patch-src_mesa_main_macros.h is inefficient on FreeBSD because it 
 undefines ALIGN macro before its inclusion.
 
 Last inclusion of main/macros.h that undefines ALIGN:
 | 11778 # 711 "../src/mesa/main/macros.h"
 
 Inclusion of <machine/param.h> that defines ALIGN on FreeBSD:
 | 14145 #pragma clang diagnostic pop
 | 14146 # 38 "../src/util/u_thread.h" 2
 | 14147
 | 14148 # 1 "/usr/include/pthread_np.h" 1 3 4
 | 14149 # 36 "/usr/include/pthread_np.h" 3 4
 | 14150 # 1 "/usr/include/sys/param.h" 1 3 4
 | 14151 # 141 "/usr/include/sys/param.h" 3 4
 | 14152 # 1 "/usr/include/machine/param.h" 1 3 4
 | 14153 # 48 "/usr/include/machine/param.h" 3 4
 | 14154 # 1 "/usr/include/machine/_align.h" 1 3 4
 
 Call of ALIGN() in marshal.c:
 | 24069    const size_t aligned_size = ALIGN(size, 8);
 
 The following patch works but there is probably a more elegant solution:
 $NetBSD$
 
 --- src/mesa/main/marshal.h.orig  2019-12-04 22:10:14.000000000 +0000
 +++ src/mesa/main/marshal.h
 @@ -55,6 +55,9 @@ _mesa_glthread_allocate_command(struct gl_context *ctx
      struct glthread_state *glthread = ctx->GLThread;
      struct glthread_batch *next = &glthread->batches[glthread->next];
      struct marshal_cmd_base *cmd_base;
 +#ifdef ALIGN
 +#undef ALIGN
 +#endif
      const size_t aligned_size = ALIGN(size, 8);
 
      if (unlikely(next->used + size > MARSHAL_MAX_CMD_SIZE)) {
 


Home | Main Index | Thread Index | Old Index