Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
@ 2022-12-12 18:30 lilotom
  2022-12-12 20:26 ` Timo Rothenpieler
  2022-12-12 20:48 ` Carl Eugen Hoyos
  0 siblings, 2 replies; 8+ messages in thread
From: lilotom @ 2022-12-12 18:30 UTC (permalink / raw)
  To: ffmpeg-devel

Currently -O1 is set to _cflags_noopt, but -O1 is actually for size
optimization instead of no-opt which causes size optimized binaries
been built with --disable-optimizations.

Signed-off-by: Thomson Tan <lilotom@gmail.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index f4eedfc207..388d518345 100755
--- a/configure
+++ b/configure
@@ -4825,7 +4825,7 @@ probe_cc(){
         _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
         _cflags_speed="-O2"
         _cflags_size="-O1"
-        _cflags_noopt="-O1"
+        _cflags_noopt="-Od"
         if $_cc -nologo- 2>&1 | grep -q Linker; then
             _ld_o='-out:$@'
         else
-- 
2.34.1


_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
  2022-12-12 18:30 [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od lilotom
@ 2022-12-12 20:26 ` Timo Rothenpieler
  2022-12-12 20:32   ` Thomson Tan
  2022-12-12 20:48 ` Carl Eugen Hoyos
  1 sibling, 1 reply; 8+ messages in thread
From: Timo Rothenpieler @ 2022-12-12 20:26 UTC (permalink / raw)
  To: ffmpeg-devel

On 12.12.2022 19:30, lilotom@gmail.com wrote:
> Currently -O1 is set to _cflags_noopt, but -O1 is actually for size
> optimization instead of no-opt which causes size optimized binaries
> been built with --disable-optimizations.

It's like this very intentionally, since ffmpeg relies on 
dead-code-elimination in a lot of places, which MSVC does not perform 
when optimizations are turned off.
So optimizations cannot be fully turned off on MSVC.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
  2022-12-12 20:26 ` Timo Rothenpieler
@ 2022-12-12 20:32   ` Thomson Tan
  2022-12-12 20:47     ` Timo Rothenpieler
  0 siblings, 1 reply; 8+ messages in thread
From: Thomson Tan @ 2022-12-12 20:32 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Thanks. Wondering why and where DCE is needed in FFmpeg build?

On Mon, Dec 12, 2022 at 12:26 PM Timo Rothenpieler <timo@rothenpieler.org>
wrote:

> On 12.12.2022 19:30, lilotom@gmail.com wrote:
> > Currently -O1 is set to _cflags_noopt, but -O1 is actually for size
> > optimization instead of no-opt which causes size optimized binaries
> > been built with --disable-optimizations.
>
> It's like this very intentionally, since ffmpeg relies on
> dead-code-elimination in a lot of places, which MSVC does not perform
> when optimizations are turned off.
> So optimizations cannot be fully turned off on MSVC.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
  2022-12-12 20:32   ` Thomson Tan
@ 2022-12-12 20:47     ` Timo Rothenpieler
  0 siblings, 0 replies; 8+ messages in thread
From: Timo Rothenpieler @ 2022-12-12 20:47 UTC (permalink / raw)
  To: ffmpeg-devel

On 12.12.2022 21:32, Thomson Tan wrote:
> Thanks. Wondering why and where DCE is needed in FFmpeg build?

Every single time "HAVE_SOMETHING" or "CONFIG_SOMETHING" is used in a 
normal if() instead of a pre-processor #if.
That's used in a lot of places all over the codebase.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
  2022-12-12 18:30 [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od lilotom
  2022-12-12 20:26 ` Timo Rothenpieler
@ 2022-12-12 20:48 ` Carl Eugen Hoyos
  2022-12-12 21:01   ` Thomson Tan
  1 sibling, 1 reply; 8+ messages in thread
From: Carl Eugen Hoyos @ 2022-12-12 20:48 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Am Mo., 12. Dez. 2022 um 19:30 Uhr schrieb <lilotom@gmail.com>:
>
> Currently -O1 is set to _cflags_noopt, but -O1 is actually for size
> optimization instead of no-opt which causes size optimized binaries
> been built with --disable-optimizations.
>
> Signed-off-by: Thomson Tan <lilotom@gmail.com>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index f4eedfc207..388d518345 100755
> --- a/configure
> +++ b/configure
> @@ -4825,7 +4825,7 @@ probe_cc(){
>          _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
>          _cflags_speed="-O2"
>          _cflags_size="-O1"
> -        _cflags_noopt="-O1"
> +        _cflags_noopt="-Od"

I am curious:
How did you test this patch?

Thank you, Carl Eugen
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
  2022-12-12 20:48 ` Carl Eugen Hoyos
@ 2022-12-12 21:01   ` Thomson Tan
  2022-12-12 21:11     ` Carl Eugen Hoyos
  0 siblings, 1 reply; 8+ messages in thread
From: Thomson Tan @ 2022-12-12 21:01 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

I built the latest FFmpeg with WSL2+MSVC on Windows. Tried configure with
--disable-optimizations, but still got an optimized build which makes it
hard to set breakpoint on hot functions (likely inlined).

On Mon, Dec 12, 2022 at 12:49 PM Carl Eugen Hoyos <ceffmpeg@gmail.com>
wrote:

> Am Mo., 12. Dez. 2022 um 19:30 Uhr schrieb <lilotom@gmail.com>:
> >
> > Currently -O1 is set to _cflags_noopt, but -O1 is actually for size
> > optimization instead of no-opt which causes size optimized binaries
> > been built with --disable-optimizations.
> >
> > Signed-off-by: Thomson Tan <lilotom@gmail.com>
> > ---
> >  configure | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/configure b/configure
> > index f4eedfc207..388d518345 100755
> > --- a/configure
> > +++ b/configure
> > @@ -4825,7 +4825,7 @@ probe_cc(){
> >          _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
> >          _cflags_speed="-O2"
> >          _cflags_size="-O1"
> > -        _cflags_noopt="-O1"
> > +        _cflags_noopt="-Od"
>
> I am curious:
> How did you test this patch?
>
> Thank you, Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
  2022-12-12 21:01   ` Thomson Tan
@ 2022-12-12 21:11     ` Carl Eugen Hoyos
  2022-12-14 17:55       ` Thomson Tan
  0 siblings, 1 reply; 8+ messages in thread
From: Carl Eugen Hoyos @ 2022-12-12 21:11 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Am Mo., 12. Dez. 2022 um 22:02 Uhr schrieb Thomson Tan <lilotom@gmail.com>:
>
> I built the latest FFmpeg with WSL2+MSVC on Windows. Tried configure
> with --disable-optimizations, but still got an optimized build which makes
> it hard to set breakpoint on hot functions (likely inlined).

Of course, this explains why you wrote the patch.
But I still wonder how you tested it.

Please find out what top-posting means and avoid it here, Carl Eugen
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od
  2022-12-12 21:11     ` Carl Eugen Hoyos
@ 2022-12-14 17:55       ` Thomson Tan
  0 siblings, 0 replies; 8+ messages in thread
From: Thomson Tan @ 2022-12-14 17:55 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

With this configuration (WSL2+MSVC) for this diff, I ran `make fate-rsync
SAMPLES=fate-suite && make fate SAMPLES=fate-suite/` which passed locally.
I also checked the binaries (ffmpeg.exe) and made sure the previous inlined
functions are not inlined here.

On Mon, Dec 12, 2022 at 1:13 PM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:

> Am Mo., 12. Dez. 2022 um 22:02 Uhr schrieb Thomson Tan <lilotom@gmail.com
> >:
> >
> > I built the latest FFmpeg with WSL2+MSVC on Windows. Tried configure
> > with --disable-optimizations, but still got an optimized build which
> makes
> > it hard to set breakpoint on hot functions (likely inlined).
>
> Of course, this explains why you wrote the patch.
> But I still wonder how you tested it.
>
> Please find out what top-posting means and avoid it here, Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-14 17:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12 18:30 [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od lilotom
2022-12-12 20:26 ` Timo Rothenpieler
2022-12-12 20:32   ` Thomson Tan
2022-12-12 20:47     ` Timo Rothenpieler
2022-12-12 20:48 ` Carl Eugen Hoyos
2022-12-12 21:01   ` Thomson Tan
2022-12-12 21:11     ` Carl Eugen Hoyos
2022-12-14 17:55       ` Thomson Tan

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git