0%

常见编译问题,不定期更新.

GCC编译相关

GCC 编译出错

1
2
3
4
5
6
7
8
In file included from /home/michael/3TB-DISK/Embedded-System/NuttX/buildroot/toolchain_build_arm_nofpu/gcc-4.8.5/gcc/cp/except.c:1008:0:
cfns.gperf: In function ‘const char* libc_name_p(const char*, unsigned int)’:
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inline with ‘gnu_inline’ attribute
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously declared here
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
Makefile:1059: recipe for target 'cp/except.o' failed
make[3]: *** [cp/except.o] Error 1
  • 处理方法
  • 添加条件宏定义到这两个文件中**gcc-4.8.5/gcc/cp/cfns.{gperf,h} **
1
2
3
4
5
6
7
8
9
10
11
12
19	#ifdef __GNUC__
20 __inline
21 #endif
22 static unsigned int hash (const char *, unsigned int);
23 #ifdef __GNUC__
24 __inline
25 #ifdef __GNUC_STDC_INLINE__
26 __attribute__ ((__gnu_inline__))
27 #endif
28 #endif
29 const char * libc_name_p (const char *, unsigned int);

编译 gcc texi 出错如下:

1
2
3
4
5
6
7
8
/home/michael/3TB-DISK/Embedded-System/NuttX/buildroot/toolchain_build_arm_nofpu/gcc-4.8.5/gcc/doc/gcc.texi:88: warning: @tex should only appear at the beginning of a line
/home/michael/3TB-DISK/Embedded-System/NuttX/buildroot/toolchain_build_arm_nofpu/gcc-4.8.5/gcc/doc/gcc.texi:208: no matching `@end tex'
/home/michael/3TB-DISK/Embedded-System/NuttX/buildroot/toolchain_build_arm_nofpu/gcc-4.8.5/gcc/doc/gcc.texi:208: no matching `@end multitable'
/home/michael/3TB-DISK/Embedded-System/NuttX/buildroot/toolchain_build_arm_nofpu/gcc-4.8.5/gcc/doc/gcc.texi:208: no matching `@end titlepage'
Makefile:4353: recipe for target 'doc/gcc.info' failed
make[3]: *** [doc/gcc.info] Error 1
make[3]: Leaving directory '/home/michael/3TB-DISK/Embedded-System/NuttX/buildroot/toolchain_build_arm_nofpu/gcc-4.8.5-build/gcc'
Makefile:3889: recipe for target 'all-gcc' failed
  • 处理方法
1
2
3
$cd /home/michael/3TB-DISK/Embedded-System/NuttX/buildroot/toolchain_build_arm_nofpu/gcc-4.8.5-build/gcc
$ vi Makefile
注释 doc: 这一行,跳过编译doc相关的东西

C++ 函数定义错误

1
2
3
4
5
libxx_new.cxx:66:40: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter [-fpermissive]
void *operator new(unsigned long nbytes)
^
Makefile:111: recipe for target 'libxx_new.o' failed
make[1]: *** [libxx_new.o] Error 1
  • 处理方法
  • Linux 下要定义成
1
void *operator new(size_t nbytes)
  • MinGW 下要定义成
1
2
3
4
5
#ifdef CONFIG_CXX_NEWLONG
void *operator new(unsigned long nbytes)
#else
void *operator new(unsigned int nbytes)
#endif

Intel Corporation Comet Lake PCH-LP cAVS集成声卡问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
~$ lspci -v -s 00:1f.3
00:1f.3 Multimedia audio controller: Intel Corporation Comet Lake PCH-LP cAVS
Subsystem: Hewlett-Packard Company Comet Lake PCH-LP cAVS
Flags: bus master, fast devsel, latency 64, IRQ 151
Memory at 4000108000 (64-bit, non-prefetchable) [size=16K]
Memory at 4000000000 (64-bit, non-prefetchable) [size=1M]
Capabilities: <access denied>
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel, snd_sof_pci_intel_cnl

~$ pactl list cards
Card #0
Name: alsa_card.pci-0000_00_1f.3
Driver: module-alsa-card.c
Owner Module: 6
Properties:
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x4000108000 irq 151"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.product.name = "Comet Lake PCH-LP cAVS"
device.form_factor = "internal"
device.string = "0"
device.description = "Built-in Audio"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Profiles:
[...]

1
2
3
4
5
6
7
8
9
10
~$ pacmd list-sources | grep -e index -e name: -e muted -e device.description
index: 0
name: <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
muted: no
device.description = "Monitor of Built-in Audio Analog Stereo"
* index: 1
name: <alsa_input.pci-0000_00_1f.3.analog-stereo>
muted: no
device.description = "Built-in Audio Analog Stereo"

1
2
3
4
~$ amixer scontrols
Simple mixer control 'Master',0
Simple mixer control 'Capture',0

  • aplay -l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC236 Analog [ALC236 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sudo journalctl -k | grep -Ei "ALSA|HDA|sof[-]|HDMI|snd[_-]|sound|hda.codec|hda.intel"
[sudo] password for jh:
10月 26 00:02:20 jh-hpzhan66pro14g3 kernel: pci 0000:01:00.0: Enabling HDA controller
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC236: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_codec_realtek hdaudioC1D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_codec_realtek hdaudioC1D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_codec_realtek hdaudioC1D0: mono: mono_out=0x0
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_codec_realtek hdaudioC1D0: inputs:
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_codec_realtek hdaudioC1D0: Internal Mic=0x19
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: snd_hda_codec_realtek hdaudioC1D0: Mic=0x18
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1f.3/sound/card1/input16
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1f.3/sound/card1/input17
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input18
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input19
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input20
10月 26 00:02:21 jh-hpzhan66pro14g3 kernel: alsactl[624]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set

1
2
3
4
5
6
7
8
9
10
11
12
13
14
~$ dmesg  | grep 'snd\|firmware\|audio'
[ 5.271850] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
[ 8.753092] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[ 8.753414] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 8.768179] iwlwifi 0000:00:14.3: loaded firmware version 77.bd067429.0 QuZ-a0-hr-b0-77.ucode op_mode iwlmvm
[ 8.907449] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC236: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[ 8.907455] snd_hda_codec_realtek hdaudioC1D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 8.907458] snd_hda_codec_realtek hdaudioC1D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[ 8.907460] snd_hda_codec_realtek hdaudioC1D0: mono: mono_out=0x0
[ 8.907461] snd_hda_codec_realtek hdaudioC1D0: inputs:
[ 8.907463] snd_hda_codec_realtek hdaudioC1D0: Internal Mic=0x19
[ 8.907465] snd_hda_codec_realtek hdaudioC1D0: Mic=0x18
[ 9.313962] Bluetooth: hci0: Found device firmware: intel/ibt-19-0-4.sfi

1
~$ sudo apt-get install firmware-sof-signed  firmware-realtek -y
1
2
3
4
5
6
~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC236 Analog [ALC236 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0


谢谢支持