<div dir="ltr">Hi, Eric,<div><br></div><div>Thanks for your suggestion. I modify the order of the include in dma-fence.c and the error has gone. However, when I recompile it I got the same error on drm_bridge.c.</div><div><br></div><div>===============================================================</div><div><div>make</div><div>make -C /lib/modules/3.13.0-108-generic/build KCPPFLAGS="-DVMWGFX_STANDALONE -DTTM_STANDALONE" SUBDIRS=`/bin/pwd` DRMSRCDIR=`/bin/pwd` modules</div><div>make[1]: Entering directory `/usr/src/linux-headers-3.13.0-108-generic'</div><div> CC [M] /home/zg/vmware/vmwgfx/ww_mutex.o</div><div> CC [M] /home/zg/vmware/vmwgfx/dma-fence.o</div><div> CC [M] /home/zg/vmware/vmwgfx/reservation.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_auth.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_bufs.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_context.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_crtc.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_drv.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_fops.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_ioctl.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_irq.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_modes.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_edid.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_lock.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_memory.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_vm.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_sysfs.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_hashtab.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_mm.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_debugfs.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_info.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_global.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_cache.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_prime.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_pci.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_atomic.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_scatter.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_dma.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_modeset_lock.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_crtc_helper.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_plane_helper.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_atomic_helper.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_bridge.o</div><div>In file included from /home/zg/vmware/vmwgfx/drm_bridge.c:27:0:</div><div>/home/zg/vmware/vmwgfx/drm_compat.h:113:3: error: expected identifier or ‘(’ before ‘{’ token</div><div> ({BUILD_BUG_ON(_s != TASK_NORMAL); \</div><div> ^</div><div>include/linux/sched.h:2077:12: note: in expansion of macro ‘wake_up_state’</div><div> extern int wake_up_state(struct task_struct *tsk, unsigned int state);</div><div> ^</div><div>make[2]: *** [/home/zg/vmware/vmwgfx/drm_bridge.o] Error 1</div><div>make[1]: *** [_module_/home/zg/vmware/vmwgfx] Error 2</div><div>make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-108-generic'</div><div>make: *** [modules] Error 2</div></div><div><br></div><div>===============================================================</div><div><br></div><div><br></div><div>I try to reorder the include file in drm_bridge.c as follows:</div><div><div>#include <linux/err.h></div><div>#include <linux/module.h></div><div><br></div><div><br></div><div>#include "drm_crtc.h"</div><div>#include "drm_compat.h"</div><div>#include "drmP.h"</div></div><div><br></div><div>Then I got some other error as shown below:</div><div><br></div><div>===============================================================</div><div><div>zg@ubuntu:~/vmware/vmwgfx$ make</div><div>make -C /lib/modules/3.13.0-108-generic/build KCPPFLAGS="-DVMWGFX_STANDALONE -DTTM_STANDALONE" SUBDIRS=`/bin/pwd` DRMSRCDIR=`/bin/pwd` modules</div><div>make[1]: Entering directory `/usr/src/linux-headers-3.13.0-108-generic'</div><div> CC [M] /home/zg/vmware/vmwgfx/ww_mutex.o</div><div> CC [M] /home/zg/vmware/vmwgfx/dma-fence.o</div><div> CC [M] /home/zg/vmware/vmwgfx/reservation.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_auth.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_bufs.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_context.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_crtc.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_drv.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_fops.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_ioctl.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_irq.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_modes.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_edid.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_lock.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_memory.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_vm.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_sysfs.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_hashtab.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_mm.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_debugfs.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_info.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_global.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_cache.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_prime.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_pci.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_atomic.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_scatter.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_dma.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_modeset_lock.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_crtc_helper.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_plane_helper.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_atomic_helper.o</div><div> CC [M] /home/zg/vmware/vmwgfx/drm_bridge.o</div><div>In file included from /home/zg/vmware/vmwgfx/drm_crtc.h:101:0,</div><div> from /home/zg/vmware/vmwgfx/drm_bridge.c:28:</div><div>/home/zg/vmware/vmwgfx/drm_modes.h:400:27: error: field ‘picture_aspect_ratio’ has incomplete type</div><div> enum hdmi_picture_aspect picture_aspect_ratio;</div><div> ^</div><div>make[2]: *** [/home/zg/vmware/vmwgfx/drm_bridge.o] Error 1</div><div>make[1]: *** [_module_/home/zg/vmware/vmwgfx] Error 2</div><div>make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-108-generic'</div><div>make: *** [modules] Error 2</div></div><div><br></div><div>===============================================================</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Best regards,<div>Zhiguang</div></div></div></div>
<br><div class="gmail_quote">On Tue, Feb 28, 2017 at 2:24 PM, Eric Engestrom <span dir="ltr"><<a href="mailto:eric.engestrom@imgtec.com" target="_blank">eric.engestrom@imgtec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday, 2017-02-28 14:04:15 +0100, Zhiguang Liu wrote:<br>
> Hi,<br>
><br>
> I try to build vmwgfx on Ubuntu 12.04 with gcc-4.8.1, make 3.8.1. I clone<br>
> the source files using the following command:<br>
><br>
> git clone git://<a href="http://anongit.freedesktop.org/git/mesa/vmwgfx" rel="noreferrer" target="_blank">anongit.freedesktop.org/<wbr>git/mesa/vmwgfx</a><br>
><br>
> However, when I use 'make' command to build it, I got one error like this:<br>
><br>
> ==============================<wbr>==============================<wbr>====<br>
> zg@ubuntu:~/vmware/vmwgfx$ make<br>
> make -C /lib/modules/3.13.0-108-<wbr>generic/build KCPPFLAGS="-DVMWGFX_STANDALONE<br>
> -DTTM_STANDALONE" SUBDIRS=`/bin/pwd` DRMSRCDIR=`/bin/pwd` modules<br>
> make[1]: Entering directory `/usr/src/linux-headers-3.13.<wbr>0-108-generic'<br>
> CC [M] /home/zg/vmware/vmwgfx/ww_<wbr>mutex.o<br>
> CC [M] /home/zg/vmware/vmwgfx/dma-<wbr>fence.o<br>
> In file included from /home/zg/vmware/vmwgfx/dma-<wbr>fence.c:37:0:<br>
> /home/zg/vmware/vmwgfx/drm_<wbr>compat.h:113:3: error: expected identifier or<br>
> ‘(’ before ‘{’ token<br>
> ({BUILD_BUG_ON(_s != TASK_NORMAL); \<br>
> ^<br>
> include/linux/sched.h:2077:12: note: in expansion of macro ‘wake_up_state’<br>
> extern int wake_up_state(struct task_struct *tsk, unsigned int state);<br>
> ^<br>
<br>
</span>The problem isn't with the macro, but the fact that it's defined before<br>
the function it replaces.<br>
<br>
The result is that this:<br>
<span class=""> extern int wake_up_state(struct task_struct *tsk, unsigned int state);<br>
<br>
</span>… gets rewritten as this (by the preprocessor):<br>
extern int ({BUILD_BUG_ON(_s != TASK_NORMAL); wake_up_state(struct task_struct *tsk); });<br>
<br>
… which is invalid and doesn't compile.<br>
<br>
Changing the order of the includes should fix this. Can you try this<br>
patch?<br>
<br>
----8<----<br>
diff --git a/core/dma-fence.c b/core/dma-fence.c<br>
index d28fb37..515593f 100644<br>
--- a/core/dma-fence.c<br>
+++ b/core/dma-fence.c<br>
@@ -34,8 +34,8 @@ EXPORT_TRACEPOINT_SYMBOL(dma_<wbr>fence_emit);<br>
<br>
#include <linux/slab.h><br>
#include <asm/atomic.h><br>
-#include "drm_compat.h"<br>
#include "core/dma-fence.h"<br>
+#include "drm_compat.h"<br>
<br>
#define trace_dma_fence_signaled(_a)<br>
#define trace_dma_fence_wait_start(_a)<br>
---->8----<br>
<br>
Cheers,<br>
Eric<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> make[2]: *** [/home/zg/vmware/vmwgfx/dma-<wbr>fence.o] Error 1<br>
> make[1]: *** [_module_/home/zg/vmware/<wbr>vmwgfx] Error 2<br>
> make[1]: Leaving directory `/usr/src/linux-headers-3.13.<wbr>0-108-generic'<br>
> make: *** [modules] Error 2<br>
> ==============================<wbr>==============================<wbr>====<br>
><br>
> I opened the drm_compat.h and it seems that nothing goes wrong for line<br>
> 113. Does anyone have some idea on this problem?<br>
><br>
> [image: Inline image 1]<br>
><br>
> Best regards,<br>
> Zhiguang<br>
</div></div></blockquote></div><br></div>