Announcement

Collapse
No announcement yet.

Compile problems for 32bit mesa on 64bit system

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by Dard
    If yes, then I am close to giving up here since I fear that building further 32bit libs will only result in more dependencies.
    Don't despair.

    I have a similar situation. I run Debian Wheezy with r600g from git, for a 5770.

    Code:
    /usr/bin/ld: skipping incompatible /usr/local/xorg32/lib/libdrm.so when searching for -ldrm
    I had the same error.

    My setup is based on a script I got from DanL, which I disrespectfully modified so I wouldn't have to schroot. I run my script as an unprivileged user (albeit allowed to sudo make and ldconfig nopasswd), which compiles in a home directory before installed to /opt/xorg/ and /opt/xorg32/.

    Dependencies for 64-bit, more or less (mostly more):
    Code:
    libdrm-dev libdrm-radeon1 flex bison libxmu-dev libxmu-headers libxmuu-dev libxi-dev libxrandr-dev xorg-dev libdirectfb-bin automake autoconf libxcb-glx0 libxcb-glx0-dev libtool xutils-dev libx11-xcb-dev libgl1-mesa-dev libglu1-mesa-dev libudev-dev libvdpau1 libvdpau-dev libselinux1-dev
    Setup (as user):
    Code:
    cd ~/opt
    git clone git://anongit.freedesktop.org/mesa/drm
    git clone git://anongit.freedesktop.org/mesa/mesa
    git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-ati
    Initial compile:
    Code:
    cd drm
    ./autogen.sh --disable-intel --prefix=/opt/xorg
    make 
    sudo make install
    sudo ldconfig
    cd ../mesa
    ./autogen.sh --prefix=/opt/xorg --with-gallium-drivers=swrast,r600 --with-dri-drivers= --disable-gallium-llvm --enable-xcb --enable-gallium-egl --enable-openvg --enable-gbm --enable-gallium-gbm --enable-xvmc --enable-vdpau --enable-gallium-g3dvl --enable-shared-glapi --enable-gles1 --enable-gles2 --enable-selinux
    make
    sudo make install
    sudo ldconfig
    cd ../xf86-video-ati
    ./autogen.sh --prefix=/opt/xorg
    make
    sudo make install
    sudo ldconfig
    If that works without errors, add LIBGL_DRIVERS_PATH=/opt/xorg/lib/dri:/opt/xorg32/lib/dri to /etc/environment, and change ModulePath in your /etc/X11/xorg.conf to ModulePath "/opt/xorg/lib/xorg/modules,/usr/lib/xorg/modules" . (If you don't have a xorg.conf and # X -configure doesn't work -- it doesn't for me -- I can post mine.)

    Dependencies for 32-bit:
    Code:
    ia32-libs-dev ia32-libs-gtk libc6-dev-i386 gcc-multilib g++-multilib
    This script should/might work for more easily updating r600g and building 32-bit Mesa.
    Code:
    #!/bin/bash
    
    # update r600g, both x86 and x86_64.
    # 2011-08-15
    
    function failExit() {
    	echo 'failure!';
    	exit 1;
    }
    
    echo "	*	*	*	updating r600g	*	*	*"
    echo "	x86_64:"
    echo "Updating DRM"
    cd drm
    make distclean && git pull || failExit
    echo "Building DRM"
    ./autogen.sh --disable-intel --prefix=/opt/xorg && make || failExit
    echo "Installing DRM"
    sudo make install && sudo ldconfig || failExit
    
    echo "Updating Mesa"
    cd ../mesa
    make distclean && git pull || failExit
    echo "Building Mesa"
    ./autogen.sh --prefix=/opt/xorg --with-gallium-drivers=swrast,r600 --with-dri-drivers= --disable-gallium-llvm --enable-xcb --enable-gallium-egl --enable-openvg --enable-gbm --enable-gallium-gbm --enable-xvmc --enable-vdpau --enable-gallium-g3dvl --enable-shared-glapi --enable-gles1 --enable-gles2 --enable-selinux && make || failExit
    echo "Installing Mesa"
    sudo make install && sudo ldconfig || failExit
    
    echo "Updating xf86-video-ati"
    cd ../xf86-video-ati
    make distclean && git pull || failExit
    echo "Building xf86-video-ati"
    ./autogen.sh --prefix=/opt/xorg && make || failExit
    echo "Installing xf86-video-ati"
    sudo make install && sudo ldconfig || failExit
    
    echo "	x86_64 done."
    
    exit 0
    
    echo "	x86:"
    
    echo "Building drm"
    cd ../drm
    make distclean && ./autogen.sh --prefix=/opt/xorg32 --libdir=/opt/xorg32/lib CFLAGS="-m32 -O2 -g" --disable-intel && make || failExit
    echo "Installing drm"
    sudo make install && sudo ldconfig || failExit
    
    echo "Building Mesa"
    cd ../mesa
    make distclean && CFLAGS="-m32" CXXFLAGS="-m32" PKG_CONFIG_PATH=/opt/xorg32/lib/pkgconfig:/opt/xorg32/share/pkgconfig LDFLAGS=-L/opt/xorg32/lib CPPFLAGS=-I/opt/xorg32/include ./autogen.sh --prefix=/opt/xorg32 --libdir=/opt/xorg32/lib --with-gallium-drivers="swrast,r600" --with-dri-drivers= --with-dri-driverdir="/opt/xorg32/lib/dri" --enable-32-bit --disable-gallium-llvm --enable-xcb --enable-gallium-egl --enable-openvg  --enable-gbm --enable-gallium-gbm --enable-xvmc --enable-vdpau --enable-gallium-g3dvl --enable-shared-glapi --enable-gles1 --enable-gles2 && make || failExit
    # removed --enable-selinux from above due to incompatibility
    echo "Installing Mesa"
    sudo make install && sudo ldconfig || failExit
    
    echo "	x86 done."
    
    echo "	*	*	*	updating r600g done.	*	*	*"
    Make it executable, and put it in the same directory as the drm/, mesa/, and xf86-video-ati/ directories. (Presumably you have to run it from there as well.)


    The PKG_CONFIG_PATH, LDFLAGS, and CPPFLAGS variables in the line to make 32-bit Mesa are what fix the libdrm.so problem (at least, for me). I didn't figure it out until I saw them mentioned here.

    There might be something missing ldconfig-wise; I'm not sure what....

    Obviously, the script is half-baked or worse I haven't even tested a 32-bit application here since reinstalling Debian and writing the script. Update: Just tested it with $ LIBGL_DEBUG=verbose lugaru. It works, and is using the right r600g.

    My Mesa configuration is rather bloated -- so you might want to trim it back to the --enable-xcb or so. It *might* be missing a flag or two. You might want to add a flag or two.

    Hope that helps. (Usual liability disclaimers apply if it doesn't.) Consider the script free software -- I'll stick a license on it if necessary.

    Comment


    • #12
      Sorry, wrong reply.
      Last edited by Dard; 28 August 2011, 11:16 AM.

      Comment


      • #13
        Broken script -- sorry

        Sorry.

        The script I posted wasn't quite tested -- I'd disabled the whole 32-bit section because it wasn't working. Some of the Mesa flags were preventing the 32-bit version from compiling, by requiring numerous other 32-bit packages....

        Here's the corrected script.
        Code:
        #!/bin/bash
        
        # update r600g, both x86 and x86_64.
        # 2011-08-15
        
        function failExit() {
        	echo 'failure!';
        	exit 1;
        }
        
        echo "	*	*	*	updating r600g	*	*	*"
        echo "	x86_64:"
        echo "Updating DRM"
        cd drm
        make distclean && git pull || failExit
        echo "Building DRM"
        ./autogen.sh --disable-intel --prefix=/opt/xorg && make || failExit
        echo "Installing DRM"
        sudo make install && sudo ldconfig || failExit
        
        echo "Updating Mesa"
        cd ../mesa
        make distclean && git pull || failExit
        echo "Building Mesa"
        # Mesa configuration for 64-bit -- if you want to fiddle with it, require dependencies, and break things, add  various combinations of:
        #  --enable-openvg --enable-gbm --enable-gallium-gbm --enable-xvmc --enable-vdpau --enable-gallium-g3dvl --enable-shared-glapi --enable-gles1 --enable-gles2 --enable-selinux
        ./autogen.sh --prefix=/opt/xorg --with-gallium-drivers=swrast,r600 --with-dri-drivers= --disable-gallium-llvm --enable-xcb --enable-gallium-egl && make || failExit
        echo "Installing Mesa"
        sudo make install && sudo ldconfig || failExit
        
        echo "Updating xf86-video-ati"
        cd ../xf86-video-ati
        make distclean && git pull || failExit
        echo "Building xf86-video-ati"
        ./autogen.sh --prefix=/opt/xorg && make || failExit
        echo "Installing xf86-video-ati"
        sudo make install && sudo ldconfig || failExit
        
        echo "	x86_64 done."
        
        echo "	x86:"
        
        echo "Building drm"
        cd ../drm
        make distclean && ./autogen.sh --prefix=/opt/xorg32 --libdir=/opt/xorg32/lib CFLAGS="-m32 -O2 -g" --disable-intel && make || failExit
        echo "Installing drm"
        sudo make install && sudo ldconfig || failExit
        
        echo "Building Mesa"
        cd ../mesa
        # Mesa configuration for 32-bit -- if you want to add dependencies and break things, add various combinations of --enable-xcb --enable-gallium-egl --enable-openvg --enable-gles1 --enable-gles2
        make distclean && CFLAGS="-m32" CXXFLAGS="-m32" PKG_CONFIG_PATH=/opt/xorg32/lib/pkgconfig:/opt/xorg32/share/pkgconfig LDFLAGS=-L/opt/xorg32/lib CPPFLAGS=-I/opt/xorg32/include ./autogen.sh --prefix=/opt/xorg32 --libdir=/opt/xorg32/lib --with-gallium-drivers="swrast,r600" --with-dri-drivers= --with-dri-driverdir="/opt/xorg32/lib/dri" --enable-32-bit --disable-gallium-llvm && make || failExit
        echo "Installing Mesa"
        sudo make install && sudo ldconfig || failExit
        
        echo "	x86 done."
        
        echo "	*	*	*	updating r600g done.	*	*	*"
        Again -- you might want to add a flag or two to the Mesa configuration.

        Comment


        • #14
          Thank you for your update, but it still doesn't work.
          I've come farthest with these commands:
          Code:
          rm -r /usr/local/xorg32/
          
          export CFLAGS="-pipe -m32"
          export CXXFLAGS="-pipe -m32"
          
          cd drm
          make distclean
          ./autogen.sh --prefix=/usr/local/xorg32 --disable-intel --build=i686-pc-linux-gnu 
          make -j 3
          make install
          ldconfig
          cd ..
          
          cd mesa
          make distclean
          ./autogen.sh --prefix=/usr/local/xorg32/ --with-gallium-drivers=swrast,r600 --with-dri-drivers= --enable-32-bit --disable-64-bit --build=i686-pc-linux-gnu 
          make -j 3
          make install
          ldconfig
          cd ..
          Right now the main problem is that mesa's make fails because it looks for libdrm at the wrong place. I've tried setting the -libdir option and several other things, nothing helped.

          Now that you replied your new script I have tried that.
          It gave me completely new errors:
          Code:
          glapi_x86-64.S:35320: Error: bad register name `%rbp'
          glapi_x86-64.S:35322: Error: bad register name `%rbp'
          glapi_x86-64.S:35323: Error: bad register name `%rsi'
          glapi_x86-64.S:35324: Error: bad register name `%rdi'
          glapi_x86-64.S:35325: Error: bad register name `%rax)'
          glapi_x86-64.S:35326: Error: bad register name `%r11'
          make[2]: *** [glapi_x86-64.o] Error 1
          make[2]: Leaving directory `/root/software/xorg/mesa/src/mapi/glapi'
          make[1]: *** [subdirs] Error 1
          make[1]: Leaving directory `/root/software/xorg/mesa/src'
          make: *** [default] Error 1
          I couldn't find how to get rid of that one.

          I have now spent three whole afternoons trying to get this working, so I am now giving up.
          I thank all of you for your help, but simply don't have the nerve to try further.

          Comment


          • #15
            Originally posted by Dard
            Right now the main problem is that mesa's make fails because it looks for libdrm at the wrong place. I've tried setting the -libdir option and several other things, nothing helped.
            Did you try setting --with-dri-driverdir="/opt/xorg32/lib/dri" (or your 32-bit equivalent)?


            I've never experienced the "bad register name" errors... was that from building the x86_64 version, or the i386 version?

            Comment


            • #16
              The bad register names probably happened because my flags for m32 compiling were still active which caused the 64bit compile to fail.
              64bit compile still fails, because of the pciaccess problem.

              I tried again, by cutting down your script to the 32 bit part, also relocating the paths:
              Code:
              #!/bin/bash
              
              # update r600g, both x86 and x86_64.
              # 2011-08-15
              
              function failExit() {
              	echo 'failure!';
              	exit 1;
              }
              
              echo "	x86:"
              
              echo "Building drm"
              cd drm
              make distclean && ./autogen.sh --prefix=/usr/local/xorg32 --libdir=/usr/local/xorg32/lib CFLAGS="-m32 -O2 -g" --disable-intel && make || failExit
              echo "Installing drm"
              sudo make install && sudo ldconfig || failExit
              
              echo "Building Mesa"
              cd ../mesa
              # Mesa configuration for 32-bit -- if you want to add dependencies and break things, add various combinations of --enable-xcb --enable-gallium-egl --enable-openvg --enable-gles1 --enable-gles2
              make distclean && CFLAGS="-m32" CXXFLAGS="-m32" PKG_CONFIG_PATH=/usr/local/xorg32/lib/pkgconfig:/usr/local/xorg32/share/pkgconfig LDFLAGS=-L/usr/local/xorg32/lib CPPFLAGS=-I/usr/local/xorg32/include ./autogen.sh --prefix=/usr/local/xorg32 --libdir=/usr/local/xorg32/lib --with-gallium-drivers="swrast,r600" --with-dri-drivers= --with-dri-driverdir="/usr/local/xorg32/lib/dri" --enable-32-bit --disable-gallium-llvm && make || failExit
              echo "Installing Mesa"
              sudo make install && sudo ldconfig || failExit
              
              echo "	x86 done."
              
              echo "	*	*	*	updating r600g done.	*	*	*"
              This actually compiles and installs!

              So far, so good.
              It doesn't seem to help me much though.
              My reference wine application (the Max Payne demo) seems to try to use the drivers, but crashes with a big stack trace of libwine.
              This is disappointing, because that program always ran absolutely correct with software rendering or with graphics glitches on older radeon drivers. The graphics glitches were the reason why I wanted to try bleeding edge radeon drivers. Not sure where I got the older ones from, though.

              Comment


              • #17
                Originally posted by Dard
                The bad register names probably happened because my flags for m32 compiling were still active which caused the 64bit compile to fail.
                Duh, of course. |-/
                That's why my script declares the flags on the same line as the configuration....

                Originally posted by Dard
                This actually compiles and installs!

                It doesn't seem to help me much though.
                My reference wine application (the Max Payne demo) seems to try to use the drivers, but crashes with a big stack trace of libwine.
                Great!

                This one or this one?
                Is the problem Wine or r600g [in which case, post the errors or inquire on #radeon]? Have you tried different versions of Wine? (Wheezy doesn't have one right now, does it?)

                Originally posted by Dard
                64bit compile still fails, because of the pciaccess problem.
                What pciaccess problem? (Never seen it....) Could you post some of the errors?

                Comment


                • #18
                  Originally posted by utrrrongeeb View Post
                  May Payne 1 Demo.
                  Originally posted by utrrrongeeb View Post
                  Is the problem Wine or r600g [in which case, post the errors or inquire on #radeon]? Have you tried different versions of Wine? (Wheezy doesn't have one right now, does it?)
                  Not yet.
                  I use a self-compiled git version about two or three months old.

                  Here are parts of the stack trace. They look wine-specific, although they only seem to happen with this compiled driver:
                  Code:
                  wine: Unhandled exception 0xe06d7363 at address 0x7ee23912 (thread 0009), starting debugger...
                  Unhandled exception: C++ exception(object = 0x00000000, type = 0x7c44d438) in 32-bit code (0x7ee23912).
                  
                  ...
                  
                  Backtrace:
                  =>0 0x7ee23912 RaiseException+0x52(code=0xe06d7363, flags=0x1, nbargs=<is not available>, args=0x33e684) [/root/software/wine/wine/dlls/kernel32/except.c:84] in kernel32 (0x0033e668)
                    1 0x7e80e74c _CxxThrowException+0x3b(object=(nil), type=(nil)) [/root/software/wine/wine/dlls/msvcrt/cppexcept.c:481] in msvcrt (0x0033e698)
                    2 0x0040b4ba in maxpaynedemo (+0xb4b9) (0x0033fd94)
                    3 0x0040b77f in maxpaynedemo (+0xb77e) (0x0033fdc8)
                    4 0x0040b8ce in maxpaynedemo (+0xb8cd) (0x0033fe90)
                    5 0x7ee435ec call_process_entry+0xb() in kernel32 (0x0033fea8)
                    6 0x7ee4421f start_process+0x5e(peb=0x7ffdf000) [/root/software/wine/wine/dlls/kernel32/process.c:1087] in kernel32 (0x0033fee8)
                    7 0x7efb8f58 call_thread_func+0xb() in ntdll (0x0033fef8)
                    8 0x7efbc67e call_thread_entry_point+0x6d(entry=0x7ee441c0, arg=0x7ffdf000) [/root/software/wine/wine/dlls/ntdll/signal_i386.c:2499] in ntdll (0x0033ffc8)
                    9 0x7ef918ae start_process+0x1d(kernel_start=0x7ee441c0) [/root/software/wine/wine/dlls/ntdll/loader.c:2612] in ntdll (0x0033ffe8)
                    10 0xf760498d wine_call_on_stack+0x1c() in libwine.so.1 (0x00000000)
                  0x7ee23912 RaiseException+0x52 [/root/software/wine/wine/dlls/kernel32/except.c:84] in kernel32: subl	$4,%esp
                  84	    RtlRaiseException( &record );
                  
                  ...
                  
                  Backtrace:
                  =>0 0x7ee23912 RaiseException+0x52(code=0xe06d7363, flags=0x1, nbargs=<is not available>, args=0x33e684) [/root/software/wine/wine/dlls/kernel32/except.c:84] in kernel32 (0x0033e668)
                    1 0x7e80e74c _CxxThrowException+0x3b(object=(nil), type=(nil)) [/root/software/wine/wine/dlls/msvcrt/cppexcept.c:481] in msvcrt (0x0033e698)
                    2 0x0040b4ba in maxpaynedemo (+0xb4b9) (0x0033fd94)
                    3 0x0040b77f in maxpaynedemo (+0xb77e) (0x0033fdc8)
                    4 0x0040b8ce in maxpaynedemo (+0xb8cd) (0x0033fe90)
                    5 0x7ee435ec call_process_entry+0xb() in kernel32 (0x0033fea8)
                    6 0x7ee4421f start_process+0x5e(peb=0x7ffdf000) [/root/software/wine/wine/dlls/kernel32/process.c:1087] in kernel32 (0x0033fee8)
                    7 0x7efb8f58 call_thread_func+0xb() in ntdll (0x0033fef8)
                    8 0x7efbc67e call_thread_entry_point+0x6d(entry=0x7ee441c0, arg=0x7ffdf000) [/root/software/wine/wine/dlls/ntdll/signal_i386.c:2499] in ntdll (0x0033ffc8)
                    9 0x7ef918ae start_process+0x1d(kernel_start=0x7ee441c0) [/root/software/wine/wine/dlls/ntdll/loader.c:2612] in ntdll (0x0033ffe8)
                    10 0xf760498d wine_call_on_stack+0x1c() in libwine.so.1 (0x00000000)
                  Originally posted by utrrrongeeb View Post
                  What pciaccess problem? (Never seen it....) Could you post some of the errors?
                  I already had a pciaccess problem earlier in this thread. This one may be different, the earlier was "incompatible" now is probably "missing".
                  Anyway, compiling 64bit Mesa was never a problem so I didn't look further into it. (and removed that section from your script)
                  These are my commands for 64bit:
                  Code:
                  cd drm/
                  git pull
                  ./autogen.sh --prefix=/usr/local/xorg --disable-intel
                  make -j 3
                  make install
                  make clean
                  cd ..
                  
                  export PKG_CONFIG_PATH="/usr/local/xorg/lib/pkgconfig"
                  cd xf86-video-ati/
                  git pull
                  ./autogen.sh --prefix=/usr/local/xorg
                  make -j 3
                  make install
                  make clean
                  cd ..
                  
                  cd mesa/
                  git pull
                  ./autogen.sh --prefix=/usr/local/xorg --with-gallium-drivers=r600,swrast --with-dri-driverdir=/usr/local/xorg/lib/dri/ --enable-64-bit --disable-32-bit 
                  make -j 3
                  make install
                  make clean
                  cd ..
                  They always worked.
                  Last edited by Dard; 28 August 2011, 03:26 PM.

                  Comment


                  • #19
                    If 64-bit Mesa compiles, there isn't a problem anymore? :-)

                    /usr/lib/libpciaccess.so.0 is in the libpciaccess0 package and the libpciaccess-dev package -- if both are installed, those flags aren't the problem, and if you're only compiling 64-bit xf86-video-ati, it should be all right... but I could be wrong again. :-(

                    As Wine goes, I've been using the Ubuntu Natty blob. I haven't used it much, and watch out -- it hooks its garbage Wine Notepad and Wine Internet Explorer to all your file-type preferences -- quite annoying -- but it might be worth a try?

                    Comment

                    Working...
                    X