问题描述
我正在尝试构建MariaDB v10.3和x86_64 Debian内核v4.19上的 musl 工具链.我主要使用musl-gcc
gcc
包装器来实现此目的.我安装的相关软件包如下:
I am trying to build MariaDB v10.3 with a musl tool chain on x86_64 Debian kernel v4.19. I have mainly been using the musl-gcc
gcc
wrapper to achieve this. The relevant packages I installed are as follows:
-
musl
(1.1.21-2):标准C库 -
musl-dev
(1.1.21-2):标准C库开发文件 -
musl-tools
(1.1.21-2):标准C库工具
musl
(1.1.21-2): standard C librarymusl-dev
(1.1.21-2): standard C library development filesmusl-tools
(1.1.21-2): standard C library tools
要构建MariaDB,我首先运行:
To build MariaDB, I first run:
CC=/usr/bin/musl-gcc cmake ../ -DWITHOUT_TOKUDB=1
它干净地退出,然后我跟着:
which exits cleanly, and then I follow that up with:
make CC=/usr/bin/musl-gcc
出现以下错误消息:
Scanning dependencies of target strings-t
[ 12%] Building C object unittest/strings/CMakeFiles/strings-t.dir/strings-t.c.o
[ 12%] Linking CXX executable strings-t
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
make[2]: *** [unittest/strings/CMakeFiles/strings-t.dir/build.make:94: unittest/strings/strings-t] Error 1
make[1]: *** [CMakeFiles/Makefile2:731: unittest/strings/CMakeFiles/strings-t.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
现在,我知道musl正在寻找的库(libgcc_s.so
)位于/lib/gcc/x86_64-linux-gnu/8/
中,但是我尝试使用LDFLAGS
包含该库或将该库符号链接到/usr/lib/x86_64-linux-musl/
的尝试都失败了.
Now I know the library that musl is looking for (libgcc_s.so
) is located in /lib/gcc/x86_64-linux-gnu/8/
but my attempts to include the library using LDFLAGS
or symlinking the library into /usr/lib/x86_64-linux-musl/
have failed.
我要以正确的方式编译MariaDB吗?我想我做错了什么,因为Alpine Linux可以运行它.
Am I going about compiling MariaDB the right way? I imagine I am doing something wrong as Alpine Linux can run it.
推荐答案
那为什么不看阿尔卑斯山是如何建造的呢?
Thus why don't looking how alpine is building it ?
似乎他们禁用了测试-DSKIP_TESTS=ON
参考: https://git.alpinelinux.org/aports/tree/main/mariadb/APKBUILD?id = 3ca8e70b047f37a01df42e3244014a6635893abc#n186
seems they disable test-DSKIP_TESTS=ON
ref: https://git.alpinelinux.org/aports/tree/main/mariadb/APKBUILD?id=3ca8e70b047f37a01df42e3244014a6635893abc#n186
还有他们的ppc-glibc补丁? https://git. alpinelinux.org/aports/tree/main/mariadb/ppc-remove-glibc-dep.patch?id=3ca8e70b047f37a01df42e3244014a6635893abc
And their ppc-glibc patch ?https://git.alpinelinux.org/aports/tree/main/mariadb/ppc-remove-glibc-dep.patch?id=3ca8e70b047f37a01df42e3244014a6635893abc
这篇关于使用Musl构建MariaDB:/usr/bin/ld找不到-lgcc_s的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!