analogtv compile problems against vdr-1.3.46

Message ID 01d901c66c7d$6e45fc70$6401010a@InetX.com
State New
Headers

Commit Message

Linux TV April 30, 2006, 5:42 p.m. UTC
  Hi
I'm having problems getting the plugin to compile.

First run, I got:
Plugin analogtv:
make[1]: Entering directory 
`/home/vdruser/vdr-1.3.46_analog/PLUGINS/src/analogtv-0.9.39'
make[1]: Leaving directory 
`/home/vdruser/vdr-1.3.46_analog/PLUGINS/src/analogtv-0.9.39'
make[1]: Entering directory 
`/home/vdruser/vdr-1.3.46_analog/PLUGINS/src/analogtv-0.9.39'
g++ -Wall -fPIC -g -O2 -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"' 
 -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include analogtv.c
analogtv.c: In constructor âcPluginAnalogtv::cPluginAnalogtv()â:
analogtv.c:88: error: âAPIVERSIONâ was not declared in this scope
make[1]: *** [analogtv.o] Error 1

Seen this before - so tried this:

but now I get:

Plugin analogtv:
make[1]: Entering directory 
`/home/vdruser/vdr-1.3.46_analog/PLUGINS/src/analogtv-0.9.39'
g++ -Wall -fPIC -g -O2 -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"' 
 -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include analogtv.c
g++ -Wall -fPIC -g -O2 -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"' 
 -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include cpu_accel.c
cpu_accel.c: In function âuint32_t mm_accel()':
cpu_accel.c:76: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:81: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:87: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:98: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:102: error: can't find a register in class 'BREG' while 
reloading 'asm'
make[1]: *** [cpu_accel.o] Error 1


Any ideas?
  

Comments

Darren Salt April 30, 2006, 5:58 p.m. UTC | #1
I demand that Simon Baxter may or may not have written...

[snip]
> Plugin analogtv:
> make[1]: Entering directory
> `/home/vdruser/vdr-1.3.46_analog/PLUGINS/src/analogtv-0.9.39'
> g++ -Wall -fPIC -g -O2 -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"'
>  -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include analogtv.c
> g++ -Wall -fPIC -g -O2 -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"'
>  -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include cpu_accel.c
> cpu_accel.c: In function âuint32_t mm_accel()':
> cpu_accel.c:76: error: can't find a register in class 'BREG' while reloading
> 'asm'
[snip]
> Any ideas?

Forcing that file to be compiled with -Os instead of -O2 should work.
  
Linux TV April 30, 2006, 7:10 p.m. UTC | #2
> [snip]
>> Plugin analogtv:
>> make[1]: Entering directory
>> `/home/vdruser/vdr-1.3.46_analog/PLUGINS/src/analogtv-0.9.39'
>> g++ -Wall -fPIC -g -O2 -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"'
>>  -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include analogtv.c
>> g++ -Wall -fPIC -g -O2 -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"'
>>  -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include cpu_accel.c
>> cpu_accel.c: In function âuint32_t mm_accel()':
>> cpu_accel.c:76: error: can't find a register in class 'BREG' while 
>> reloading
>> 'asm'
> [snip]
>> Any ideas?
>
> Forcing that file to be compiled with -Os instead of -O2 should work.

Ok, here's another visable hole in my knowledge.
Makefile:
[snip]
CXX      ?= g++
OPTFLAGS 
?= -O4 -march=i486 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT 
 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CXXFLAGS ?= $(OPTFLAGS) -Wall -Woverloaded-virtual
[snip]

How do I do this?  Do I need to select specific CXXFLAGS in Makefile for 
cpu_accel.c?

Should I globally change OPTFLAGS to us -Os rather than -O4 ??
  
Darren Salt April 30, 2006, 7:36 p.m. UTC | #3
I demand that Simon Baxter may or may not have written...

>> [snip]
>>> Plugin analogtv:
[snip]
>>> cpu_accel.c: In function âuint32_t mm_accel()':
>>> cpu_accel.c:76: error: can't find a register in class 'BREG' while
>>> reloading
>>> 'asm'
>> [snip]
>>> Any ideas?

>> Forcing that file to be compiled with -Os instead of -O2 should work.

> Ok, here's another visible hole in my knowledge.
> Makefile:
> [snip]
> CXX      ?= g++
> OPTFLAGS ?= -O4 -march=i486 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> CXXFLAGS ?= $(OPTFLAGS) -Wall -Woverloaded-virtual
> [snip]

