Buildroot 尝试编译 host-fakeroot 时编译失败:
(...)
make[3]: Entering directory '/Builds/dev-tests/buildroot/output/build/host-fakeroot-1.36'
/usr/bin/gcc -DHAVE_CONFIG_H -I. -I/Builds/dev-tests/buildroot/output/host/include -O2 -I/Builds/dev-tests/buildroot/output/host/include -c -o faked.o faked.c
/bin/bash ./libtool --tag=CC --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I. -I/Builds/dev-tests/buildroot/output/host/include -O2 -I/Builds/dev-tests/buildroot/output/host/include -c -o communicate.lo communicate.c
In file included from faked.c:98:
communicate.h:73:4: warning: #warning Not using stat64 support [-Wcpp]
73 | # warning Not using stat64 support
| ^~~~~~~
faked.c: In function 'save_database':
faked.c:624:23: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
624 | fprintf(f,"dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
| ~~~^
| |
| long long unsigned int
| %lx
625 | (uint64_t) i->buf.dev,(uint64_t) i->buf.ino,(uint64_t) i->buf.mode,
| ~~~~~~~~~~~~~~~~~~~~~
| |
| long unsigned int
(...)
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I/Builds/dev-tests/buildroot/output/host/include -O2 -I/Builds/dev-tests/buildroot/output/host/include -c libfakeroot.c -fPIC -DPIC -o .libs/libfakeroot.o
In file included from libfakeroot.c:65:
communicate.h:73:4: warning: #warning Not using stat64 support [-Wcpp]
73 | # warning Not using stat64 support
| ^~~~~~~
libtool: link: /usr/bin/gcc -O2 -I/Builds/dev-tests/buildroot/output/host/include -Wl,-rpath -Wl,/Builds/dev-tests/buildroot/output/host/lib -o simple simple.o -L/Builds/dev-tests/buildroot/output/host/lib -ldl
/bin/bash ./libtool --tag=CC --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I. -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -I/Builds/dev-tests/buildroot/output/host/include -O2 -I/Builds/dev-tests/buildroot/output/host/include -c -o libfakeroot_time64_la-libfakeroot_time64.lo `test -f 'libfakeroot_time64.c' || echo './'`libfakeroot_time64.c
libfakeroot.c: In function 'common_setxattr':
**libfakeroot.c:140:33: error: implicit declaration of function 'SEND_GET_XATTR'; did you mean 'SEND_GET_XATTR64'? [-Wimplicit-function-declaration]**
140 | #define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER)
| ^~~~~~~~~~~~~~
libfakeroot.c:1733:3: note: in expansion of macro 'INT_SEND_GET_XATTR'
1733 | INT_SEND_GET_XATTR(st, &xattr);
| ^~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:686: libfakeroot.lo] Error 1
我已经尝试了稳定的 buildroot-2024.11 和最新的 git,同样的问题。
如果我首先构建外部工具链,请应用 fakeroot debian 补丁“time64-on-32bit-archs”(来自 https://sources.debian.org/src/fakeroot/1.36-1/debian/patches/time64-on -32bit-archs/),然后编译它 - 使用外部构建的工具链,然后编译但有问题:
nm 显示一些双倍符号:
$ nm .libs/libfakeroot.a|grep -i "send_"
U SEND_GET_XATTR
U send_get_stat
U send_stat
00000000000002a1 T send_fakem
000000000000039a T send_get_fakem
0000000000000c0d T send_get_stat
0000000000000c9f T send_get_xattr
0000000000000b8c T send_stat
据我了解,根本原因是因为musl前段时间去掉了‘64’后缀。
处理这个问题的最佳方法是什么? 除了我尝试过的补丁之外,还有其他补丁吗?
fakeroot 源确实有问题,因为
SEND_GET_XATTR
没有在任何地方定义。
但是,通常应该定义
STAT64_SUPPORT
,因为所有较新的系统都支持 stat64。看起来communicate.h
中尝试基于libc符号检测stat64支持的条件在musl(这是Alpine Linux使用的libc)上不起作用。
请尝试克隆 https://salsa.debian.org/clint/fakeroot,修复那里的问题,并通过将以下内容添加到
local.mk
来在 Buildroot 中进行测试:
HOST_FAKEROOT_OVERRIDE_SRCDIR=/path/to/your/fakeroot
如果修复了问题,请将补丁发送到 Debian 以包含在上游 fakeroot 中。