从根源分析,调试,定位和解决MacOS ld: unsupported tapi file type ‘!tapi-tbd‘ in YAML file

    你要是遇到同样错误,找一圈都没有解决,建议认真读一下本文,这个应该是最终极的解决办法,从原理上剖析了产生的原因,同时给出来了调试和定位的办法。

    maccos使用brew安装了一个gcc14, 结果编译一个最简单的程序都报错,如下:

gcc-14 test.c -o t
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status

        查了网上是说libSystem.tbd和ld不一致引起的。现在不知道ld是调用了哪份,当前系统一堆不同版本的。

      一般的解决办法如下:

      

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

        但是我试了并没有用,同时使用clang编译是正常的,说明这个CommandLineTools没有问题的。

       没有办法了,只好自己来分析一下了。

        首先使用 dtruss跟踪一下系统api调用,发现ld应该是posix_spawn调用了。如下:

sudo dtruss gcc-14 test.c -o t
Password:
SYSCALL(args) 		 = return


open("/dev/dtracehelper\0", 0x2, 0x0)		 = 3 0
ioctl(0x3, 0x80086804, 0x7FFEEF6B3560)		 = 0 0
close(0x3)		 = 0 0
mprotect(0x1006EF000, 0x48000, 0x1)		 = 0 0
access("/AppleInternal/XBS/.isChrooted\0", 0x0, 0x0)		 = -1 Err#2
bsdthread_register(0x7FFF2034746C, 0x7FFF20347458, 0x2000)		 = 1073742047 0
shm_open(0x7FFF2021DF66, 0x0, 0x2021CC3A)		 = 3 0
fstat64(0x3, 0x7FFEEF6B23D0, 0x0)		 = 0 0
mmap(0x0, 0x1000, 0x1, 0x40001, 0x3, 0x0)		 = 0x1007DD000 0
close(0x3)		 = 0 0
ioctl(0x2, 0x4004667A, 0x7FFEEF6B2494)		 = 0 0
mprotect(0x1007E3000, 0x1000, 0x0)		 = 0 0
mprotect(0x1007F2000, 0x1000, 0x0)		 = 0 0
mprotect(0x1007F3000, 0x1000, 0x0)		 = 0 0
mprotect(0x100802000, 0x1000, 0x0)		 = 0 0
mprotect(0x100803000, 0x1000, 0x0)		 = 0 0
mprotect(0x100812000, 0x1000, 0x0)		 = 0 0
mprotect(0x1007DE000, 0x90, 0x1)		 = 0 0
mprotect(0x100813000, 0x1000, 0x1)		 = 0 0
mprotect(0x1007DE000, 0x90, 0x3)		 = 0 0
mprotect(0x1007DE000, 0x90, 0x1)		 = 0 0
issetugid(0x0, 0x0, 0x0)		 = 0 0
getpid(0x0, 0x0, 0x0)		 = 86951 0
stat64("/AppleInternal\0", 0x7FFEEF6B29C0, 0x0)		 = -1 Err#2
csops_audittoken(0x153A7, 0x7, 0x7FFEEF6B24F0)		 = -1 Err#22
proc_info(0x2, 0x153A7, 0xD)		 = 64 0
csops_audittoken(0x153A7, 0x7, 0x7FFEEF6B25E0)		 = -1 Err#22
sysctlbyname(kern.system_version_compat, 0x1A, 0x0, 0x0, 0x7FFEEF6B2A7C)		 = 0 0
ioctl(0x2, 0x4004667A, 0x7FFEEF6B4594)		 = 0 0
ioctl(0x2, 0x4004667A, 0x7FFEEF6B45A4)		 = 0 0
ioctl(0x2, 0x4004667A, 0x7FFEEF6B4594)		 = 0 0
sysctl([CTL_KERN, 2, 0, 0, 0, 0] (2), 0x7FFEEF6B45D0, 0x7FFEEF6B45C0, 0x0, 0x0)		 = 0 0
sigaction(0x2, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0x2, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0x1, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0x1, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0xF, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0xF, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0xD, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0xD, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
sigaction(0x14, 0x7FFEEF6B45D8, 0x7FFEEF6B4600)		 = 0 0
getrlimit(0x1003, 0x7FFEEF6B4600, 0x0)		 = 0 0
setrlimit(0x1003, 0x7FFEEF6B4600, 0x0)		 = 0 0
access("/Volumes/10136/flutter/bin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/cuda/lib/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/cuda/extras/CUPTI/lib/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/anaconda3/bin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/anaconda3/condabin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/Volumes/data/Codes/android-ndk-r10e/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/Applications/Cocos/frameworks/cocos2d-x-3.5/tools/cocos2d-console/bin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/bin/gcc-14\0", 0x1, 0x0)		 = 0 0
stat64("/usr/local/bin/gcc-14\0", 0x7FFEEF6B4440, 0x0)		 = 0 0
stat64("/\0", 0x7FFEEF6B1D68, 0x0)		 = 0 0
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/bin\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/bin/gcc-14\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
readlink("/usr/local/bin/gcc-14\0", 0x7FFEEF6B2AB0, 0x400)		 = 33 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin/gcc-14\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
access("/Volumes/10136/flutter/bin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/cuda/lib/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/cuda/extras/CUPTI/lib/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/anaconda3/bin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/anaconda3/condabin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/Volumes/data/Codes/android-ndk-r10e/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/Applications/Cocos/frameworks/cocos2d-x-3.5/tools/cocos2d-console/bin/gcc-14\0", 0x1, 0x0)		 = -1 Err#2
access("/usr/local/bin/gcc-14\0", 0x1, 0x0)		 = 0 0
stat64("/usr/local/bin/gcc-14\0", 0x7FFEEF6B4440, 0x0)		 = 0 0
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/bin\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/bin/gcc-14\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
readlink("/usr/local/bin/gcc-14\0", 0x7FFEEF6B2AB0, 0x400)		 = 33 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin/gcc-14\0", 0x7FFF202A1644, 0x7FFEEF6B36B0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/\0", 0x1, 0x0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/\0", 0x1, 0x0)		 = 0 0
open_nocancel(".\0", 0x0, 0x0)		 = 3 0
fstat64(0x3, 0x7FFEEF6B1D20, 0x0)		 = 0 0
fcntl_nocancel(0x3, 0x32, 0x7FFEEF6B40E0)		 = 0 0
close_nocancel(0x3)		 = 0 0
stat64("/Volumes/evo2T/src/paq8px/mybuild\0", 0x7FFEEF6B1C90, 0x0)		 = 0 0
stat64("/Volumes/evo2T/src/paq8px/mybuild\0", 0x7FFEEF6B2338, 0x0)		 = 0 0
getattrlist("/Volumes/evo2T/src/paq8px/mybuild/test.c\0", 0x7FFF202A1644, 0x7FFEEF6B3C80)		 = 0 0
open_nocancel(".\0", 0x0, 0x0)		 = 3 0
fstat64(0x3, 0x7FFEEF6B1D20, 0x0)		 = 0 0
fcntl_nocancel(0x3, 0x32, 0x7FFEEF6B40E0)		 = 0 0
close_nocancel(0x3)		 = 0 0
stat64("/Volumes/evo2T/src/paq8px/mybuild\0", 0x7FFEEF6B1C90, 0x0)		 = 0 0
stat64("/Volumes/evo2T/src/paq8px/mybuild\0", 0x7FFEEF6B2338, 0x0)		 = 0 0
getattrlist("/Volumes/evo2T/src/paq8px/mybuild/t\0", 0x7FFF202A1644, 0x7FFEEF6B3C80)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/\0", 0x1, 0x0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/\0", 0x1, 0x0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/specs\0", 0x4, 0x0)		 = -1 Err#2
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/specs\0", 0x4, 0x0)		 = -1 Err#2
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/x86_64-apple-darwin20/14/specs\0", 0x4, 0x0)		 = -1 Err#2
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/specs\0", 0x4, 0x0)	 = -1 Err#2
access("/usr/local/opt/gcc/lib/gcc/current/gcc/x86_64-apple-darwin20/specs\0", 0x4, 0x0)		 = -1 Err#2
access("/usr/local/Cellar/gcc/14.2.0_1/bin/\0", 0x1, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/lto-wrapper\0", 0x7FFEEF6B4450, 0x0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/lto-wrapper\0", 0x1, 0x0)		 = 0 0
access("/var/tmp/\0", 0x7, 0x0)		 = 0 0
stat64("/var/tmp/\0", 0x7FFEEF6B3630, 0x0)		 = 0 0
getentropy(0x7FFEEF6B3070, 0x20, 0x0)		 = 0 0
getentropy(0x7FFEEF6B30C0, 0x40, 0x0)		 = 0 0
fstatat64(0xFFFFFFFFFFFFFFFE, 0x7FA4C6C04200, 0x7FFEEF6B31B0)		 = 0 0
openat_nocancel(0xFFFFFFFFFFFFFFFE, 0x7FA4C6C04200, 0xA02)		 = 3 0
close(0x3)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/cc1\0", 0x7FFEEF6B34B0, 0x0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/cc1\0", 0x1, 0x0)		 = 0 0
posix_spawn(0x7FFEEF6B355C, 0x7FA4C6C05D20, 0x7FFEEF6B3480)		 = 0 0
wait4(0x153A9, 0x7FA4C6C05850, 0x0)		 = 86953 0
fstatat64(0xFFFFFFFFFFFFFFFE, 0x7FA4C6D04080, 0x7FFEEF6B2E90)		 = 0 0
openat_nocancel(0xFFFFFFFFFFFFFFFE, 0x7FA4C6D04080, 0xA02)		 = 3 0
close(0x3)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/as\0", 0x7FFEEF6B42C0, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/as\0", 0x7FFEEF6B42C0, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/bin/x86_64-apple-darwin20/14/as\0", 0x7FFEEF6B42C0, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/bin/as\0", 0x7FFEEF6B42C0, 0x0)		 = -1 Err#2
posix_spawn(0x7FFEEF6B436C, 0x7FFEEF6B3F10, 0x7FFEEF6B38B0)		 = -1 Err#2
posix_spawn(0x7FFEEF6B436C, 0x7FFEEF6B3F10, 0x7FFEEF6B38B0)		 = -1 Err#2
posix_spawn(0x7FFEEF6B436C, 0x7FFEEF6B3F10, 0x7FFEEF6B38B0)		 = -1 Err#2
posix_spawn(0x7FFEEF6B436C, 0x7FFEEF6B3F10, 0x7FFEEF6B38B0)		 = 0 0
stat64("/usr/local/anaconda3/bin/as\0", 0x7FFEEF6B3E40, 0x0)		 = 0 0
wait4(0x153AD, 0x7FA4C6E04090, 0x0)		 = 86957 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2\0", 0x7FFEEF6B4450, 0x0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2\0", 0x1, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B4430, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/.\0", 0x7FFEEF6B4430, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/bin/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B4430, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/bin/.\0", 0x7FFEEF6B4430, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B4430, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/.\0", 0x7FFEEF6B4430, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B4430, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/.\0", 0x7FFEEF6B4430, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B4430, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../.\0", 0x7FFEEF6B4430, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B3470, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/.\0", 0x7FFEEF6B3470, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B3470, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/.\0", 0x7FFEEF6B3470, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B3470, 0x0)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../.\0", 0x7FFEEF6B3470, 0x0)		 = 0 0
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20/14\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B2CB0, 0x0)		 = 0 0
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/.\0", 0x7FFEEF6B2CB0, 0x0)		 = 0 0
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20/14\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B2CB0, 0x0)		 = -1 Err#2
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20/14\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../../../../x86_64-apple-darwin20/lib/.\0", 0x7FFEEF6B2CB0, 0x0)		 = -1 Err#2
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20/14\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = -1 Err#2
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin20/14/../../../x86_64-apple-darwin20/14/.\0", 0x7FFEEF6B2CB0, 0x0)		 = -1 Err#2
getattrlist("/usr\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/bin\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
getattrlist("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin20/14\0", 0x7FFF202A1644, 0x7FFEEF6B2500)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/lib/gcc/current/.\0", 0x7FFEEF6B2CB0, 0x0)		 = 0 0
stat64("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2\0", 0x7FFEEF6B43A0, 0x0)		 = 0 0
access("/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2\0", 0x1, 0x0)		 = 0 0
posix_spawn(0x7FFEEF6B444C, 0x7FA4C6D049B0, 0x7FFEEF6B4370)		 = 0 0
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
wait4(0x153B4, 0x7FA4C6D05AF0, 0x0)		 = 86964 0
stat64("/var/tmp//ccJ8HKNk.o\0", 0x7FFEEF6B45A0, 0x0)		 = 0 0
unlink("/var/tmp//ccJ8HKNk.o\0", 0x0, 0x0)		 = 0 0
stat64("/var/tmp//ccDAFOTi.s\0", 0x7FFEEF6B45A0, 0x0)		 = 0 0
unlink("/var/tmp//ccDAFOTi.s\0", 0x0, 0x0)		 = 0 0

系统apiposix_spawn的参数没有打印出来,不知道为什么, lldb跟一下。

sudo lldb gcc-14
Password:
          ^
SyntaxError: invalid syntax
(lldb) target create "gcc-14"
Current executable set to 'gcc-14' (x86_64).
(lldb) b posix_spawn
Breakpoint 1: where = libsystem_kernel.dylib`posix_spawn, address = 0x00007fff202de1e9
(lldb) r test.c -o t
Process 87222 launched: '/usr/local/bin/gcc-14' (x86_64)
Process 87222 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp
    0x7fff2031c1ea <+1>: movq   %rsp, %rbp
    0x7fff2031c1ed <+4>: pushq  %r15
    0x7fff2031c1ef <+6>: pushq  %r14
Target 0: (gcc-14) stopped.
(lldb) p (char*)$rsi
(char *) $0 = 0x00000001005063c0 "/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/cc1"
(lldb) command add 1
invalid command 'command add'.
(lldb) breakpoint command add 1 
Enter your debugger command(s).  Type 'DONE' to end.
> p (char*)$rsi 
(lldb) c
Process 87222 resuming
(lldb)  p (char*)$rsi
(char *) $1 = 0x00007ffeefbfeea0 "/Volumes/10136/flutter/bin/as"

Process 87222 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp
    0x7fff2031c1ea <+1>: movq   %rsp, %rbp
    0x7fff2031c1ed <+4>: pushq  %r15
    0x7fff2031c1ef <+6>: pushq  %r14
Target 0: (gcc-14) stopped.
(lldb) c
Process 87222 resuming
(lldb)  p (char*)$rsi
(char *) $2 = 0x00007ffeefbfeea0 "/usr/local/cuda/lib/as"

Process 87222 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp
    0x7fff2031c1ea <+1>: movq   %rsp, %rbp
    0x7fff2031c1ed <+4>: pushq  %r15
    0x7fff2031c1ef <+6>: pushq  %r14
Target 0: (gcc-14) stopped.
(lldb) c
Process 87222 resuming
(lldb)  p (char*)$rsi
(char *) $3 = 0x00007ffeefbfeea0 "/usr/local/cuda/extras/CUPTI/lib/as"

Process 87222 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp
    0x7fff2031c1ea <+1>: movq   %rsp, %rbp
    0x7fff2031c1ed <+4>: pushq  %r15
    0x7fff2031c1ef <+6>: pushq  %r14
Target 0: (gcc-14) stopped.
(lldb) c
Process 87222 resuming
(lldb)  p (char*)$rsi
(char *) $4 = 0x00007ffeefbfeea0 "/usr/local/anaconda3/bin/as"

Process 87222 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp
    0x7fff2031c1ea <+1>: movq   %rsp, %rbp
    0x7fff2031c1ed <+4>: pushq  %r15
    0x7fff2031c1ef <+6>: pushq  %r14
Target 0: (gcc-14) stopped.
(lldb) c
Process 87222 resuming
(lldb)  p (char*)$rsi
(char *) $5 = 0x0000000100704b90 "/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2"

Process 87222 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp
    0x7fff2031c1ea <+1>: movq   %rsp, %rbp
    0x7fff2031c1ed <+4>: pushq  %r15
    0x7fff2031c1ef <+6>: pushq  %r14
Target 0: (gcc-14) stopped.
(lldb) c
Process 87222 resuming
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
Process 87222 exited with status = 1 (0x00000001) 

发现是最后一个apiposix_spawn是调用/usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2

运行一下 它加一个-debug参数

 /usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2    -debug  
//...去掉一堆
Looking for 'gcc'
collect2 version 14.2.0
ld_file_name        = /usr/local/anaconda3/bin/ld
c_file_name         = /usr/bin/gcc
nm_file_name        = /usr/local/anaconda3/bin/nm
strip_file_name     = /usr/local/anaconda3/bin/strip
c_file              = a.out.cdtor.c
o_file              = a.out.cdtor.o

看起来是使用了 /usr/local/anaconda3/bin/ld 我晕。

这个一堆都使用了这个目录下的,先临时屏蔽一下,

mv  /usr/local/anaconda3/bin  /usr/local/anaconda3/bin.bak

再执行

 /usr/local/Cellar/gcc/14.2.0_1/bin/../libexec/gcc/x86_64-apple-darwin20/14/collect2    -debug  
//...
Looking for 'gcc'
collect2 version 14.2.0
ld_file_name        = /usr/bin/ld
c_file_name         = /usr/bin/gcc
nm_file_name        = /usr/bin/nm
strip_file_name     = /usr/bin/strip
c_file              = a.out.cdtor.c
o_file              = a.out.cdtor.o

/usr/bin/ld
ld: warning: platform not specified
ld: warning: -arch not specified
ld: warning: No platform min-version specified on command line
ld: no object files specified
collect2: error: ld returned 1 exit status

看起来好了,再试试编译

$  gcc-14 test.c -o t && ./t
Hello Cruel World!

完美解决!!

这个anaconda的ld和系统的是不匹配的,但是它为了penv把这个替换了,结果collect2使用了它设置的工具链的ld. 然后引起这个问题。

这个python连gcc也搞乱了,真是服,自己乱就好了。为什么祸害别人?

本文希望可以帮到需要的人,要是遇到这个的,可能原因不大一样,但是这个文章把debug和定位的方法和原理都告诉大家了,祝大好运!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/958450.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

缓存之美:万文详解 Caffeine 实现原理(下)

上篇文章&#xff1a;缓存之美&#xff1a;万文详解 Caffeine 实现原理&#xff08;上&#xff09; getIfPresent 现在我们对 put 方法有了基本了解&#xff0c;现在我们继续深入 getIfPresent 方法&#xff1a; public class TestReadSourceCode {Testpublic void doRead() …

Spring Security(maven项目) 3.0.2.6版本—总

通过实践而发现真理&#xff0c;又通过实践而证实真理和发展真理。从感性认识而能动地发展到理性认识&#xff0c;又从理性认识而能动地指导革命实践&#xff0c;改造主观世界和客观世界。实践、认识、再实践、再认识&#xff0c;这种形式&#xff0c;循环往复以至无穷&#xf…

C++函数——fill

在C中&#xff0c;std::fill 是标准库提供的一个算法适用于几乎所有类型的容器&#xff0c;只要这些容器支持迭代器操作。具体来说&#xff0c;std::fill 的适用性取决于容器是否提供了满足其要求的迭代器类型&#xff0c;用于将指定范围内的所有元素设置为某个特定值。它是一个…

jmeter中对接口进行循环请求后获取相应数据

1、工作中遇到一个场景就是对某个单一接口进行循环请求&#xff0c;并需要获取每次请求后返回的相应数据&#xff1b; 2、首先就在jmeter对接口相关组件进行配置&#xff0c;需要组件有&#xff1a;循环控制器、CSV数据文件设置、计数器、访问接口、HTTP信息头管理器、正则表达…

豆包MarsCode 蛇年编程大作战 | 高效开发“蛇年运势预测系统”

&#x1f31f; 嗨&#xff0c;我是LucianaiB&#xff01; &#x1f30d; 总有人间一两风&#xff0c;填我十万八千梦。 &#x1f680; 路漫漫其修远兮&#xff0c;吾将上下而求索。 豆包MarsCode 蛇年编程大作战 | &#x1f40d; 蛇年运势预测 在线体验地址&#xff1a;蛇年…

【豆包MarsCode蛇年编程大作战】花样贪吃蛇

目录 引言 展示效果 prompt提示信息 第一次提示&#xff08;实现基本功能&#xff09; 初次实现效果 第二次提示&#xff08;美化UI&#xff09; 第一次美化后的效果 第二次美化后的效果 代码展示 实现在线体验链接 码上掘金使用教程 体验地址&#xff1a; 花样贪吃蛇…

github汉化

本文主要讲述了github如何汉化的方法。 目录 问题描述汉化步骤1.打开github&#xff0c;搜索github-chinese2.打开项目&#xff0c;打开README.md3.下载安装脚本管理器3.1 在README.md中往下滑动&#xff0c;找到浏览器与脚本管理器3.2 选择浏览器对应的脚本管理器3.2.1 点击去…

K8S 启动探测、就绪探测、存活探测

先来思考一个问题&#xff1a; 在 Deployment 执行滚动更新 web 应用的时候&#xff0c;总会出现一段时间&#xff0c;Pod 对外提供网络访问&#xff0c;但是页面访问却发生404&#xff0c;这个问题要如何解决呢&#xff1f;学完今天的内容&#xff0c;相信你会有自己的答案。 …

如何使用CRM数据分析优化销售和客户关系?

嘿&#xff0c;大家好&#xff01;你有没有想过为什么有些公司在市场上如鱼得水&#xff0c;而另一些却在苦苦挣扎&#xff1f;答案可能就藏在他们的销售策略和客户关系管理&#xff08;CRM&#xff09;系统里。今天我们要聊的就是如何通过有效的 CRM 数据分析来提升你的销售额…

语音转文字的先驱-认识Buzz的前世今生

Buzz 是一款基于 OpenAI Whisper 模型开发的开源语音转文字工具&#xff0c;其历史可以追溯到 Whisper 模型的推出&#xff0c;并在之后逐渐发展为一个功能强大且广泛使用的工具。以下是关于 Buzz 的详细历史介绍&#xff1a; 1. Whisper 模型的背景 Buzz 的核心是 OpenAI 开…

宝塔Linux+docker部署nginx出现403 Forbidden

本文主要讲述了宝塔docker部署nginx出现403 Forbidden的原因&#xff0c;以及成功部署前端的方法步骤。 目录 1、问题描述2、问题检测2.1 检测监听端口是否异常2.2 检测Docker容器是否异常2.2.1 打开宝塔Linux的软件商店&#xff0c;找到Docker管理器&#xff0c;查看前端容器是…

LabVIEW项目中的工控机与普通电脑选择

工控机&#xff08;Industrial PC&#xff09;与普通电脑在硬件设计、性能要求、稳定性、环境适应性等方面存在显著差异。了解这些区别对于在LabVIEW项目中选择合适的硬件至关重要。下面将详细分析这两种设备的主要差异&#xff0c;并为LabVIEW项目中的选择提供指导。 ​ 硬件设…

QT6 + CMAKE编译OPENCV3.9

参考文档 [1] https://blog.csdn.net/rjkf_css/article/details/135676077 前提条件 配置好相关运行环境&#xff1a;QT6、OPENCV3.9的sources文件 OPENCV下载网页&#xff1a;https://opencv.org/releases/ QT6下载教程&#xff1a;https://blog.csdn.net/caoshangpa/article…

消息队列篇--基础篇(消息队列特点,应用场景、点对点和发布订阅工作模式,RabbmitMQ和Kafka代码示例等)

1、消息队列的介绍 消息&#xff08;Message&#xff09;是指在应用之间传送的数据&#xff0c;消息可以非常简单&#xff0c;比如只包含文本字符串&#xff0c;也可以更复杂&#xff0c;可能包含嵌入对象。 消息队列&#xff08;Message Queue&#xff0c;简称MQ&#xff09…

状态模式——C++实现

目录 1. 状态模式简介 2. 代码示例 3. 单例状态对象 4. 状态模式与策略模式的辨析 1. 状态模式简介 状态模式是一种行为型模式。 状态模式的定义&#xff1a;状态模式允许对象在内部状态改变时改变它的行为&#xff0c;对象看起来好像修改了它的类。 通俗的说就是一个对象…

GESP202309 三级【进制判断】题解(AC)

》》》点我查看「视频」详解》》》 [GESP202309 三级] 进制判断 题目描述 N N N 进制数指的是逢 N N N 进一的计数制。例如&#xff0c;人们日常生活中大多使用十进制计数&#xff0c;而计算机底层则一般使用二进制。除此之外&#xff0c;八进制和十六进制在一些场合也是常用…

汽车敏捷开发:项目经理如何精准跟进项目流程

在敏捷开发环境中&#xff0c;项目经理身兼协调者、推动者、决策者等关键角色。 作为协调者&#xff0c;需在团队及部门间搭建沟通桥梁&#xff0c;确保信息流畅。 作为推动者&#xff0c;面对迭代中的技术难题、资源短缺等阻碍&#xff0c;要主动寻找解决方案&#xff0c;为…

数据从前端传到后端入库过程分析

数据从前端传到后端入库过程分析 概述 积累了一些项目经验&#xff0c;成长为一个老程序员了&#xff0c;自认为对各种业务和技术都能得心应手的应对了&#xff0c;殊不知很多时候我们借助了搜索引擎的能力&#xff0c;当然现在大家都是通过AI来武装自己。 今天要分析的话题是…

Netty 实战

Netty实践 1 Netty 版本选择2 Netty 模版代码2.1 Server2.2 Client 3 组件3.1 EventLoop、EventLoopGroup3.1.1 EventLoop3.1.2 EventLoopGroup 3.2 Channel3.2.1 ChannelFuture3.2.2 CloseFuture 3.3 ChannelHandler3.2.1 常用的 ChannelInboundHandlerAdapter3.2.1.1 LineBas…

Triton:内存高效注意力机制的实现与解析

Triton:内存高效注意力机制的实现与解析 引言 在深度学习领域&#xff0c;特别是自然语言处理&#xff08;NLP&#xff09;任务中&#xff0c;注意力机制是模型理解序列数据的关键组成部分。然而&#xff0c;随着模型规模和输入长度的增长&#xff0c;传统的注意力机制面临着…