diff mbox

[FFmpeg-devel] Makefile: generate stripped CLI tools directly instead of copying unstripped ones first

Message ID 20171006202053.29439-1-cus@passwd.hu
State Superseded
Headers show

Commit Message

Marton Balint Oct. 6, 2017, 8:20 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

James Almer Oct. 6, 2017, 11:20 p.m. UTC | #1
On 10/6/2017 5:20 PM, Marton Balint wrote:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  Makefile | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 4a1253a052..adb8330fa0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -97,8 +97,7 @@ include $(SRC_PATH)/doc/examples/Makefile
>  libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
>  
>  $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
> -	$(CP) $< $@
> -	$(STRIP) $@
> +	$(STRIP) -o $@ $<

LGTM. This is the best thing after stripping on install, which seems to
be disliked.

>  
>  %$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
>  	$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
>
James Almer Oct. 6, 2017, 11:26 p.m. UTC | #2
On 10/6/2017 8:20 PM, James Almer wrote:
> On 10/6/2017 5:20 PM, Marton Balint wrote:
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  Makefile | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 4a1253a052..adb8330fa0 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -97,8 +97,7 @@ include $(SRC_PATH)/doc/examples/Makefile
>>  libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
>>  
>>  $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
>> -	$(CP) $< $@
>> -	$(STRIP) $@
>> +	$(STRIP) -o $@ $<
> 
> LGTM. This is the best thing after stripping on install, which seems to
> be disliked.

Actually, configure seems to consider cases where STRIP is something
else than binutils' strip.

I guess it's known and tested to work with the to-be-stripped binary as
the only argument, but would -o work with every potential strip program,
or for that matter binutils on every supported platform? I already got
bitten by MacOS's install not accepting -T.

> 
>>  
>>  %$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
>>  	$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
>>
>
Marton Balint Oct. 7, 2017, 9:18 a.m. UTC | #3
On Fri, 6 Oct 2017, James Almer wrote:

> On 10/6/2017 8:20 PM, James Almer wrote:
>> On 10/6/2017 5:20 PM, Marton Balint wrote:
>>> Signed-off-by: Marton Balint <cus@passwd.hu>
>>> ---
>>>  Makefile | 3 +--
>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 4a1253a052..adb8330fa0 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -97,8 +97,7 @@ include $(SRC_PATH)/doc/examples/Makefile
>>>  libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
>>>
>>>  $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
>>> -	$(CP) $< $@
>>> -	$(STRIP) $@
>>> +	$(STRIP) -o $@ $<
>> 
>> LGTM. This is the best thing after stripping on install, which seems to
>> be disliked.
>
> Actually, configure seems to consider cases where STRIP is something
> else than binutils' strip.
>
> I guess it's known and tested to work with the to-be-stripped binary as
> the only argument, but would -o work with every potential strip program,
> or for that matter binutils on every supported platform? I already got
> bitten by MacOS's install not accepting -T.

With the v2 patch I sent, more cases are handled when strip is not a 
traditional strip command.

I did a quick check of online man pages, and it seems to me only some very 
uncommon or very old platforms does not support -o.

So I can either keep the patch as is, (with direct stripping turned on 
by default) and fix OS/platforms as fate detects them, or we can make it 
opt-in for the known platforms, if we are very afraid of breaking stuff.

Regards,
Marton
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 4a1253a052..adb8330fa0 100644
--- a/Makefile
+++ b/Makefile
@@ -97,8 +97,7 @@  include $(SRC_PATH)/doc/examples/Makefile
 libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
 
 $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
-	$(CP) $< $@
-	$(STRIP) $@
+	$(STRIP) -o $@ $<
 
 %$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
 	$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)