[ANNOUNCE] VDR developer version 1.3.49

Message ID 20060429155055.e6674f70.hilse@web.de
State New
Headers

Commit Message

Hans-Werner Hilse April 29, 2006, 1:50 p.m. UTC
  Hi,

On Sat, 29 Apr 2006 15:37:17 +0200 Klaus Schmidinger
<Klaus.Schmidinger@cadsoft.de> wrote:

> Did anybody else receive that posting?
> If so, can you please forward a copy to me?

I've attached it as it's smaller than other peoples' signatures :-)

> >> Or does this patch fix an actual problem?
> > 
> > Well, I don't think compiling too much code as PIC will cause
> > problems (apart from (minor) possible performance lost),
> > nevertheless it is unneeded.
> 
> Is that "compile time" or "runtime" performance?

Should be kind of "execution time", not exactly "runtime". It just adds
a few memory remappings on application startup by updating an address
lookup table. This may cause some additional memory lookups at runtime,
too. Albeit I'm interested in real numbers, I'm pretty sure it won't
affect performance too much.

> Apparently PIC is only available on special processors, especially
> *not* Intel, so I can't test this myself.

Hm, it should be available on intel.

> Let's wait with this until after version 1.4.

There are good reasons for doing it this way, yes.

-hwh
  

Comments

Prakash Punnoor April 29, 2006, 2:09 p.m. UTC | #1
Am Samstag April 29 2006 15:50 schrieb Hans-Werner Hilse:
> Hi,
>
> On Sat, 29 Apr 2006 15:37:17 +0200 Klaus Schmidinger
>
> <Klaus.Schmidinger@cadsoft.de> wrote:
> > Did anybody else receive that posting?
> > If so, can you please forward a copy to me?
>
> I've attached it as it's smaller than other peoples' signatures :-)

Well that patch - as I stated in the updated post - missing one minor thing. 
Sorry for the confusion...

>
> > >> Or does this patch fix an actual problem?
> > >
> > > Well, I don't think compiling too much code as PIC will cause
> > > problems (apart from (minor) possible performance lost),
> > > nevertheless it is unneeded.
> >
> > Is that "compile time" or "runtime" performance?
>
> Should be kind of "execution time", not exactly "runtime". It just adds
> a few memory remappings on application startup by updating an address
> lookup table. This may cause some additional memory lookups at runtime,
> too. Albeit I'm interested in real numbers, I'm pretty sure it won't
> affect performance too much.

Not exactly. You have to distinguish: If you have the choice to load non-PIC 
or PIC shared libs (eg on x86):

PIC generally loads faster, as you don't need text relocations performed 
AFAIK. But PIC is generally slower on execution due to losing the ebx 
register (on x86) and gcc being pedantically dumb to not free it up when it 
could be used even in PIC mode. (There could also be security risks with 
non-PIC shared libs, IIRC.)

On x86-64 for example you have no choice: *shared* libs need to be PIC.

On the other hand *executables* and *static libs* (well it is a wrong term 
actually, they are just a little bit more than a conglomeration of object 
files) generally *don't* need to be PIC. But this is what current VDR 
Makefile does - thus (possibly) wasting performance.


I hope this clears it up. :-)
  

Patch

diff -urd vdr-1.3.49/libsi/Makefile vdr-1.3.49.n/libsi/Makefile
--- vdr-1.3.49/libsi/Makefile	2005-05-29 13:47:12.000000000 +0200
+++ vdr-1.3.49.n/libsi/Makefile	2006-04-29 12:13:59.000000000 +0200
@@ -6,7 +6,7 @@ 
 ### The C++ compiler and options:
 
 CXX      ?= g++
-CXXFLAGS ?= -fPIC -O2 -g -Wall -Woverloaded-virtual
+CXXFLAGS ?= -O2 -g -Wall -Woverloaded-virtual
 AR = ar
 ARFLAGS = ru
 RANLIB = ranlib
diff -urd vdr-1.3.49/Make.config.template vdr-1.3.49.n/Make.config.template
--- vdr-1.3.49/Make.config.template	2006-04-15 14:28:03.000000000 +0200
+++ vdr-1.3.49.n/Make.config.template	2006-04-29 12:32:33.000000000 +0200
@@ -14,7 +14,7 @@ 
 CFLAGS   = -O2
 
 CXX      = g++
-CXXFLAGS = -fPIC -g -O2 -Wall -Woverloaded-virtual
+CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual
 
 ### The directory environment:
 
diff -urd vdr-1.3.49/Makefile vdr-1.3.49.n/Makefile
--- vdr-1.3.49/Makefile	2006-04-24 19:18:06.000000000 +0200
+++ vdr-1.3.49.n/Makefile	2006-04-29 12:33:23.000000000 +0200
@@ -9,10 +9,10 @@ 
 .DELETE_ON_ERROR:
 
 CC       ?= gcc
-CFLAGS   ?= -O2
+CFLAGS   ?= -g -O2 -Wall
 
 CXX      ?= g++
-CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual
+CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual
 
 LSIDIR   = ./libsi
 MANDIR   = /usr/local/man
@@ -175,6 +175,8 @@ 
 # Plugins:
 
 plugins: include-dir
+	CFLAGS="-fPIC $(CFLAGS)"
+	CXXFLAGS="-fPIC $(CXXFLAGS)"
 	@failed="";\
 	noapiv="";\
 	for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do\