Skip to contentSkip to conversation

fdk-aac: fix build with GCC 6

PATCH New Jörg Krause 2 participants 2 messages May 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fdk-aac: fix build with GCC 6

GCC 6 defaults to -std=gnu++14 instead of -std=gnu++98. The C++11 standard does not allow "narrowing conversions" which is why building fdk-aac with GCC 6 fails:

libAACenc/src/aacEnc_rom.cpp:661:1: error: narrowing conversion of '2180108801u' from 'unsigned int' to 'FIXP_DBL {aka long int}' inside { } [-Wnarrowing]

Use '-std=gnu++98' as suggested by "Porting to GCC 6" [1].

[1] https://gcc.gnu.org/gcc-6/porting_to.html

---
 package/fdk-aac/fdk-aac.mk | 3 +++
 1 file changed, 3 insertions(+)
package/fdk-aac/fdk-aac.mk +3 -0
index a872c54..45a3cf5 100644
@@ -11,4 +11,7 @@ FDK_AAC_LICENSE_FILES = NOTICE
 
 FDK_AAC_INSTALL_STAGING = YES
 
+# Not compatible with GCC 6 which defaults to GNU++14
+FDK_AAC_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=gnu++98"
+
 $(eval $(autotools-package))
Signature · 1 line
2.8.2
#1 lore raw

PATCH 1/1 fdk-aac: fix build with GCC 6

Hello,

Quoted 6 lines · J?rg Krause

GCC 6 defaults to -std=gnu++14 instead of -std=gnu++98. The C++11 standard does not allow "narrowing conversions" which is why building fdk-aac with GCC 6 fails:

libAACenc/src/aacEnc_rom.cpp:661:1: error: narrowing conversion of '2180108801u' from 'unsigned int' to 'FIXP_DBL {aka long int}' inside { } [-Wnarrowing]

Quoted 8 lines

Use '-std=gnu++98' as suggested by "Porting to GCC 6" [1].

[1] https://gcc.gnu.org/gcc-6/porting_to.html

---
 package/fdk-aac/fdk-aac.mk | 3 +++
 1 file changed, 3 insertions(+)

Applied to master, but please report the bug upstream so that they fix in their source code or build system. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com