当前位置: 首页 > news >正文

从根源分析,调试,定位和解决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) 		 = returnopen("/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.1frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp0x7fff2031c1ea <+1>: movq   %rsp, %rbp0x7fff2031c1ed <+4>: pushq  %r150x7fff2031c1ef <+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.1frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp0x7fff2031c1ea <+1>: movq   %rsp, %rbp0x7fff2031c1ed <+4>: pushq  %r150x7fff2031c1ef <+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.1frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp0x7fff2031c1ea <+1>: movq   %rsp, %rbp0x7fff2031c1ed <+4>: pushq  %r150x7fff2031c1ef <+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.1frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp0x7fff2031c1ea <+1>: movq   %rsp, %rbp0x7fff2031c1ed <+4>: pushq  %r150x7fff2031c1ef <+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.1frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp0x7fff2031c1ea <+1>: movq   %rsp, %rbp0x7fff2031c1ed <+4>: pushq  %r150x7fff2031c1ef <+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.1frame #0: 0x00007fff2031c1e9 libsystem_kernel.dylib`posix_spawn
libsystem_kernel.dylib`posix_spawn:
->  0x7fff2031c1e9 <+0>: pushq  %rbp0x7fff2031c1ea <+1>: movq   %rsp, %rbp0x7fff2031c1ed <+4>: pushq  %r150x7fff2031c1ef <+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和定位的方法和原理都告诉大家了,祝大好运!

相关文章:

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

你要是遇到同样错误&#xff0c;找一圈都没有解决&#xff0c;建议认真读一下本文&#xff0c;这个应该是最终极的解决办法&#xff0c;从原理上剖析了产生的原因&#xff0c;同时给出来了调试和定位的办法。 maccos使用brew安装了一个gcc14, 结果编译一个最简单的程序都报错&a…...

【Uniapp-Vue3】previewImage图片预览

如果我们想要实现点击一张图片放大&#xff0c;并能够左右滑动&#xff0c;就要使用previewImage这个API。 uni.previewImage({ current:xxx, // 当前图片下标 urls:xxx, // 图片路径组 // 其他参数 }) 我们先编写一个点击图片的事件&#xff0c;并传递当前点击图片的下标&…...

doris:Insert Into Values

INSERT INTO VALUES 语句支持将 SQL 中的值导入到 Doris 的表中。INSERT INTO VALUES 是一个同步导入方式&#xff0c;执行导入后返回导入结果。可以通过请求的返回判断导入是否成功。INSERT INTO VALUES 可以保证导入任务的原子性&#xff0c;要么全部导入成功&#xff0c;要么…...

15 分布式锁和分布式session

在java中一个进程里面使用synchronized在new出来对象头信息中加锁&#xff0c;如果是静态方法中在加载的类信息中加锁(我们在锁的原理中讲过)。如果使用lock加锁可以自己指定。这些都是在同一个进程空间中的操作。如果在分布式环境中由于程序不在一个进程空间&#xff0c;就没办…...

迅为RK3568开发板篇OpenHarmony实操HDF驱动控制LED-添加内核编译

编译内核时将该 HDF 驱动编译到镜像中&#xff0c;接下来编写驱动编译脚本 Makefile&#xff0c;代码如下所示&#xff1a; 加入编译体系&#xff0c;填加模块目录到 drivers/hdf_core/adapter/khdf/linux/Makefile 文件 更多内容可以关注&#xff1a;迅为RK3568开发板篇OpenHa…...

C语言练习(23)

求两个整数的最大公约数和最小公倍数&#xff0c;用一个函数求最大公约数&#xff0c;用另一函数根据求出的最大公约数求最小公倍数。 ①不用全局变量&#xff0c;分别用两个函数求最大公约数和最小公倍数。两个整数在主函数中输入&#xff0c;并传送给函数f1&#xff0c;求出…...

LabVIEW 太阳能光伏发电系统智能监控

本文介绍了基于 LabVIEW 的太阳能光伏发电监控系统的设计与实现&#xff0c;着重探讨了其硬件配置、软件架构以及系统的实现方法。该系统能够有效提高太阳能光伏发电的监控效率和精确性&#xff0c;实现了远程监控和数据管理的智能化。 ​ 项目背景 在当前能源紧张与环境污染…...

大唐杯赛道一国一备赛思路

前情&#xff1a;本人非通信专业&#xff0c;打这个比赛纯粹为了保研加分&#xff0c;因为本人同届同学院的人参加了一次&#xff0c;获得了省级&#xff0c;加上有保研学长说这个比赛挺简单的&#xff0c;一直想参加的&#xff0c;机缘巧合下和另一个需要保研的同学组队&#…...

用户中心项目教程(五)---MyBatis-Plus完成后端初始化+测试方法

文章目录 1.数据库的链接和创建2.建库建表语句3.引入依赖4.yml配置文件5.添加相对路径6.实体类的书写7.Mapper接口的定义8.启动类的指定9.单元测试10运行时的bug 1.数据库的链接和创建 下面的这个就是使用的我们的IDEA链接这个里面的数据库&#xff1a; 接下来就是输入这个用户…...

深圳市云盟智慧科技有限公司智慧停车管理系统 SQL注入漏洞复现(附脚本)

免责申明: 本文所描述的漏洞及其复现步骤仅供网络安全研究与教育目的使用。任何人不得将本文提供的信息用于非法目的或未经授权的系统测试。作者不对任何由于使用本文信息而导致的直接或间接损害承担责任。如涉及侵权,请及时与我们联系,我们将尽快处理并删除相关内容。 0x0…...

PySide(PyQT)进行SQLite数据库编辑和前端展示的基本操作

以SQLite数据库为例&#xff0c;学习数据库的基本操作&#xff0c;使用QSql模块查询、编辑数据并在前端展示。 SQLite数据库的基础知识&#xff1a; https://blog.csdn.net/xulibo5828/category_12785993.html?fromshareblogcolumn&sharetypeblogcolumn&sharerId1278…...

利用 SAM2 模型探测卫星图像中的农田边界

将 Segment Anything Model Version 2 应用于卫星图像以检测和导出农业地区田地边界的分步教程 &#x1f31f; 简介 手动绘制田地边界是最耗时的任务之一&#xff0c;其准确性取决于绘制者的表现。然而&#xff0c;精确的边界检测在很多领域都有应用。例如&#xff0c;假设您…...

前端路由的hash模式和history模式

hash 模式和 history 模式是前端路由实现的两种常见方式&#xff0c;分别基于不同的浏览器特性实现。下面从浏览器实现、前端框架实现及相关标准定义三个方面详细解释这两种模式。 1. 浏览器实现 1.1 Hash 模式 • 核心机制&#xff1a; • 基于浏览器的 location.hash 属性…...

日志收集Day005

1.filebeat的input类型之filestream实战案例: 在7.16版本中已经弃用log类型,之后需要使用filebeat,与log不同&#xff0c;filebeat的message无需设置就是顶级字段 1.1简单使用&#xff1a; filebeat.inputs: - type: filestreamenabled: truepaths:- /tmp/myfilestream01.lo…...

代码随想录 二叉树 test 2

二叉树的非递归遍历 先序 方法一: 先保存根节点&#xff0c;用来之后找到右子树(利用栈来回溯到根&#xff0c;进而找到右子树) class Solution { public:vector<int> preorderTraversal(TreeNode* root) {vector<int> res; //存遍历序列stack<TreeNode*…...

浏览器默认语言与页面访问统计问题二三则

文章目录 前言网站默认语言问题网站访问统计问题Error: Empty components are self-closingError: A space is required before closing bracket 总结 前言 看标题大概能猜到这是一篇杂合体的总结&#xff0c;是这两天处理网站遇到的小问题&#xff0c;怕过段时间再忘了所以总…...

用Python绘制一只懒羊羊

目录 一、准备工作 二、Turtle库简介 三、绘制懒羊羊的步骤 1. 导入Turtle库并设置画布 2. 绘制头部 3. 绘制眼睛 4. 绘制嘴巴 5. 绘制身体 6. 绘制四肢 7. 完成绘制 五、运行代码与结果展示 六、总结 在这个趣味盎然的技术实践中,我们将使用Python和Turtle图形…...

虹科分享 | 汽车NVH小课堂之听音辨故障

随着车主开始关注汽车抖动异响问题&#xff0c;如何根据故障现象快速诊断异响来源&#xff0c;成了汽修人的必修课。 一个比较常用的方法就是靠“听”——“听音辨故障”。那今天&#xff0c;虹科Pico也整理了几个不同类型的异响声音&#xff0c;一起来听听看你能答对几个吧 汽…...

论文速读|SigLIP:Sigmoid Loss for Language Image Pre-Training.ICCV23

论文地址&#xff1a;https://arxiv.org/abs/2303.15343v4 代码地址&#xff1a;https://github.com/google-research/big_vision bib引用&#xff1a; misc{zhai2023sigmoidlosslanguageimage,title{Sigmoid Loss for Language Image Pre-Training}, author{Xiaohua Zhai and…...

深度学习笔记——循环神经网络之LSTM

大家好&#xff0c;这里是好评笔记&#xff0c;公主号&#xff1a;Goodnote&#xff0c;专栏文章私信限时Free。本文详细介绍面试过程中可能遇到的循环神经网络LSTM知识点。 文章目录 文本特征提取的方法1. 基础方法1.1 词袋模型&#xff08;Bag of Words, BOW&#xff09;工作…...

国防科技大学计算机基础课程笔记02信息编码

1.机内码和国标码 国标码就是我们非常熟悉的这个GB2312,但是因为都是16进制&#xff0c;因此这个了16进制的数据既可以翻译成为这个机器码&#xff0c;也可以翻译成为这个国标码&#xff0c;所以这个时候很容易会出现这个歧义的情况&#xff1b; 因此&#xff0c;我们的这个国…...

云计算——弹性云计算器(ECS)

弹性云服务器&#xff1a;ECS 概述 云计算重构了ICT系统&#xff0c;云计算平台厂商推出使得厂家能够主要关注应用管理而非平台管理的云平台&#xff0c;包含如下主要概念。 ECS&#xff08;Elastic Cloud Server&#xff09;&#xff1a;即弹性云服务器&#xff0c;是云计算…...

Golang dig框架与GraphQL的完美结合

将 Go 的 Dig 依赖注入框架与 GraphQL 结合使用&#xff0c;可以显著提升应用程序的可维护性、可测试性以及灵活性。 Dig 是一个强大的依赖注入容器&#xff0c;能够帮助开发者更好地管理复杂的依赖关系&#xff0c;而 GraphQL 则是一种用于 API 的查询语言&#xff0c;能够提…...

(二)原型模式

原型的功能是将一个已经存在的对象作为源目标,其余对象都是通过这个源目标创建。发挥复制的作用就是原型模式的核心思想。 一、源型模式的定义 原型模式是指第二次创建对象可以通过复制已经存在的原型对象来实现,忽略对象创建过程中的其它细节。 📌 核心特点: 避免重复初…...

【Web 进阶篇】优雅的接口设计:统一响应、全局异常处理与参数校验

系列回顾&#xff1a; 在上一篇中&#xff0c;我们成功地为应用集成了数据库&#xff0c;并使用 Spring Data JPA 实现了基本的 CRUD API。我们的应用现在能“记忆”数据了&#xff01;但是&#xff0c;如果你仔细审视那些 API&#xff0c;会发现它们还很“粗糙”&#xff1a;有…...

智能仓储的未来:自动化、AI与数据分析如何重塑物流中心

当仓库学会“思考”&#xff0c;物流的终极形态正在诞生 想象这样的场景&#xff1a; 凌晨3点&#xff0c;某物流中心灯火通明却空无一人。AGV机器人集群根据实时订单动态规划路径&#xff1b;AI视觉系统在0.1秒内扫描包裹信息&#xff1b;数字孪生平台正模拟次日峰值流量压力…...

css3笔记 (1) 自用

outline: none 用于移除元素获得焦点时默认的轮廓线 broder:0 用于移除边框 font-size&#xff1a;0 用于设置字体不显示 list-style: none 消除<li> 标签默认样式 margin: xx auto 版心居中 width:100% 通栏 vertical-align 作用于行内元素 / 表格单元格&#xff…...

【Go语言基础【12】】指针:声明、取地址、解引用

文章目录 零、概述&#xff1a;指针 vs. 引用&#xff08;类比其他语言&#xff09;一、指针基础概念二、指针声明与初始化三、指针操作符1. &&#xff1a;取地址&#xff08;拿到内存地址&#xff09;2. *&#xff1a;解引用&#xff08;拿到值&#xff09; 四、空指针&am…...

从 GreenPlum 到镜舟数据库:杭银消费金融湖仓一体转型实践

作者&#xff1a;吴岐诗&#xff0c;杭银消费金融大数据应用开发工程师 本文整理自杭银消费金融大数据应用开发工程师在StarRocks Summit Asia 2024的分享 引言&#xff1a;融合数据湖与数仓的创新之路 在数字金融时代&#xff0c;数据已成为金融机构的核心竞争力。杭银消费金…...

CVPR2025重磅突破:AnomalyAny框架实现单样本生成逼真异常数据,破解视觉检测瓶颈!

本文介绍了一种名为AnomalyAny的创新框架&#xff0c;该方法利用Stable Diffusion的强大生成能力&#xff0c;仅需单个正常样本和文本描述&#xff0c;即可生成逼真且多样化的异常样本&#xff0c;有效解决了视觉异常检测中异常样本稀缺的难题&#xff0c;为工业质检、医疗影像…...