Saki's 研究记录

Golang 1.18 报错:linkname must refer to declared function or variable
问题最近在mac上升级golang到1.18版本,新建gin服务执行go run时报错: 123456789101112# golang.org/x/sys/unix../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-2...
(MAC Big Sur 12.1) ImportError: dlopen libpq
问题在python脚本中连接postgres时遇到以下问题: 12345678Traceback (most recent call last): File "/Users/shenshijie/Documents/app/postgres/connect.py", line 2, in <module> import psycopg2 File "/opt/homebrew/lib/python3.9/site-packages/psycopg2/__init__.py", line 51, in <module>...
Mac OSX下执行crosstool-ng问题记录
环境系统:MacOS Big Sur 11.6.1 ct-ng:GNU Make 4.3 / Built for x86_64-apple-darwin20.1.0 前言在Mac下面使用HomeBrew安装了crosstool-ng来编译aarch64上的代码,结果在执行的时候报告如下错误: 12345ct-ng source[INFO ] Performing some trivial sanity checks[WARN ] Number of open files 256 may not be sufficient to build the toolchain; increa...
Golang 交叉编译报错 XX is invalid in C99
环境 macOS: 11.6.1 (Big Sur)gcc version: apple clang version 13.0.0 (clang-1300.0.29.3)Ubuntu: 16.04.6 LTSCentOS: Linux release 8.4.2105 (Core) 背景最近在使用redis-full-check来对比两个redis的数据是否一致,在macos上进行开发,编译后再上传到ubuntu系统的服务器上运行。 问题这就导致我需要使用到golang的交叉编译,golang默认支持交叉编译,只在编译时配置对应平台的编译参数即可: 123456# linuxCGO_E...