* [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time?
@ 2022-11-12 18:57 Nomis101
2022-11-12 19:07 ` Carl Eugen Hoyos
2022-11-12 23:09 ` Ronald S. Bultje
0 siblings, 2 replies; 5+ messages in thread
From: Nomis101 @ 2022-11-12 18:57 UTC (permalink / raw)
To: ffmpeg-devel
Hi.If building FFmpeg, configure does set a value for mstack-alignment, for example on macOS
-mstack-alignment=16. On HandBrake we found there is an issue with current Clang in Xcode about
conflicting 'override-stack-alignment' values if we build with ThinLTO.
"ld: linking module flags 'override-stack-alignment': IDs have conflicting values"
I found out why this is. x264 does set -mstack-alignment=64 in configure, FFmpeg does set
-mstack-alignment=16 and this seems to be a conflict when linking. If I modify both configure files
and remove the mstack-alignment part, then the build does finish with no error.
And here comes my questions. I was wondering, about the technical reason why FFmpeg does set
mstack-alignment? And if it would be safe to disable it in case FFmpeg is compiled with ThinLTO (for
HandBrake)?
Thanks and Regards
_______________________________________________
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] 5+ messages in thread
* Re: [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time?
2022-11-12 18:57 [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time? Nomis101
@ 2022-11-12 19:07 ` Carl Eugen Hoyos
2022-11-12 23:09 ` Ronald S. Bultje
1 sibling, 0 replies; 5+ messages in thread
From: Carl Eugen Hoyos @ 2022-11-12 19:07 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Am Sa., 12. Nov. 2022 um 19:57 Uhr schrieb Nomis101 <Nomis101@web.de>:
> And here comes my questions. I was wondering, about the technical
> reason why FFmpeg does set mstack-alignment?
It is needed for x86_32.
Completely removing the option from all build scripts seems wrong to me.
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] 5+ messages in thread
* Re: [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time?
2022-11-12 18:57 [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time? Nomis101
2022-11-12 19:07 ` Carl Eugen Hoyos
@ 2022-11-12 23:09 ` Ronald S. Bultje
2022-11-13 13:46 ` Nomis101
1 sibling, 1 reply; 5+ messages in thread
From: Ronald S. Bultje @ 2022-11-12 23:09 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Hi,
On Sat, Nov 12, 2022 at 1:57 PM Nomis101 <Nomis101@web.de> wrote:
> Hi.If building FFmpeg, configure does set a value for mstack-alignment,
> for example on macOS
> -mstack-alignment=16. On HandBrake we found there is an issue with current
> Clang in Xcode about
> conflicting 'override-stack-alignment' values if we build with ThinLTO.
>
> "ld: linking module flags 'override-stack-alignment': IDs have conflicting
> values"
>
> I found out why this is. x264 does set -mstack-alignment=64 in configure,
> FFmpeg does set
> -mstack-alignment=16 and this seems to be a conflict when linking. If I
> modify both configure files
> and remove the mstack-alignment part, then the build does finish with no
> error.
>
> And here comes my questions. I was wondering, about the technical reason
> why FFmpeg does set
> mstack-alignment? And if it would be safe to disable it in case FFmpeg is
> compiled with ThinLTO (for
> HandBrake)?
>
It can safely be set to the higher of the two values, it has the same
meaning. Alignment of 64 implies alignment of 16.
Ronald
_______________________________________________
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] 5+ messages in thread
* Re: [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time?
2022-11-12 23:09 ` Ronald S. Bultje
@ 2022-11-13 13:46 ` Nomis101
2022-11-13 14:44 ` Ronald S. Bultje
0 siblings, 1 reply; 5+ messages in thread
From: Nomis101 @ 2022-11-13 13:46 UTC (permalink / raw)
To: ffmpeg-devel
Am 12.11.22 um 23:09 schrieb Ronald S. Bultje:
> Hi,
>
> On Sat, Nov 12, 2022 at 1:57 PM Nomis101 <Nomis101@web.de> wrote:
>
>> Hi.If building FFmpeg, configure does set a value for mstack-alignment,
>> for example on macOS
>> -mstack-alignment=16. On HandBrake we found there is an issue with current
>> Clang in Xcode about
>> conflicting 'override-stack-alignment' values if we build with ThinLTO.
>>
>> "ld: linking module flags 'override-stack-alignment': IDs have conflicting
>> values"
>>
>> I found out why this is. x264 does set -mstack-alignment=64 in configure,
>> FFmpeg does set
>> -mstack-alignment=16 and this seems to be a conflict when linking. If I
>> modify both configure files
>> and remove the mstack-alignment part, then the build does finish with no
>> error.
>>
>> And here comes my questions. I was wondering, about the technical reason
>> why FFmpeg does set
>> mstack-alignment? And if it would be safe to disable it in case FFmpeg is
>> compiled with ThinLTO (for
>> HandBrake)?
>>
>
> It can safely be set to the higher of the two values, it has the same
> meaning. Alignment of 64 implies alignment of 16.
Thanks. I found out, that its enough to disable the mstack-alignment part for x264 in case of
ThinLTO. This will also fix the error.
>
> Ronald
> _______________________________________________
> 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] 5+ messages in thread
* Re: [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time?
2022-11-13 13:46 ` Nomis101
@ 2022-11-13 14:44 ` Ronald S. Bultje
0 siblings, 0 replies; 5+ messages in thread
From: Ronald S. Bultje @ 2022-11-13 14:44 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Hi,
On Sun, Nov 13, 2022 at 8:47 AM Nomis101 <Nomis101@web.de> wrote:
> Am 12.11.22 um 23:09 schrieb Ronald S. Bultje:
> > Hi,
> >
> > On Sat, Nov 12, 2022 at 1:57 PM Nomis101 <Nomis101@web.de> wrote:
> >
> >> Hi.If building FFmpeg, configure does set a value for mstack-alignment,
> >> for example on macOS
> >> -mstack-alignment=16. On HandBrake we found there is an issue with
> current
> >> Clang in Xcode about
> >> conflicting 'override-stack-alignment' values if we build with ThinLTO.
> >>
> >> "ld: linking module flags 'override-stack-alignment': IDs have
> conflicting
> >> values"
> >>
> >> I found out why this is. x264 does set -mstack-alignment=64 in
> configure,
> >> FFmpeg does set
> >> -mstack-alignment=16 and this seems to be a conflict when linking. If I
> >> modify both configure files
> >> and remove the mstack-alignment part, then the build does finish with no
> >> error.
> >>
> >> And here comes my questions. I was wondering, about the technical reason
> >> why FFmpeg does set
> >> mstack-alignment? And if it would be safe to disable it in case FFmpeg
> is
> >> compiled with ThinLTO (for
> >> HandBrake)?
> >>
> >
> > It can safely be set to the higher of the two values, it has the same
> > meaning. Alignment of 64 implies alignment of 16.
> Thanks. I found out, that its enough to disable the mstack-alignment part
> for x264 in case of
> ThinLTO. This will also fix the error.
>
For people looking at this in the archives after a google search, trying
this out and wondering why their x264 crashes, please see the following
reference:
https://mailman.videolan.org/pipermail/x264-devel/2022-November/012963.html
(Summary: if you remove the stack alignment in x264, please also remove the
assumption in x264's build that the stack *is* in fact aligned, and then
everything will work fine (although a few instructions slower).)
Ronald
_______________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2022-11-13 14:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-12 18:57 [FFmpeg-devel] [Question] Technical reason why FFmpeg sets a mstack-alignment value on compile time? Nomis101
2022-11-12 19:07 ` Carl Eugen Hoyos
2022-11-12 23:09 ` Ronald S. Bultje
2022-11-13 13:46 ` Nomis101
2022-11-13 14:44 ` Ronald S. Bultje
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