* [FFmpeg-devel] [PATCH v3 1/5] configure: simplify bigendian check
@ 2024-04-09 13:50 J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang J. Dekker
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: J. Dekker @ 2024-04-09 13:50 UTC (permalink / raw)
To: ffmpeg-devel
The preferred way to use LTO is --enable-lto but often times packagers
still end up with -flto in cflags for various reasons. Using grep
on binary object files is brittle and relies on specific object
representation, which in the case of LLVM bitcode, debug information or
other intermediary formats can fail silently.
This patch changes the check to a more commonly used define for GCC
style compilers. More checks may be needed to cover other potential
compilers that don't use the __BYTE_ORDER__ define.
Signed-off-by: J. Dekker <jdek@itanimul.li>
---
configure | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/configure b/configure
index f511fbae49..7c22772485 100755
--- a/configure
+++ b/configure
@@ -6120,11 +6120,7 @@ extern_prefix=${sym%%ff_extern*}
check_cc pragma_deprecated "" '_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
-# The global variable ensures the bits appear unchanged in the object file.
-test_cc <<EOF || die "endian test failed"
-unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
-EOF
-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
+test_cpp_condition stdlib.h "defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)" && enable bigendian
check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
--
2.44.0
_______________________________________________
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] 11+ messages in thread
* [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang
2024-04-09 13:50 [FFmpeg-devel] [PATCH v3 1/5] configure: simplify bigendian check J. Dekker
@ 2024-04-09 13:50 ` J. Dekker
2024-04-09 21:52 ` Marth64
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 3/5] configure: switch to shebang without space J. Dekker
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: J. Dekker @ 2024-04-09 13:50 UTC (permalink / raw)
To: ffmpeg-devel
The implicit interpreter is dependent on the environment, and isn't
guaranteed to be /bin/sh. Some packagers call this script directly, and
in certain environments such as containers using qemu-user through
binfmt_misc emulation on Linux it doesn't fallback to /bin/sh.
To fix these cases we add the interpreter explicitly.
Signed-off-by: J. Dekker <jdek@itanimul.li>
---
ffbuild/libversion.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/ffbuild/libversion.sh b/ffbuild/libversion.sh
index a94ab58057..ecaa90cde6 100755
--- a/ffbuild/libversion.sh
+++ b/ffbuild/libversion.sh
@@ -1,3 +1,4 @@
+#!/bin/sh
toupper(){
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}
--
2.44.0
_______________________________________________
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] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang J. Dekker
@ 2024-04-09 21:52 ` Marth64
2024-04-09 22:27 ` Henrik Gramner via ffmpeg-devel
0 siblings, 1 reply; 11+ messages in thread
From: Marth64 @ 2024-04-09 21:52 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> +#!/bin/sh
Might I suggest `#!/usr/bin/env sh` instead for this case?
I tend to prefer it from a portability and usability perspective,
but I can imagine for sh it might not matter.
I am not close to the patch that you are working on.
But thought to throw this out there in case there is a
platform or user relying on unique behaviour here.
Thank you for your time,
_______________________________________________
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] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang
2024-04-09 21:52 ` Marth64
@ 2024-04-09 22:27 ` Henrik Gramner via ffmpeg-devel
2024-04-09 22:52 ` Marth64
0 siblings, 1 reply; 11+ messages in thread
From: Henrik Gramner via ffmpeg-devel @ 2024-04-09 22:27 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Henrik Gramner
On Tue, Apr 9, 2024 at 11:52 PM Marth64 <marth64@proxyid.net> wrote:
> > +#!/bin/sh
> Might I suggest `#!/usr/bin/env sh` instead for this case?
> I tend to prefer it from a portability and usability perspective,
> but I can imagine for sh it might not matter.
/bin/sh exists on virtually every *NIX system whereas /usr/bin/env is
not ubiquitous, so that seems like a terrible idea that would achieve
the opposite result.
_______________________________________________
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] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang
2024-04-09 22:27 ` Henrik Gramner via ffmpeg-devel
@ 2024-04-09 22:52 ` Marth64
2024-04-09 23:00 ` Marth64
0 siblings, 1 reply; 11+ messages in thread
From: Marth64 @ 2024-04-09 22:52 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Henrik Gramner
> so that seems like a terrible idea that would achieve
> the opposite result.
I respectfully disagree.
Neither approach is universal or POSIX specified.
So while I agree it can be left as-is since only
a basic Bourne shell is needed, I would not just
dismiss it/write it off as a terrible idea.
There are reasons why #!/usr/bin/env is colloquially preferred
to launch an interpreter in most shell script cases.
For example, there are systems where /bin/sh is NOT
a POSIX compliant shell. Alternatively, what if I have a different
or compliant `sh` in my PATH, but not necessarily in /bin?
This is not a scenario I made up, one can quickly research to see.
I will not bikeshed the topic further, we can go either way,
but I don't think it qualifies as a "terrible idea".
_______________________________________________
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] 11+ messages in thread
* [FFmpeg-devel] [PATCH v3 3/5] configure: switch to shebang without space
2024-04-09 13:50 [FFmpeg-devel] [PATCH v3 1/5] configure: simplify bigendian check J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang J. Dekker
@ 2024-04-09 13:50 ` J. Dekker
2024-04-09 13:55 ` Martin Storsjö
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 4/5] tests/fate.sh: " J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 5/5] doc/texidep: " J. Dekker
3 siblings, 1 reply; 11+ messages in thread
From: J. Dekker @ 2024-04-09 13:50 UTC (permalink / raw)
To: ffmpeg-devel
Note that the config.sh file is left without a shebang, this file is
supposed to be sourced into the current environment.
This commit is purely cosmetic.
Signed-off-by: J. Dekker <jdek@itanimul.li>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 7c22772485..55f1fc354d 100755
--- a/configure
+++ b/configure
@@ -4737,7 +4737,7 @@ chmod +x $TMPE
# make sure we can execute files in $TMPDIR
cat > $TMPSH 2>> $logfile <<EOF
-#! /bin/sh
+#!/bin/sh
EOF
chmod +x $TMPSH >> $logfile 2>&1
if ! $TMPSH >> $logfile 2>&1; then
--
2.44.0
_______________________________________________
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] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v3 3/5] configure: switch to shebang without space
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 3/5] configure: switch to shebang without space J. Dekker
@ 2024-04-09 13:55 ` Martin Storsjö
2024-04-09 14:03 ` J. Dekker
0 siblings, 1 reply; 11+ messages in thread
From: Martin Storsjö @ 2024-04-09 13:55 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, 9 Apr 2024, J. Dekker wrote:
> Note that the config.sh file is left without a shebang, this file is
> supposed to be sourced into the current environment.
>
> This commit is purely cosmetic.
>
> Signed-off-by: J. Dekker <jdek@itanimul.li>
> ---
> configure | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, this set seems fine to me - the explanations seem good now. (I'd
consider merging patches 3-5 though, but keeping the full commit message
from patch 3).)
// Martin
_______________________________________________
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] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v3 3/5] configure: switch to shebang without space
2024-04-09 13:55 ` Martin Storsjö
@ 2024-04-09 14:03 ` J. Dekker
0 siblings, 0 replies; 11+ messages in thread
From: J. Dekker @ 2024-04-09 14:03 UTC (permalink / raw)
To: ffmpeg-devel
Martin Storsjö <martin@martin.st> writes:
> On Tue, 9 Apr 2024, J. Dekker wrote:
>
>> Note that the config.sh file is left without a shebang, this file is
>> supposed to be sourced into the current environment.
>>
>> This commit is purely cosmetic.
>>
>> Signed-off-by: J. Dekker <jdek@itanimul.li>
>> ---
>> configure | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Thanks, this set seems fine to me - the explanations seem good now. (I'd
> consider merging patches 3-5 though, but keeping the full commit message from
> patch 3).)
>
Thanks for review, pushed with 3-5 squashed.
--
jd
_______________________________________________
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] 11+ messages in thread
* [FFmpeg-devel] [PATCH v3 4/5] tests/fate.sh: switch to shebang without space
2024-04-09 13:50 [FFmpeg-devel] [PATCH v3 1/5] configure: simplify bigendian check J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 3/5] configure: switch to shebang without space J. Dekker
@ 2024-04-09 13:50 ` J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 5/5] doc/texidep: " J. Dekker
3 siblings, 0 replies; 11+ messages in thread
From: J. Dekker @ 2024-04-09 13:50 UTC (permalink / raw)
To: ffmpeg-devel
This commit is purely cosmetic.
Signed-off-by: J. Dekker <jdek@itanimul.li>
---
tests/fate-run.sh | 2 +-
tests/fate.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 9863e4f2d9..6ae0320c60 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
export LC_ALL=C
diff --git a/tests/fate.sh b/tests/fate.sh
index 07908be3a5..c5ee18de80 100755
--- a/tests/fate.sh
+++ b/tests/fate.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
config=$1
--
2.44.0
_______________________________________________
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] 11+ messages in thread
* [FFmpeg-devel] [PATCH v3 5/5] doc/texidep: switch to shebang without space
2024-04-09 13:50 [FFmpeg-devel] [PATCH v3 1/5] configure: simplify bigendian check J. Dekker
` (2 preceding siblings ...)
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 4/5] tests/fate.sh: " J. Dekker
@ 2024-04-09 13:50 ` J. Dekker
3 siblings, 0 replies; 11+ messages in thread
From: J. Dekker @ 2024-04-09 13:50 UTC (permalink / raw)
To: ffmpeg-devel
This commit is purely cosmetic.
Signed-off-by: J. Dekker <jdek@itanimul.li>
---
doc/texidep.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/texidep.pl b/doc/texidep.pl
index 099690378e..33e6c7c53e 100644
--- a/doc/texidep.pl
+++ b/doc/texidep.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/env perl
+#!/usr/bin/env perl
# This script will print the dependency of a Texinfo file to stdout.
# texidep.pl <src-path> <input.texi> <output.ext>
--
2.44.0
_______________________________________________
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] 11+ messages in thread
end of thread, other threads:[~2024-04-09 23:01 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-09 13:50 [FFmpeg-devel] [PATCH v3 1/5] configure: simplify bigendian check J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang J. Dekker
2024-04-09 21:52 ` Marth64
2024-04-09 22:27 ` Henrik Gramner via ffmpeg-devel
2024-04-09 22:52 ` Marth64
2024-04-09 23:00 ` Marth64
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 3/5] configure: switch to shebang without space J. Dekker
2024-04-09 13:55 ` Martin Storsjö
2024-04-09 14:03 ` J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 4/5] tests/fate.sh: " J. Dekker
2024-04-09 13:50 ` [FFmpeg-devel] [PATCH v3 5/5] doc/texidep: " J. Dekker
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