xref: /OK3568_Linux_fs/buildroot/package/musepack/0005-fix-build-with-gcc-10.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunfix build with gcc 10
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunDefine __Cc, __Dc and Res_bit as extern to avoid the following build
4*4882a593Smuzhiyunfailure with gcc 10 (which defaults to -fno-common):
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun/nvme/rc-buildroot-test/scripts/instance-0/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: CMakeFiles/mpcdec_shared.dir/requant.o:(.rodata+0x0): multiple definition of `__Dc'; CMakeFiles/mpcdec_shared.dir/mpc_decoder.o:(.rodata+0x430): first defined here
7*4882a593Smuzhiyun/nvme/rc-buildroot-test/scripts/instance-0/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: CMakeFiles/mpcdec_shared.dir/requant.o:(.rodata+0x28): multiple definition of `__Cc'; CMakeFiles/mpcdec_shared.dir/mpc_decoder.o:(.rodata+0x458): first defined here
8*4882a593Smuzhiyun/nvme/rc-buildroot-test/scripts/instance-0/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: CMakeFiles/mpcdec_shared.dir/requant.o:(.rodata+0x74): multiple definition of `Res_bit'; CMakeFiles/mpcdec_shared.dir/mpc_decoder.o:(.rodata+0x4a4): first defined here
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunFixes:
11*4882a593Smuzhiyun - http://autobuild.buildroot.org/results/9971da8c59484a6a26eb79d6e157461a47855dbf
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
14*4882a593Smuzhiyun
15*4882a593Smuzhiyundiff -Naur musepack_src_r475.orig/libmpcdec/requant.h musepack_src_r475/libmpcdec/requant.h
16*4882a593Smuzhiyun--- musepack_src_r475.orig/libmpcdec/requant.h	2020-09-10 08:31:50.696105246 +0200
17*4882a593Smuzhiyun+++ musepack_src_r475/libmpcdec/requant.h	2020-09-10 08:32:52.944106476 +0200
18*4882a593Smuzhiyun@@ -47,9 +47,9 @@
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun /* C O N S T A N T S */
22*4882a593Smuzhiyun-const mpc_uint8_t      Res_bit [18];     ///< Bits per sample for chosen quantizer
23*4882a593Smuzhiyun-const MPC_SAMPLE_FORMAT __Cc    [1 + 18]; ///< Requantization coefficients
24*4882a593Smuzhiyun-const mpc_int16_t       __Dc    [1 + 18]; ///< Requantization offset
25*4882a593Smuzhiyun+extern const mpc_uint8_t      Res_bit [18];     ///< Bits per sample for chosen quantizer
26*4882a593Smuzhiyun+extern const MPC_SAMPLE_FORMAT __Cc    [1 + 18]; ///< Requantization coefficients
27*4882a593Smuzhiyun+extern const mpc_int16_t       __Dc    [1 + 18]; ///< Requantization offset
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun #define Cc (__Cc + 1)
30*4882a593Smuzhiyun #define Dc (__Dc + 1)
31