Message ID | 448C3EC1.4020207@gmx.de |
---|---|
State | New |
Headers |
Received: from mail.gmx.de ([213.165.64.21] helo=mail.gmx.net) by www.linuxtv.org with smtp (Exim 4.50) id 1FpSPh-0004Ar-B7 for vdr@linuxtv.org; Sun, 11 Jun 2006 18:03:45 +0200 Received: (qmail invoked by alias); 11 Jun 2006 16:03:14 -0000 Received: from p548A3C1C.dip0.t-ipconnect.de (EHLO [192.168.73.1]) [84.138.60.28] by mail.gmx.net (mp037) with SMTP; 11 Jun 2006 18:03:14 +0200 X-Authenticated: #1417946 Message-ID: <448C3EC1.4020207@gmx.de> Date: Sun, 11 Jun 2006 18:03:13 +0200 From: Udo Richter <udo_richter@gmx.de> User-Agent: Thunderbird 2.0a1 (Windows/20060609) MIME-Version: 1.0 To: VDR Mailing List <vdr@linuxtv.org> Subject: Re: [vdr] VDR version 1.4.1, pic issue References: <448BE671.3020100@cadsoft.de> <200606111559.14428.prakash@punnoor.de> In-Reply-To: <200606111559.14428.prakash@punnoor.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List <vdr@linuxtv.org> List-Id: VDR Mailing List <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> X-List-Received-Date: Sun, 11 Jun 2006 16:03:45 -0000 Status: O X-Status: X-Keywords: X-UID: 9771 |
Commit Message
Udo Richter
June 11, 2006, 4:03 p.m. UTC
Prakash Punnoor wrote: > But If I set flags in Make.conf, the -fPIc doesn't get > added for plugins, and I can't seem to make this happen by patching (I don't > know much about Makefile syntax) other than adding -fPIC directly into > the %.o: %.c rule line in each plugin's Makefile. This is a fundamental problem, since Make.config is used for VDR core *and* plugins. There is currently no mechanism to set CXXFLAGS for plugins differently than for core VDR. Probably the easiest way is to add -fPIC to Make.config anyway, even if core VDR doesn't need it. Enforcing the -fPIC flag even if it is not part of CXXFLAGS is not the way to go, you cannot expect every compiler to understand it. Implementing something like PLUGINCXXFLAGS for plugins would do the job, but since you'll never get all plugins to support it, its not the final solution either. Another good solution would be to do a conditional part in Make.config, like this: The existence of the PLUGIN makefile variable should work for almost all plugins. Another way would be to set some marker variable at the beginning of the VDR Makefile, or to move the VDRVERSION declaration in front of the -include statement. (but of course for core VDR only, not for plugin makefiles) Cheers, Udo
Comments
Udo Richter wrote: > Prakash Punnoor wrote: >> But If I set flags in Make.conf, the -fPIc doesn't get added for >> plugins, and I can't seem to make this happen by patching (I don't >> know much about Makefile syntax) other than adding -fPIC directly into >> the %.o: %.c rule line in each plugin's Makefile. > > This is a fundamental problem, since Make.config is used for VDR core > *and* plugins. There is currently no mechanism to set CXXFLAGS for > plugins differently than for core VDR. > > Probably the easiest way is to add -fPIC to Make.config anyway, even if > core VDR doesn't need it. Enforcing the -fPIC flag even if it is not > part of CXXFLAGS is not the way to go, you cannot expect every compiler > to understand it. > > Implementing something like PLUGINCXXFLAGS for plugins would do the job, > but since you'll never get all plugins to support it, its not the final > solution either. > > Another good solution would be to do a conditional part in Make.config, > like this: > --- Make.config.template 2006-05-28 15:08:29.687375000 +0200 > +++ Make.config.template 2006-06-11 17:50:14.467000000 +0200 > @@ -16,6 +16,11 @@ > CXX = g++ > CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual > > +ifdef PLUGIN > +CFLAGS += -fPIC > +CXXFLAGS += -fPIC > +endif > + > ### The directory environment: > > #DVBDIR = /usr/src/v4l-dvb/linux > > The existence of the PLUGIN makefile variable should work for almost all > plugins. Another way would be to set some marker variable at the > beginning of the VDR Makefile, or to move the VDRVERSION declaration in > front of the -include statement. (but of course for core VDR only, not > for plugin makefiles) Maybe it would have been better to leave the -fPIC thing as it has been for so long - as it is now, plugins will actually be compiled _without_ it, which is probably a lot worse than compiling the main program _with_ it... Klaus
Am Sonntag Juni 11 2006 23:36 schrieb Klaus Schmidinger: > Udo Richter wrote: [...] > > Another good solution would be to do a conditional part in Make.config, > > like this: > > --- Make.config.template 2006-05-28 15:08:29.687375000 +0200 > > +++ Make.config.template 2006-06-11 17:50:14.467000000 +0200 > > @@ -16,6 +16,11 @@ > > CXX = g++ > > CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual > > > > +ifdef PLUGIN > > +CFLAGS += -fPIC > > +CXXFLAGS += -fPIC > > +endif > > + > > ### The directory environment: > > > > #DVBDIR = /usr/src/v4l-dvb/linux > > [...] > > Maybe it would have been better to leave the -fPIC thing as it has been > for so long - as it is now, plugins will actually be compiled _without_ > it, which is probably a lot worse than compiling the main program _with_ > it... Just to note: Udo's patch works fine here. :-)
--- Make.config.template 2006-05-28 15:08:29.687375000 +0200 +++ Make.config.template 2006-06-11 17:50:14.467000000 +0200 @@ -16,6 +16,11 @@ CXX = g++ CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual +ifdef PLUGIN +CFLAGS += -fPIC +CXXFLAGS += -fPIC +endif + ### The directory environment: #DVBDIR = /usr/src/v4l-dvb/linux