Bug#930363: faad2: fix build with gcc-9 [patch]

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#930363: faad2: fix build with gcc-9 [patch]

Gianfranco Costamagna via nm
Source: faad2
Version: 2.8.8-3
Severity: normal
tags: patch

Hello, looks like gcc-9 is adding wl,asneeded flag in compilation, so libs passed as CFLAGS are not correctly
used by gcc anymore, because only LIBS is added at the end of the compilation line.

The following patch fixes the issue, and starts then using again the glib implementation of the library.
(without the patch, the bundled version is used everywhere, and the build fails only on i386 because of an implementation mismatch of a long/int data type)

I reported the patch already upstream
https://sourceforge.net/p/faac/bugs/242/


patch: http://launchpadlibrarian.net/427773869/faad2_2.8.8-3_2.8.8-3ubuntu1.diff.gz


please apply if possible, thanks!

Gianfranco

0001-Add-patch-to-fix-a-gcc-9-build-failure-on-i386-and-t.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#930363: faad2: fix build with gcc-9 [patch]

Sebastian Ramacher-3
Control: tags -1 + moreinfo

On 2019-06-11 15:06:01, Gianfranco Costamagna wrote:

> Source: faad2
> Version: 2.8.8-3
> Severity: normal
> tags: patch
>
> Hello, looks like gcc-9 is adding wl,asneeded flag in compilation, so libs passed as CFLAGS are not correctly
> used by gcc anymore, because only LIBS is added at the end of the compilation line.
>
> The following patch fixes the issue, and starts then using again the glib implementation of the library.
> (without the patch, the bundled version is used everywhere, and the build fails only on i386 because of an implementation mismatch of a long/int data type)
>
> I reported the patch already upstream
> https://sourceforge.net/p/faac/bugs/242/
>
>
> patch: http://launchpadlibrarian.net/427773869/faad2_2.8.8-3_2.8.8-3ubuntu1.diff.gz
>
>
> please apply if possible, thanks!
>
> Gianfranco

> >From b9e6b9bf906c8c2c6fabf7255bcf9eceff96023b Mon Sep 17 00:00:00 2001
> From: Gianfranco Costamagna <[hidden email]>
> Date: Tue, 11 Jun 2019 14:54:38 +0200
> Subject: [PATCH] Add patch to fix a gcc-9 build failure on i386 and to
>  correctly use lprintf from glibc
>
> ---
>  debian/changelog           |  6 ++++++
>  debian/patches/gcc-9.patch | 26 ++++++++++++++++++++++++++
>  debian/patches/series      |  1 +
>  3 files changed, 33 insertions(+)
>  create mode 100644 debian/patches/gcc-9.patch
>
> diff --git a/debian/changelog b/debian/changelog
> index dfa8217..c1267f4 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,9 @@
> +faad2 (2.8.8-4) UNRELEASED; urgency=medium
> +
> +  * Fix build with gcc-9 and asneeded flag on i386.
> +
> + -- Gianfranco Costamagna <[hidden email]>  Tue, 11 Jun 2019 14:41:09 +0200
> +
>  faad2 (2.8.8-3) unstable; urgency=high
>  
>    * Team upload.
> diff --git a/debian/patches/gcc-9.patch b/debian/patches/gcc-9.patch
> new file mode 100644
> index 0000000..e17a3a3
> --- /dev/null
> +++ b/debian/patches/gcc-9.patch
> @@ -0,0 +1,26 @@
> +Description: Fix link failure with gcc-9 and wl,asneeded flags
> +Author: Gianfranco Costamagna <[hidden email]>
> +Last-Update: 2019-06-11
> +
> +--- faad2-2.8.8.orig/configure.ac
> ++++ faad2-2.8.8/configure.ac
> +@@ -91,8 +91,8 @@ AC_DEFUN([AC_C99_FUNC_LRINTF],
> + [AC_CACHE_CHECK(for lrintf,
> +   ac_cv_c99_lrintf,
> + [
> +-lrintf_save_CFLAGS=$CFLAGS
> +-CFLAGS="-O -lm"
> ++lrintf_save_LIBS=$LIBS
> ++LIBS="-O -lm"
Why is -O controlling the optimization level moved to LIBS? I suppose,
this should stay in CFLAGS.

Cheers

> + AC_TRY_LINK([
> + #define         _ISOC9X_SOURCE  1
> + #define         _ISOC99_SOURCE  1
> +@@ -102,7 +102,7 @@ AC_TRY_LINK([
> + #include <math.h>
> + ], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no)
> +
> +-CFLAGS=$lrintf_save_CFLAGS
> ++LIBS=$lrintf_save_LIBS
> +
> + ])
> +
> diff --git a/debian/patches/series b/debian/patches/series
> index 6d4062f..f35c884 100644
> --- a/debian/patches/series
> +++ b/debian/patches/series
> @@ -2,3 +2,4 @@ reproducible-build.patch
>  0009-syntax.c-check-for-syntax-element-inconsistencies.patch
>  0010-sbr_hfadj-sanitize-frequency-band-borders.patch
>  0004-Fix-a-couple-buffer-overflows.patch
> +gcc-9.patch
> --
> 2.17.1
>

--
Sebastian Ramacher

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#930363: faad2: fix build with gcc-9 [patch]

Gianfranco Costamagna via nm
control: tags -1 - moreinfo

Hello Sebastian

do you like the attached version then? :)

thanks for the quick update,
I think a CFLAG passed as LIB doesn't matter that much, while the opposite hurts more,
but you are right, we should keep them separate indeed.

thanks for pointing it out!

Gianfranco

gcc-9.patch (694 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#930363: faad2: fix build with gcc-9 [patch]

Fabian Greffrath-12
Control: forwarded -1 https://github.com/knik0/faad2/commit/920ec985a74c6f88fe507181df07a0cd7e51d519
Control: tags -1 +upstream +fixed-upstream

Applied upstream, thanks!

Am Dienstag, den 11.06.2019, 16:05 +0200 schrieb Gianfranco Costamagna:

> control: tags -1 - moreinfo
>
> Hello Sebastian
>
> do you like the attached version then? :)
>
> thanks for the quick update,
> I think a CFLAG passed as LIB doesn't matter that much, while the
> opposite hurts more,
> but you are right, we should keep them separate indeed.
>
> thanks for pointing it out!
>
> Gianfranco

signature.asc (849 bytes) Download Attachment