从根源分析,调试,定位和解决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
你要是遇到同样错误,找一圈都没有解决,建议认真读一下本文,这个应该是最终极的解决办法,从原理上剖析了产生的原因,同时给出来了调试和定位的办法。 maccos使用brew安装了一个gcc14, 结果编译一个最简单的程序都报错&a…...
Linux的权限和一些shell原理
目录 shell的原理 Linux权限 sudo命令提权 权限 文件的属性 ⽂件类型: 基本权限: chmod改权限 umask chown 该拥有者 chgrp 改所属组 最后: 目录权限 粘滞位 shell的原理 我们广义上的Linux系统 Linux内核Linux外壳 Linux严格…...
构建企业级React应用的进阶实践
构建企业级React应用的进阶实践 在当今前端开发领域,React凭借其组件化架构和声明式编程范式,已成为构建复杂用户界面的首选方案。本文将深入探讨React的高级应用场景,通过一系列精心设计的代码示例,展示如何打造高性能、可维护的…...
2024年度总结:技术探索与个人成长的交织
文章目录 前言年度创作回顾:技术深耕与分享数据库技术:MySQL 与 MyBatisJava 及相关技术栈计算机网络:构建网络知识体系思维方式的转变:构建技术知识体系的桥梁 项目实践:人工智能与智慧医疗的碰撞生活与博客的融合与平…...
mysql-06.JDBC
目录 什么是JDBC: 为啥存在JDBC: JDBC工作原理: JDBC的优势: 下载mysql驱动包: 用java程序操作数据库 1.创建dataSource: 2.与服务端建立连接 3.构造sql语句 4.执行sql 5.关闭连接,释放资源 参考代码: 插…...
arm-linux平台、rk3288 SDL移植
一、所需环境资源 1、arm-linux交叉编译器,这里使用的是gcc-linaro-6.3.1 2、linux交叉编译环境,这里使用的是Ubuntu 20.04 3、sdl2源码 https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.11.tar.gz 二、代码编译 1、解压sdl2源码…...
CentOS 上安装 Go (Golang)
1. 检查系统环境 确保系统为 CentOS 7 或 CentOS 8,或者其他兼容的 Linux 发行版。 cat /etc/os-release2. 安装依赖 安装一些必要的工具: sudo yum update -y sudo yum install -y wget tar3. 下载 Go 从 Go 官方下载页面获取适用于 Linux 的最新版…...
小哆啦解题记:整数转罗马数字
小哆啦解题记:整数转罗马数字 小哆啦开始力扣每日一题的第十四天 https://leetcode.cn/problems/integer-to-roman/submissions/595220508/ 第一章:神秘的任务 一天,哆啦A梦接到了一项任务——将一个整数转换为罗马数字。他心想:…...
碰撞体问题
用点检测2d物体是否有物体 功能要求是点击空白处取消选中,点击棋子选中所以我做了一个射线检测。但是脑子的惯性让我用的是3D的射线检测。但我们这是一个2D游戏啊。 Vector3 mousePos pos;mousePos.z 10f; // 假设你需要转换到距离相机10单位的世界位置Vector3 …...
HTML<label>标签
例子 三个带标签的单选按钮: <form action"/action_page.php"> <input type"radio" id"html" name"fav_language" value"HTML"> <label for"html">HTML</label><br&…...
「 机器人 」利用数据驱动模型替代仿真器:加速策略训练并降低硬件依赖
前言 在强化学习(Reinforcement Learning, RL)中,策略训练需要大量的交互数据(状态、动作、奖励、下一状态),而这些数据通常来自仿真器或真实硬件。传统高保真仿真器虽然能在一定程度上模拟飞行器的动力学,但往往计算量大、开发成本高,且仍可能与真实环境存在差距。为此…...
.Net Core微服务入门全纪录(六)——EventBus-事件总线
系列文章目录 1、.Net Core微服务入门系列(一)——项目搭建 2、.Net Core微服务入门全纪录(二)——Consul-服务注册与发现(上) 3、.Net Core微服务入门全纪录(三)——Consul-服务注…...
QD Laser携“Lantana”激光器参展SPIE光子学西部展2025,聚焦紧凑型设计
据悉,QD Laser公司将在2025年SPIE光子学西部展览会上展出其最新产品——世界最小一体化紧凑型可见光激光器“Lantana”。该展会将于1月28日至30日在旧金山的Moscone中心举行。 在展会期间,QD Laser公司将现场展示这款超小型、轻便设备—— “Lantana”。…...
Docker + Nginx 部署个人静态博客指南
本文是一个使用 Docker 和 Nginx 部署个人静态博客的指南。通过本指南,您可以快速了解如何使用 Docker 和 Nginx 部署自己的静态博客网站。 前提 在开始使用本指南之前,请具备以下前提: 首先你得有个服务器服务器已经安装好Git、Vim等工具一…...
springboot3 集成 knife4j(接口文档)
提示:文章是集成 knife4j,而非 swagger2 或者 swagger3,效果如图 文章目录 前言一、添加依赖二、如何集成1.配置文件2.注解部分1.Tag2.Operation3.Parameter4.Schema 3.使用 总结 前言 提示::大家在开发阶段ÿ…...
批量创建ES索引
7.x from elasticsearch import Elasticsearch# 配置 Elasticsearch 连接 # 替换为你的 Elasticsearch 地址、端口、用户名和密码 es Elasticsearch([http://10.10.x.x:43885],basic_auth(admin, XN272G9THEAPYD5N5QORX3PB1TSQELLB) )# # 测试连接 # try: # # 尝试获取集…...
单路由及双路由端口映射指南
远程登录总会遇到登陆不上的情况,可能是访问的大门没有打开哦,下面我们来看看具体是怎么回事? 当软件远程访问时,主机需要两个条件,一是有一个唯一的公网IP地址(运营商提供),二是开…...
基于Springboot + vue实现的民俗网
“前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站:人工智能学习网站” 💖学习知识需费心, 📕整理归纳更费神。 🎉源码免费人人喜…...
動態住宅IP提升網站訪問成功率
動態住宅IP通常與普通家庭用戶的網路連接相關聯。這種IP地址的特點在於,它是動態變化的,用戶在每次連接時可能會獲得不同的IP地址。這與靜態IP形成了鮮明對比,後者在連接期間保持不變。傳統上,IP地址分為住宅IP和數據中心IP兩類。…...
Java集合学习:HashMap的原理
一、HashMap里的Hash是什么? 首先,我们先要搞清楚HashMap里的的Hash是啥意思。 当我们在编程过程中,往往需要对线性表进行查找操作。 在顺序表中查找时,需要从表头开始,依次遍历比较a[i]与key的值是否相等ÿ…...
使用rsync+inotify简单实现文件实时双机双向同步
使用rsyncinotify简单实现文件实时双机双向同步 实现思路 使用inotify-tools的inotifywait工具监控文件变化,触发后使用rsync做同步。加入系统服务项,实现实时监听,方便管理。 以下配置操作,单向同步,只需在单边部…...
[JavaScript] ES6及以后版本的新特性
文章目录 箭头函数(Arrow Functions)为什么需要箭头函数?箭头函数的完整语法箭头函数中的 this实用场景 解构赋值(Destructuring Assignment)为什么需要解构赋值?数组解构赋值的完整用法对象解构赋值的完整…...
IO进程 寒假作业
一、请使用消息队列实现2个终端之间互相聊天 #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <sys/wait.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> …...
无公网IP 外网访问媒体服务器 Emby
Emby 是一款多媒体服务器软件,用户可以在 Emby 创建自己的个人多媒体娱乐中心,并且可以跨多个设备访问自己的媒体库。它允许用户管理传输自己的媒体内容,比如电影、电视节目、音乐和照片等。 本文将详细的介绍如何利用 Docker 在本地部署 Emb…...
【2025小年源码免费送】
💖学习知识需费心, 📕整理归纳更费神。 🎉源码免费人人喜, 🔥码农福利等你领! 💖山高路远坑又深, 📕大军纵横任驰奔, 🎉谁敢横刀立马行…...
哈希表示例
示例1 两数之和 "两数之和"(Two Sum)是LeetCode上的一个经典算法问题,编号为1,它要求在一个整数数组nums中找到两个不同的索引i和j,使得nums[i] nums[j] target。 问题描述: 给定一个整数数…...
VS企业版和专业版的区别
网上查询vs分析dump文件,查找托管内存泄露,需要使用“调试托管内存”功能,当前安装的vs2022 专用版找不到这个选项,vs2015是ok的,比较版本发现2022是专业版,2015是企业版。网上搜索专业版和企业版差异如下&…...
YOLOv10-1.1部分代码阅读笔记-train.py
train.py ultralytics\models\yolov10\train.py 目录 train.py 1.所需的库和模块 2.class YOLOv10DetectionTrainer(DetectionTrainer): 1.所需的库和模块 from ultralytics.models.yolo.detect import DetectionTrainer from .val import YOLOv10DetectionValidator fr…...
autogen 自定义agent (1)
目录 第一个自定义agent:CountDownAgent代码运行逻辑1. 创建 CountDownAgent 代理2. 处理消息3. 运行 CountDownAgent 另一种调用方式类似的agent: CountUpAgent 第一个自定义agent:CountDownAgent from typing import AsyncGenerator, List, Sequence,…...
ssh密钥登录GitHub时一直提示“Error: Permission denied (publickey)”
起因 环境:Windows10 背景:之前就是按照官方说明创建个rsa密钥,在git后台添加上,就行了,近期怎么添加怎么失败,总是“Error: Permission denied (publickey)”的提示! 尝试 各种尝试…...
多模态数据融合的基本流程与关键环节
多模态数据融合作为人工智能的重要技术方向,不仅整合了视觉、语言、语音、传感器等多种模态的数据,还通过合理的融合方法让机器获得更全面的感知能力。那么,多模态数据融合的过程是怎样的?有哪些关键环节需要注意?今天…...
k8s 蓝绿发布、滚动发布、灰度发布
在Kubernetes(k8s)中,蓝绿发布、滚动发布、灰度发布(金丝雀发布)是三种常见的应用部署和更新策略。下面将分别对这几种发布方式进行说明,并给出相应的例子。 蓝绿发布 蓝绿发布是一种无缝切换版本的部署策…...
【PyCharm】连接Jupyter Notebook
【PyCharm】相关链接 【PyCharm】连接 Git【PyCharm】连接Jupyter Notebook【PyCharm】快捷键使用【PyCharm】远程连接Linux服务器【PyCharm】设置为中文界面 【PyCharm】连接Jupyter Notebook PyCharm连接Jupyter Notebook的过程可以根据不同的需求分为 本地连接 和 远程连…...
【miniconda】:langraph的windows构建
langraph需要python3.11 langraph强烈建议使用py3.11 默认是3.12 官方 下载仓库 下载老版本的python (后续发现新版miniconda也能安装老版本的python) 在这里...
NRF52840 USB Dongle 进行蓝牙抓包
1、可视化抓包 官方的工具 链接:RF Connect for Desktop ,之后使用 bluetooth Low Energy 即可查看抓包数据。不做说明。 本节主要说明,使用wireshark进行抓包数据的显示。 1.1、硬件 Nordic Semiconductor 官网链接 的截图如下。国内封装…...
【C++】详细讲解继承(下)
本篇来继续说说继承。上篇可移步至【C】详细讲解继承(上) 1.继承与友元 友元关系不能继承 ,也就是说基类友元不能访问派⽣类私有和保护成员。 class Student;//前置声明class Same //基类 { public:friend void Fun(const Same& p, con…...
OS Copilot功能测评:智能助手的炫彩魔法
简介: OS Copilot 是一款融合了人工智能技术的智能助手,专为Linux系统设计,旨在提升系统管理和运维效率。本文详细介绍了在阿里云ECS实例上安装和体验OS Copilot的过程,重点评测了其三个核心参数:-t(模式…...
Gin 学习笔记
教程地址:https://www.bilibili.com/video/BV1FV4y1C72M?spm_id_from333.788.videopod.sections&vd_source707ec8983cc32e6e065d5496a7f79ee6 01-项目搭建 各常用目录的说明: https://github.com/golang-standards/project-layout/blob/master/REA…...
windows在命令行中切换盘符
一、问题描述 我们在使用windows的cmd(命令行)时,经常需要用cd命令在不同盘之间切换路径。但有时在不同盘之间切换时,会发现命令不起作用。 如下图所示,直接切换目录还是停留在原来的位置。 二、解决方法 首先切换盘符…...
OpenAI模块重构
文章目录 1.common-openai-starter1.目录结构2.OpenAiProperties.java 新增apiUrl3.OpenAIAutoConfiguration.java4.OpenAiClient.java 使用gson重构 2.common-openai-starter-demo1.目录结构2.application.yml 新增api-url3.OpenAiController.java4.OpenAiApplication.java5.测…...
表的增删改查(MySQL)
1. 表的增删改查 CRUD : Create(创建), Retrieve(读取),Update(更新),Delete(删除) 1.1 Create 语法: INSERT [INTO] table_name [(column [, column] ...)] VALUES (value_list) [, (value_list)] ...value_list:…...
Go 不可重复协程安全队列
代码实现 package dataStructimport ("errors""sync" )// GenericQueue 是一个支持泛型的不可重复队列,具有最大长度限制 // T 是泛型参数 type GenericQueue[T comparable] struct {items map[T]struct{} // 使用 map 来存储元素order []…...
每日一题 419. 棋盘上的战舰
419. 棋盘上的战舰 简单 class Solution { public:int countBattleships(vector<vector<char>>& board) {int ans 0;for(int i0;i<board.size();i){for(int j0;j<board[0].size();j){if(board[i][j] X){dfs(board,i,j);ans;}}}return ans;}void dfs(…...
spring cloud alibaba 使用示例
spring cloud alibaba example spring cloud alibaba nacos 配置中心、spring cloud alibaba nacos 服务注册与发现、openfeign 服务调用、spring cloud loadbalancer 负载均衡、spring cloud alibaba sentinel 限流降级、spring cloud alibaba seata 分布式事务、spring clou…...
Python数据分析-Python语法基础,IPython和Jupyter-Notebooks(二)
title: ‘Python数据分析:Python语法基础,IPython和Jupyter Notebooks(二)’ tags: python数据分析 categories:python数据分析 keywords:python数据分析 cover: …/img/404_icecream_whale.png description: 本文介绍python的基础语法和jup…...
领域驱动设计(DDD)Spring Boot 3 实现 二
使用 Spring Boot 3 实现领域驱动设计(DDD)是一种很自然的选择,因为 Spring 提供了良好的生态支持,特别是在分层架构、依赖管理、事件驱动等方面。以下是如何在 Spring Boot 3 中结合 DDD 进行开发的详细指南: 项目结构…...
Vue.js 高级组件开发
Vue.js 高级组件开发:构建一个智能动态表单生成器 ——从可复用架构到性能优化的全链路实践 引言:为什么需要高级组件? 在现代前端开发中,组件不仅是UI的封装,更是业务逻辑的载体。一个“高级”Vue组件应当具备&…...
wangEditor富文本编辑器,Laravel上传图片配置和使用
文章目录 前言步骤1. 构造好前端模版2. 搭建后端存储3. 调试 前言 由于最近写项目需要使用富文本编辑器,使用的是VUE3.0版本所以很多不兼容,实际测试以后推荐使用wangEditor 步骤 构造好前端模版搭建后端存储调试 1. 构造好前端模版 安装模版 模版安…...
Hive之加载csv格式数据到hive
场景: 今天接了一个需求,将测试环境的hive数据导入到正式环境中。但是不需要整个流程的迁移,只需要迁移ads表 解决方案: 拿到这个需求首先想到两个方案: 1、将数据通过insert into语句导出,然后运行脚本 …...
0164__【GNU】gcc -O编译选项 -Og -O0 -O1 -O2 -O3 -Os
【GNU】gcc -O编译选项 -Og -O0 -O1 -O2 -O3 -Os_gcc -o0-CSDN博客...