On Sat, 2009-08-29 at 06:15 -0700, Joakim Sindholt wrote:
> Regarding the recent addition of llvmpipe I decided to try it out and
> found that it wouldn't compile using gcc 4.4 but would using gcc 4.3. I
> tracked the bug down to the -std=c99 flag and it was caused by an
> illegal declaration:
> 
> union U
> {
>     struct
>     {
>         short a;
>         short b;
>     };
>     int c;
> };

The problem happens std=c99 only, right? It builds fine with gcc-4.4 and
-std=gnu99, which is the default on SCons now, exactly because of that
construct, which appears to be quite common in hardware registers
definition headers.

> With this declaration a non-conforming compiler will accept access to
> U::a and U::b however gcc 4.4 does actually conform to C99 which means
> that this is illegal.
> The correct declaration goes:
> 
> union U
> {
>     struct
>     {
>         short a;
>         short b;
>     } v;
>     int c;
> };

Thanks for your patch, but if it comes to this then I rather just drop
the union and int c, and save keystrokes, since we barely use the
union's second member anyway in this case (lp_type).

> The values are accessed through U::v::a and U::v::b. I made a patch that
> lets it compile. I also patched (not included here) the radeon winsys to
> use llvmpipe instead of softpipe to test it but it doesn't appear to
> work too well. I can't find any declaration of LLVMBuildNot anywhere
> though, so can someone tell me what I'm doing wrong?
> 
> libGL error: dlopen ./r300_dri.so failed (./r300_dri.so: undefined
> symbol: LLVMBuildNot)

Most likely it is not just LLVMBuildNot that's undefined, but all LLVM
symbols. What does "ldd -r r300_dri.so " show? If so then you'll need to
link in the llvm libraries when creating r300_dri.so, i.e., the output
of `llvm-config --libs jit interpreter nativecodegen`

Jose


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to