Opened 8 years ago

Closed 7 years ago

#9994 closed Bug Report - General (Won't Fix)

Mythmusic: commit c9fc987 breaks Linux build

Reported by: Lawrence Rust <lvr@…> Owned by: paulh
Priority: minor Milestone: unknown
Component: Plugin - MythMusic Version: Master Head
Severity: medium Keywords: goom sse2
Cc: Ticket locked: no

Description

Commit c9fc987 (add faster zoom filter in goom that uses sse2 when available) causes compilation to fail with:

CC goom/zoom_filter_sse2.c goom/zoom_filter_sse2.c: In function ‘zoom_filter_sse2’: goom/zoom_filter_sse2.c:64:9: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’ goom/zoom_filter_sse2.c:30:9: error: ‘asm’ operand has impossible constraints goom/zoom_filter_sse2.c:64:9: error: ‘asm’ operand has impossible constraints make[2]: * [zoom_filter_sse2.o] Error 1 make[1]: * [sub-mythmusic-make_default] Error 2 make: * [sub-mythmusic-make_default] Error 2

This is after a make clean and a re-config

gcc --version gcc (Ubuntu/Linaro? 4.5.2-8ubuntu4) 4.5.2

Attachments (2)

config.h (31.6 KB) - added by Lawrence Rust <lvr@…> 8 years ago.
config.mak (30.7 KB) - added by Lawrence Rust <lvr@…> 8 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 8 years ago by Jonathan <jonathan@…>

Lawrence, did you already try building 641f3ad72c5311e56b6c67f89d8fd273dd1484ad or later? A fix for linux 32bit was committed in that one.

Here is the changeset: https://github.com/MythTV/mythtv/commit/641f3ad72

comment:2 Changed 8 years ago by Lawrence Rust <lvr@…>

Yes, that fix has been applied. I'm building v0.25pre-3128-g712bc28.

If I revert these 2 changes then all is well. Looks like a gcc asm problem.

comment:3 Changed 8 years ago by beirdo

The buildbot seems to have no problems with this. You will need to give a bit more salient details if you want this one fixed in a timely fashion.

comment:4 Changed 8 years ago by diespambox@…

What additional Inforamtion do you need? I get the same error building mythmusic with the latest

 * mythtv-0.25_pre20110818.tar.gz RMD160 SHA1 SHA256 size ;-) ...        [ ok ]
 * Package:    media-plugins/mythmusic-0.25_pre20110818
 * Repository: Mythtv-Ebuilds
 * USE:        aac elibc_glibc fftw kernel_linux opengl sdl userland_GNU x86
 * FEATURES:   sandbox
>>> Unpacking source...
>>> Unpacking mythtv-0.25_pre20110818.tar.gz to /var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work
>>> Source unpacked in /var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work
>>> Preparing source in /var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work/MythTV-mythtv-42dfafe/mythplugins ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work/MythTV-mythtv-42dfafe/mythplugins ...
./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --compile-type=release --disable-mytharchive --disable-mythbrowser --disable-mythgallery --disable-mythgame --enable-mythmusic --disable-mythnetvision --disable-mythnews --disable-mythweather --disable-mythzoneminder --enable-fftw --enable-sdl --enable-opengl --disable-libvisual

Configuration settings:

        qmake          /usr/bin/qmake

        MythArchive    plugin will not be built
        MythBrowser    plugin will not be built
        MythGallery    plugin will not be built
        MythGame       plugin will not be built
        MythMusic      plugin will be built
        MythNetvision  plugin will not be built
        MythNews       plugin will not be built
        MythWeather    plugin will not be built
        MythZoneMinder plugin will not be built
        OpenGL         support will be included in MythMusic
        libvisual      support will not be included in MythMusic
        FFTW v.3       support will be included in MythMusic
        SDL            support will be included in MythMusic
>>> Source configured.
>>> Compiling source in /var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work/MythTV-mythtv-42dfafe/mythplugins ...
make -j 4 
cd cleanup/ && make -f Makefile 
cd mythmusic/ && /usr/bin/qmake /var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work/MythTV-mythtv-42dfafe/mythplugins/mythmusic/mythmusic.pro -o Makefile
make[1]: Entering directory `/var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work/MythTV-mythtv-42dfafe/mythplugins/cleanup'
make[1]: Nothing to be done for `check'.


