[FFmpeg-devel] [PATCH] configure: reserve a register for gcc before 5 on x86_32 with PIE

Hendrik Leppkes h.leppkes at gmail.com
Sun Nov 20 02:52:14 EET 2016


On Sun, Nov 20, 2016 at 1:07 AM, Andreas Cadhalpun
<andreas.cadhalpun at googlemail.com> wrote:
> gcc before gcc-5 reserves a register on x86_32 for the GOT, when PIE is
> enabled.
>
> This fixes build failures due to:
> error: 'asm' operand has impossible constraints
>
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>
> A build log of a failed build with gcc 4.9 is available at:
> https://buildd.debian.org/status/fetch.php?pkg=ffmpeg&arch=i386&ver=7%3A3.2-2~bpo8%2B1&stamp=1478791165
>
> ---
>  configure | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/configure b/configure
> index b5bfad6..8794580 100755
> --- a/configure
> +++ b/configure
> @@ -5364,6 +5364,19 @@ EOF
>      enabled ssse3  && check_inline_asm ssse3_inline  '"pabsw %xmm0, %xmm0"'
>      enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
>
> +    case "$toolchain" in
> +        hardened)
> +            if enabled x86_32; then
> +                # When PIE is enabled on x86_32, gcc before gcc-5 reserves a register for the GOT.
> +                case $gcc_basever in
> +                    2*|3*|4*)
> +                        disable ebp_available
> +                    ;;
> +                esac
> +            fi
> +        ;;
> +    esac

Can't we build a test to detect this instead of hard-coding some constraints?

- Hendrik


More information about the ffmpeg-devel mailing list