Unable to build uClibc with _FILE_OFFSET_BITS=64

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Jan 16 17:36:35 UTC 2013


On 15 January 2013 11:22,  <mail-an-mw123 at gmx.de> wrote:
> Do You have any hint regarding this problem?

After fixing unc/prefixpath in busybox' mount i can ls on a cifs
mount, but it works for me:
mount("//hostname/share/path1/path2", "/media/cdrom", "cifs",
MS_RDONLY|MS_SILENT,
"nounix,username=me,password=ppp,unc=\\\\hostname\\share,prefixpath=path1/path2,ip=1.1.1.1")
= 0

and
execve("/scratch/src/busybox/busybox_unstripped", ["/scratch/src/busybox/busybox
_unstripped", "ls", "-1", "/media/cdrom/"], [/* 14 vars */]) = 0
[...]
open("/scratch/src/uClibc.push2/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=4652775, ...}) = 0
close(3)                                = 0
stat("/scratch/src/uClibc.push2/lib/ld64-uClibc.so.0",
{st_mode=S_IFREG|0755, st_size=362817, ...}) = 0
munmap(0x7f3c81c83000, 138652)          = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x7f3c81ca4000
mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x7f3c81ca3000
mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x7f3c81ca2000
arch_prctl(ARCH_SET_FS, 0x7f3c81ca36a0) = 0
mprotect(0x7f3c81a9d000, 4096, PROT_READ) = 0
mprotect(0x7f3c8188c000, 4096, PROT_READ) = 0
mprotect(0x7f3c81ca6000, 4096, PROT_READ) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
getuid()                                = 0
time([1358356561])                      = 1358356561
ioctl(0, TIOCGWINSZ, {ws_row=87, ws_col=80, ws_xpixel=480, ws_ypixel=1044}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
brk(0)                                  = 0x1868000
brk(0x1869000)                          = 0x1869000
stat("/media/cdrom/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("/media/cdrom/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
brk(0x186d000)                          = 0x186d000
getdents64(3, /* 15 entries */, 16384)  = 912
lstat("/media/cdrom/file1", {st_mode=S_IFREG|0755, st_size=522612, ...}) = 0
lstat("/media/cdrom/file2", {st_mode=S_IFREG|0755, st_size=514245, ...}) = 0
lstat("/media/cdrom/file3", {st_mode=S_IFREG|0755, st_size=520649, ...}) = 0
lstat("/media/cdrom/file4", {st_mode=S_IFREG|0755, st_size=284152, ...}) = 0
lstat("/media/cdrom/file5", {st_mode=S_IFREG|0755, st_size=226816, ...}) = 0
getdents64(3, /* 0 entries */, 16384)   = 0
close(3)                                = 0
write(1, "\33[1;32mfile1
[...]
So no, works for me, unfortunately.
thanks,

>
>> > > Now I set UCLIBC_EXTRA_CFLAGS="-EB" in .config file and used the
>> mipsel
>> > compiler:
>> > >
>> > > $ make CROSS_COMPILE=mipsel-linux- ARCH=mipsel
>> > >
>> > > The compilation is not finished completely (please see attached log
>> > file). The file opendir.c is compiled so I could check that
>> _FILE_OFFSET_BITS
>> > is also not defined during compilation of opendir.c although LFS is
>> defined
>> > in .config file.
>> >
>> > the LFS functions live in the 64.o files, see e.g. readdir64.o
>> I supposed that ;) but I can't find the file opendir64.c?
>>
>> The root cause I am searching for is related to an error of fstat on a
>> CIFS mounted folder using the option <nounix>. This option causes the kernel
>> to map the server inodes to large values (> 32 bit). Thus the fstat call
>> returns with a <Value too large for defined data type> error. An <ls> call on
>> that folder shows the following syscalls:
>>
>> / > ls -la /mnt/test/
>> ls: can't open '/mnt/test/': Value too large for defined data type
>>
>> / > /bin/strace /bin/ls -la /mnt/test/
>> execve("/bin/ls", ["/bin/ls", "-la", "/mnt/test/"], [/* 7 vars */]) = 0
>> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77afb000
>> stat("/etc/ld.so.cache", 0x7fe6ebd8)    = -1 ENOENT (No such file or
>> directory)
>> open("/lib/libcrypt.so.0", O_RDONLY)    = 3
>> fstat(3, {st_mode=S_IFREG|0755, st_size=11420, ...}) = 0
>> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77afa000
>> read(3,
>> "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0`\4\0\0004\0\0\0"..., 4096) = 4096
>> old_mmap(NULL, 147456, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>> 0x77ac2000
>> old_mmap(0x77ac2000, 10020, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3,
>> 0) = 0x77ac2000
>> old_mmap(0x77ad4000, 1904, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
>> 0x2000) = 0x77ad4000
>> old_mmap(0x77ad5000, 68080, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x77ad5000
>> close(3)                                = 0
>> munmap(0x77afa000, 4096)                = 0
>> open("/lib/libc.so.0", O_RDONLY)        = 3
>> fstat(3, {st_mode=S_IFREG|0755, st_size=676044, ...}) = 0
>> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77afa000
>> read(3,
>> "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0p\260\0\0004\0\0\0"..., 4096) = 4096
>> old_mmap(NULL, 716800, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>> 0x77a13000
>> old_mmap(0x77a13000, 619408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
>> 3, 0) = 0x77a13000
>> old_mmap(0x77aba000, 7936, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
>> 0x97000) = 0x77aba000
>> old_mmap(0x77abc000, 23084, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x77abc000
>> close(3)                                = 0
>> munmap(0x77afa000, 4096)                = 0
>> open("/lib/libc.so.0", O_RDONLY)        = 3
>> fstat(3, {st_mode=S_IFREG|0755, st_size=676044, ...}) = 0
>> close(3)                                = 0
>> stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=31760, ...}) =
>> 0
>> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77afa000
>> set_thread_area(0x77b01460)             = 0
>> mprotect(0x77aba000, 4096, PROT_READ)   = 0
>> mprotect(0x77afc000, 4096, PROT_READ)   = 0
>> ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
>> ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
>> getuid()                                = 0
>> time([352])                             = 352
>> ioctl(0, 0x40087468, 0x7fe6ed6c)        = 0
>> lstat64("/mnt/test/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
>> brk(0)                                  = 0x485000
>> brk(0x486000)                           = 0x486000
>> open("/mnt/test/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
>> fstat(3, 0x7fe6ebb8)                    = -1 EOVERFLOW (Value too large
>> for defined data type)
>> close(3)                                = 0
>> brk(0x487000)                           = 0x487000
>> brk(0x488000)                           = 0x488000
>> write(2, "ls: can't open '/mnt/test/': Val"..., 67ls: can't open
>> '/mnt/test/': Value too large for defined data type
>> ) = 67
>> exit_group(1)                           = ?
>>
>> Assumed that ls calls opendir, then the 64 bit handling of fstat is
>> missing, right?
>>
>> >
>> > Regarding the ethers compilation error, what kernel-headers do you use
>> > (grep KERNEL .config)?
>> I've fixed the kernel source path and can compile uClibc.


More information about the uClibc mailing list