[... removed ...]

lity-inlines-hidden -Wmissing-declarations -fvisibility=hidden -fomit-frame-pointer -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D_REENTRANT -Wall -W -DPIC -fPIC -fvisibility=hidden -D_GNU_SOURCE -DPREFIX="/usr" -DMMX -Di386 -D_FILE_OFFSET_BITS=64 -DMPLUGIN_API -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WEBKIT_LIB -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -I/usr/include -I/usr/include -I/usr -I/usr/include -I/usr/include/libxml2 -I/usr/include/mythtv -I/usr/include/mythtv/libmythbase -I/usr/include/mythtv/libmythui -I/usr/include/mythtv/libmyth -I/usr/include/taglib -I/usr/include/cdda -I/usr/X11R6/include -I. -o mythgoom.o goom/mythgoom.cpp
gcc -c -pipe -O2 -march=i686 -pipe -D_REENTRANT -Wall -W -DPIC -fPIC -D_GNU_SOURCE -DPREFIX="/usr" -DMMX -Di386 -D_FILE_OFFSET_BITS=64 -DMPLUGIN_API -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WEBKIT_LIB -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -I/usr/include -I/usr/include -I/usr -I/usr/include -I/usr/include/libxml2 -I/usr/include/mythtv -I/usr/include/mythtv/libmythbase -I/usr/include/mythtv/libmythui -I/usr/include/mythtv/libmyth -I/usr/include/taglib -I/usr/include/cdda -I/usr/X11R6/include -I. -o zoom_filter_sse2.o goom/zoom_filter_sse2.c 
goom/zoom_filter_sse2.c: In function ‘zoom_filter_sse2’:
goom/zoom_filter_sse2.c:64: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
goom/zoom_filter_sse2.c:30: error: ‘asm’ operand has impossible constraints
goom/zoom_filter_sse2.c:64: error: ‘asm’ operand has impossible constraints
make[2]: *** [zoom_filter_sse2.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work/MythTV-mythtv-42dfafe/mythplugins/mythmusic/mythmusic'
make[1]: *** [sub-mythmusic-make_default] Error 2
make[1]: Leaving directory `/var/tmp/portage/media-plugins/mythmusic-0.25_pre20110818/work/MythTV-mythtv-42dfafe/mythplugins/mythmusic'
make: *** [sub-mythmusic-make_default] Error 2
emake failed

[...]

comment:5 Changed 8 years ago by Lawrence Rust <lvr@…>

This looks like a gcc CPU/architecture problem. This is my configure:

./configure --prefix=/home/lvr/Projects/myth/mythinstall --runprefix=.. --qmake=/home/lvr/Projects/myth/mythbuild/qt-everywhere-opensource-src-4.7.0/bin/qmake --arch=x86 --sysinclude=/home/lvr/Projects/myth/mythinstall/include --extra-cflags=-I/home/lvr/Projects/myth/mythinstall/include --extra-cxxflags=-I/home/lvr/Projects/myth/mythinstall/include --extra-libs=-L/home/lvr/Projects/myth/mythinstall/lib --disable-avdevice --disable-avfilter --enable-libfftw3 --disable-joystick-menu --compile-type=debug # Basic Settings Compile type debug Compiler cache yes DistCC no qmake /home/lvr/Projects/myth/mythbuild/qt-everywhere-opensource-src-4.7.0/bin/qmake install prefix /home/lvr/Projects/myth/mythinstall runtime prefix .. CPU x86 x86_32 (model name : Intel(R) Core(TM) i5 CPU 661 @ 3.33GHz) yasm yes MMX enabled yes MMX2 enabled yes 3DNow! enabled yes 3DNow! extended enabled yes SSE enabled yes SSSE3 enabled yes CMOV enabled no

This is the gcc invocation:

ccache gcc -c -pipe -g -D_REENTRANT -Wall -W -DPIC -fPIC -D_GNU_SOURCE -DPREFIX=/home/lvr/Projects/myth/mythinstall -DMMX -Di386 -D_FILE_OFFSET_BITS=64 -DMPLUGIN_API -DQT_PLUGIN -DQT_WEBKIT_LIB -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../mythinstall/mkspecs/linux-g++ -I. -I../../../../mythinstall/include/QtCore -I../../../../mythinstall/include/QtNetwork -I../../../../mythinstall/include/QtGui -I../../../../mythinstall/include/QtOpenGL -I../../../../mythinstall/include/QtXml -I../../../../mythinstall/include/QtSql -I../../../../mythinstall/include/Qt3Support -I../../../../mythinstall/include/QtWebKit -I../../../../mythinstall/include -I../../../../mythinstall/include -I../../../../mythinstall/include -I../../../../mythinstall -I/usr/include -I../../../../mythinstall/include/libxml2 -I../../../../mythinstall/include/mythtv -I../../../../mythinstall/include/mythtv/libmythbase -I../../../../mythinstall/include/mythtv/libmythui -I../../../../mythinstall/include/mythtv/libmyth -I../../../../mythinstall/include/libvisual-0.4 -I../../../../mythinstall/include/taglib -I/usr/include/cdio -I/usr/X11R6/include -I. -o zoom_filter_sse2.o goom/zoom_filter_sse2.c

comment:6 Changed 8 years ago by foobum@…

Hand written, untested patch:

zoom_filter_sse2.c

line 62:
         if ((pos2y >= (int)ay) || (pos2x >= (int)ax))
             pos2 = coeff2 = 0;

+        expix2 += count;
              

line 104:
             "packuswb   %%xmm5, %%xmm4  \n\t"
-            "movq       %%xmm4,(%6,%7,4)\n\t"
+            "movq       %%xmm4,(%6)     \n\t"
             ::"m"(coeff1),"m"(coeff2),"r"(expix1),"r"(pos1),"r"(pos2),
-            "r"((long)prevX),"r"(expix2),"r"(count)"
+            "r"((long)prevX),"r"(expix2)
         );

comment:7 Changed 8 years ago by foobum@…

Oops, that won't work. Try this instead.

line 104:
             "packuswb   %%xmm5, %%xmm4  \n\t"
-            "movq       %%xmm4,(%6,%7,4)\n\t"
+            "movq       %%xmm4,(%6)     \n\t"
             ::"m"(coeff1),"m"(coeff2),"r"(expix1),"r"(pos1),"r"(pos2),
-            "r"((long)prevX),"r"(expix2),"r"(count)"
+            "r"((long)prevX),"r"(expix2)
         );
+
+        expix2 += 2;
+
     }
 }

comment:8 Changed 8 years ago by Lawrence Rust <lvr@…>

OK, both patches fix the compilation. I'm not in a position to test the end result as I don't know what I'm looking for - visuals, performance, edge conditions...

comment:9 Changed 8 years ago by beirdo

Status: newinfoneeded_new

See also #9995.

Can you provide the config.mak and config.h outputs from ./configure? (attach to the ticket). I think the true issue may be involved with the build conditionals being not quite right, and this would be how to know for sure.

Changed 8 years ago by Lawrence Rust <lvr@…>

Attachment: config.h added

Changed 8 years ago by Lawrence Rust <lvr@…>

Attachment: config.mak added

comment:10 Changed 8 years ago by Lawrence Rust <lvr@…>

Attached config.h and config.mak. NB will be away for next week or so.

comment:11 Changed 8 years ago by foobum@…

The problem is just that gcc can't find enough free gp registers to fulfill the requirements of the inline asm. The second patch above is logically the same as the original code but requires one less gp register in the asm. Test by using the goom visualisation - it'll look odd if the code is wrong..

comment:12 Changed 8 years ago by robertm

Status: infoneeded_newnew

comment:13 Changed 7 years ago by paulh

Resolution: Won't Fix
Status: newclosed

I'm abandoning this for now, I would at some stage like to update our very old goom to goom2k4 at which time I may revisit it. Closing as wont fix since we don't have a 'can't be arsed' resolution :)

Note: See TracTickets for help on using tickets.