> How do I do this?  Do I need to select specific CXXFLAGS in Makefile for
> cpu_accel.c?

cpu_accel.o: override CXXFLAGS=$(shell echo "$(CXXFLAGS)" | sed s/-O[0-9]/-Os/g)

(Note: untested.)

> Should I globally change OPTFLAGS to use -Os rather than -O4 ??

That shouldn't be needed.
  
Linux TV April 30, 2006, 9:23 p.m. UTC | #4
>>> [snip]
>>>> Plugin analogtv:
> [snip]
>>>> cpu_accel.c: In function âuint32_t mm_accel()':
>>>> cpu_accel.c:76: error: can't find a register in class 'BREG' while
>>>> reloading
>>>> 'asm'
>>> [snip]
>>>> Any ideas?
>
>>> Forcing that file to be compiled with -Os instead of -O2 should work.

Nope - still have the same problem with cpu_accel.c

g++  -fPIC -g -Os -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"' 
 -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include cpu_accel.c
cpu_accel.c: In function 'uint32_t mm_accel()':
cpu_accel.c:76: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:81: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:87: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:98: error: can't find a register in class 'BREG' while reloading 
'asm'
cpu_accel.c:102: error: can't find a register in class 'BREG' while 
reloading 'asm'



Any other ideas???
  
Darren Salt April 30, 2006, 10:31 p.m. UTC | #5
I demand that Simon Baxter may or may not have written...

[snip]
> Nope - still have the same problem with cpu_accel.c

> g++  -fPIC -g -Os -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"'
>  -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include cpu_accel.c
> cpu_accel.c: In function 'uint32_t mm_accel()':
> cpu_accel.c:76: error: can't find a register in class 'BREG' while reloading 'asm'
[snip]

> Any other ideas???

Drop -g? Presuming i386, drop -fPIC?
  
Chad Flynt May 1, 2006, 1:46 a.m. UTC | #6
I personally just wanted to say thanks like everyone else to Klaus for 
having a vision and giving so much to us.  Thanks for all your hard work 
and dedication.  On top of that, it isn't just Klaus that is involved.  
Thanks to all the Developers out there that have truly made VDR what it 
is today.  By far it is the top notch.  So just my 2 cents in saying 
thank you, and we all I am sure hope you continue to make things even 
better for us!

Chad Flynt
aka Hoochster
  
Linux TV May 2, 2006, 12:18 a.m. UTC | #7
> [snip]
>> Nope - still have the same problem with cpu_accel.c
>
>> g++  -fPIC -g -Os -Wall -Woverloaded-virtual -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"analogtv"'
>>  -DHAVE_FAST_MEMCPY -DNEED_OWN_SIP -I../../../include cpu_accel.c
>> cpu_accel.c: In function 'uint32_t mm_accel()':
>> cpu_accel.c:76: error: can't find a register in class 'BREG' while 
>> reloading 'asm'
> [snip]
>
>> Any other ideas???
>
> Drop -g? Presuming i386, drop -fPIC?

dropping -g & -fPIC allows the above commandline to work, but despite trying 
I'm having no luck modifying the Makefile to do it during the make.

This includes your previous suggestion 'cpu_accel.o: override 
CXXFLAGS=$(shell echo "$(CXXFLAGS)" | sed s/-O[0-9]/-Os/g)'

No matter where I put this in the Makefile, I can't get the 'make' to 'sed' 
the -O2 to -Os.   I'm not familiar with the 'override' and can't get it to 
work.

Where would I put -
'cpu_accel.o: override CXXFLAGS=$(shell echo "$(CXXFLAGS)" | sed 
s/-fPIC\ -g\ //g)'

Simon
  

Patch

--- PLUGINS/src/analogtv/analogtv.c.org 2006-04-30 10:42:36.000000000 -0700
+++ PLUGINS/src/analogtv/analogtv.c     2006-04-30 10:39:58.000000000 -0700
@@ -85,7 +85,7 @@ 
   else
     d(0, "Cannot detect kernel version");

-  sprintf(vdrver, "%s", APIVERSION);
+  sprintf(vdrver, "%s", VDRVERSION);

 #if VDRVERSNUM >= 10300
   sy = "\n\t\tW A R N I N G: Unstable development version!";