Bug 92988 - altmacro is not supported by clang
Summary: altmacro is not supported by clang
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: wayland (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-18 10:07 UTC by Víctor Jáquez
Modified: 2015-11-19 07:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Víctor Jáquez 2015-11-18 10:07:41 UTC
In commit f66e2d5 (Validate the protocol xml during scanning) the dtd is embedded in the executable and validated. Nonetheless, in order to do that trick, an assembly snipped is used, but it is not clang/llvm friendly[1]

I don't know if there's a way to workaround this, or perhaps in configure.ac, if clang is detected, the validation during scanning would be disabled.

1. https://llvm.org/bugs/show_bug.cgi?id=18918

clang    -c -o src/dtddata.o src/dtddata.S
src/dtddata.S:25:1: error: unknown directive
.altmacro
^
<instantiation>:2:17: error: unexpected token in directive
 .globl DTD_DATA&_begin
                ^
src/dtddata.S:40:1: note: while in macro instantiation
binfile DTD_DATA "src/wayland.dtd.embed"
^
<instantiation>:3:9: error: unknown token in expression
DTD_DATA&_begin:
        ^
src/dtddata.S:40:1: note: while in macro instantiation
binfile DTD_DATA "src/wayland.dtd.embed"
^
<instantiation>:4:10: error: expected string in '.incbin' directive
 .incbin src/wayland.dtd.embed
         ^
src/dtddata.S:40:1: note: while in macro instantiation
binfile DTD_DATA "src/wayland.dtd.embed"
^
<instantiation>:5:9: error: unknown token in expression
DTD_DATA&_end:
        ^
src/dtddata.S:40:1: note: while in macro instantiation
binfile DTD_DATA "src/wayland.dtd.embed"
^
<instantiation>:8:17: error: unexpected token in directive
 .globl DTD_DATA&_len
                ^
src/dtddata.S:40:1: note: while in macro instantiation
binfile DTD_DATA "src/wayland.dtd.embed"
^
<instantiation>:9:9: error: unknown token in expression
DTD_DATA&_len:
        ^
src/dtddata.S:40:1: note: while in macro instantiation
binfile DTD_DATA "src/wayland.dtd.embed"
^
Comment 1 Pekka Paalanen 2015-11-18 11:10:10 UTC
Hi,

I sent a patch that might fix this:
http://patchwork.freedesktop.org/patch/65173/

Could you test, preferably both of them?
http://patchwork.freedesktop.org/series/889/
Comment 2 Víctor Jáquez 2015-11-18 12:25:12 UTC
(In reply to Pekka Paalanen from comment #1)
> Hi,
> 
> I sent a patch that might fix this:
> http://patchwork.freedesktop.org/patch/65173/
> 
> Could you test, preferably both of them?
> http://patchwork.freedesktop.org/series/889/

They work. wayland now compiles with clang, and I'm watching videos over weston with gstreamer-vaapi :)

Thanks!
Comment 3 Pekka Paalanen 2015-11-19 07:56:40 UTC
Fixed in master b644594a2ce918e6a9d3dde5d3d60a1405a0ffd9.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.