On 11/20/2016 12:19 AM, Ronald S. Bultje wrote: > Hi, > > On Sat, Nov 19, 2016 at 7:07 PM, Andreas Cadhalpun < > andreas.cadhal...@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.cadhal...@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 > > > This doesn't test whether PIE is enabled, it does it unconditionally. I'm > almost 100% sure that's not necessary. > > Ronald
"-fPIE" is added unconditionally to cflags somewhere else in configure if the hardened toolchain is used. In any case, there's a test for ebp_available long after "-fPIE" is added to cflags and it evidently passes on gcc < 5, so the proper way to do this is to either fix/adapt the ebp_available check (assuming gcc < 5 x86_32 reserves that specific register when -fPIE is used), or adding a different check that can detect this behavior and make it alter HAVE_7REGS and HAVE_6REGS, in a similar fashion ebp_available and ebx_available do. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel