Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gx6605s编译时报错: error: '__NR_rename' undeclared #72

Closed
Phex opened this issue Feb 12, 2019 · 10 comments
Closed

gx6605s编译时报错: error: '__NR_rename' undeclared #72

Phex opened this issue Feb 12, 2019 · 10 comments

Comments

@Phex
Copy link

Phex commented Feb 12, 2019

CC libc/sysdeps/linux/common/rename.os
In file included from ./include/sys/syscall.h:33:0,
from libc/sysdeps/linux/common/rename.c:9:
libc/sysdeps/linux/common/rename.c: In function 'rename':
./include/bits/syscalls-common.h:34:63: error: '__NR_rename' undeclared (first use in this function)

define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(_NR##name, nr, args)

                                                           ^

./include/bits/syscalls.h:44:15: note: in definition of macro 'INTERNAL_SYSCALL_NCS'
_nr = (name);
^~~~
./include/bits/syscalls-common.h:34:44: note: in expansion of macro 'INLINE_SYSCALL_NCS'

define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(_NR##name, nr, args)

                                        ^~~~~~~~~~~~~~~~~~

./include/bits/syscalls-common.h:99:15: note: in expansion of macro 'INLINE_SYSCALL'
return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args));
^~~~~~~~~~~~~~
./include/bits/syscalls-common.h:111:29: note: in expansion of macro 'SYSCALL_FUNC'
#define _syscall2(args...) SYSCALL_FUNC(2, args)
^~~~~~~~~~~~
libc/sysdeps/linux/common/rename.c:20:1: note: in expansion of macro '_syscall2'
_syscall2(int, rename, const char *, oldpath, const char *, newpath)
^~~~~~~~~
./include/bits/syscalls-common.h:34:63: note: each undeclared identifier is reported only once for each function it appears in

define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(_NR##name, nr, args)

                                                           ^

./include/bits/syscalls.h:44:15: note: in definition of macro 'INTERNAL_SYSCALL_NCS'
_nr = (name);
^~~~
./include/bits/syscalls-common.h:34:44: note: in expansion of macro 'INLINE_SYSCALL_NCS'

define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(_NR##name, nr, args)

                                        ^~~~~~~~~~~~~~~~~~

./include/bits/syscalls-common.h:99:15: note: in expansion of macro 'INLINE_SYSCALL'
return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args));
^~~~~~~~~~~~~~
./include/bits/syscalls-common.h:111:29: note: in expansion of macro 'SYSCALL_FUNC'
#define _syscall2(args...) SYSCALL_FUNC(2, args)
^~~~~~~~~~~~
libc/sysdeps/linux/common/rename.c:20:1: note: in expansion of macro '_syscall2'
_syscall2(int, rename, const char *, oldpath, const char *, newpath)
^~~~~~~~~
make[2]: *** [libc/sysdeps/linux/common/rename.os] Error 1
make[1]: *** [/usr/src/data/c-sky/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/.stamp_built] Error 2
make: *** [_all] Error 2

@guoren83
Copy link
Member

https://gitlab.com/c-sky/buildroot/-/jobs/159851774/artifacts/browse/output/images/

这是编译通过的,你似乎在编译工具链 有个语法错误,host 上的 gcc 版本多少? ubuntu-16.04,默认build-essional 是 OK的

@Phex
Copy link
Author

Phex commented Feb 13, 2019

是有个语法错误, 我按照c-sky/buildroot#4
下面第三条回复https://github.com/gcc-mirror/gcc/blob/gcc-6-branch/gcc/ubsan.c#L1477 改过了.
系统是ubuntu-16.04, 但是update过了, gcc版本7.4.0.
gcc (Ubuntu 7.4.0-1ubuntu116.04ppa1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.

@xuefengedu
Copy link

how to overcome this issue, I build it on docker debian and docker ubuntu 16.04, both failed.
gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)

@xuefengedu
Copy link

I don't see any place defined __NR_rename in https://github.com/c-sky/buildroot and the build toochain.

I saw most of Linux contains the definition: https://elixir.bootlin.com/linux/v4.9.25/source/include/uapi/asm-generic/unistd.h#L766

Any reason you discard/remove it? thanks.
I just want to build the OS and the packages, but it seems so hard.

@xuefengedu
Copy link

below is what I searched from my local box, any idea to fix the issue?

root@2064d50385ea:/code/buildroot# grep -R "__NR_rename" output
grep: output/host/csky-buildroot-linux-uclibcabiv1/sysroot/etc/mtab: No such file or directory
grep: output/host/csky-buildroot-linux-uclibcabiv1/sysroot/etc/resolv.conf: No such file or directory
output/host/csky-buildroot-linux-uclibcabiv1/sysroot/usr/include/asm-generic/unistd.h:#define __NR_renameat 38
output/host/csky-buildroot-linux-uclibcabiv1/sysroot/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_renameat, sys_renameat)
output/host/csky-buildroot-linux-uclibcabiv1/sysroot/usr/include/asm-generic/unistd.h:#define __NR_renameat2 276
output/host/csky-buildroot-linux-uclibcabiv1/sysroot/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_renameat2, sys_renameat2)
output/host/csky-buildroot-linux-uclibcabiv1/sysroot/usr/include/asm-generic/unistd.h:#define __NR_rename 1034
output/host/csky-buildroot-linux-uclibcabiv1/sysroot/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_rename, sys_rename)
grep: warning: output/host/usr: recursive directory loop
grep: output/staging/etc/mtab: No such file or directory
grep: output/staging/etc/resolv.conf: No such file or directory
output/staging/usr/include/asm-generic/unistd.h:#define __NR_renameat 38
output/staging/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_renameat, sys_renameat)
output/staging/usr/include/asm-generic/unistd.h:#define __NR_renameat2 276
output/staging/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_renameat2, sys_renameat2)
output/staging/usr/include/asm-generic/unistd.h:#define __NR_rename 1034
output/staging/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_rename, sys_rename)
grep: output/build/csky-arch-8c6be4692d1ff3a33422c2835fb7eff00b124cea/arch/csky/boot/dts/include/dt-bindings: No such file or directory
output/build/host-binutils-c66d8bbcebfddf713b2b436e1b135e6b125a55a5/sim/m32r/traps-linux.c:          case __NR_rename:
output/build/host-binutils-c66d8bbcebfddf713b2b436e1b135e6b125a55a5/sim/m32r/syscall.h:#define __NR_rename               38
output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/common/stubs.c:#ifndef __NR_renameat
output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/common/renameat.c:#ifdef __NR_renameat
output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/common/rename.c:#if defined __NR_renameat && !defined __NR_rename
output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/include/bits/sysnum.h:#undef __NR_renameat2
output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/include/bits/sysnum.h:#define __NR_renameat2 276
output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/include/bits/sysnum.h:#define SYS_renameat2 __NR_renameat2
output/build/linux-headers-4.16.2/arch/sh/include/uapi/asm/unistd_64.h:#define __NR_rename               38
output/build/linux-headers-4.16.2/arch/sh/include/uapi/asm/unistd_64.h:#define __NR_renameat            330
output/build/linux-headers-4.16.2/arch/sh/include/uapi/asm/unistd_64.h:#define __NR_renameat2           382
output/build/linux-headers-4.16.2/arch/sh/include/uapi/asm/unistd_32.h:#define __NR_rename               38
output/build/linux-headers-4.16.2/arch/sh/include/uapi/asm/unistd_32.h:#define __NR_renameat            302
output/build/linux-headers-4.16.2/arch/sh/include/uapi/asm/unistd_32.h:#define __NR_renameat2           371
output/build/linux-headers-4.16.2/arch/sparc/include/uapi/asm/unistd.h:#define __NR_rename             128 /* Common                                      */
output/build/linux-headers-4.16.2/arch/sparc/include/uapi/asm/unistd.h:#define __NR_renameat            291
output/build/linux-headers-4.16.2/arch/sparc/include/uapi/asm/unistd.h:#define __NR_renameat2           345
output/build/linux-headers-4.16.2/arch/microblaze/include/uapi/asm/unistd.h:#define __NR_rename         38 /* renameat */
output/build/linux-headers-4.16.2/arch/microblaze/include/uapi/asm/unistd.h:#define __NR_renameat               302 /* ok */
output/build/linux-headers-4.16.2/arch/microblaze/include/uapi/asm/unistd.h:#define __NR_renameat2              383
output/build/linux-headers-4.16.2/arch/alpha/include/uapi/asm/unistd.h:#define __NR_rename              128
output/build/linux-headers-4.16.2/arch/alpha/include/uapi/asm/unistd.h:#define __NR_renameat                    457
output/build/linux-headers-4.16.2/arch/alpha/include/uapi/asm/unistd.h:#define __NR_renameat2                   510
output/build/linux-headers-4.16.2/arch/parisc/include/uapi/asm/unistd.h:#define __NR_rename              (__NR_Linux + 38)
output/build/linux-headers-4.16.2/arch/parisc/include/uapi/asm/unistd.h:#define __NR_renameat           (__NR_Linux + 282)
output/build/linux-headers-4.16.2/arch/parisc/include/uapi/asm/unistd.h:#define __NR_renameat2          (__NR_Linux + 337)
output/build/linux-headers-4.16.2/arch/m32r/include/uapi/asm/unistd.h:#define __NR_rename                38
output/build/linux-headers-4.16.2/arch/m32r/include/uapi/asm/unistd.h:#define __NR_renameat             302
output/build/linux-headers-4.16.2/arch/m68k/include/uapi/asm/unistd.h:#define __NR_rename                38
output/build/linux-headers-4.16.2/arch/m68k/include/uapi/asm/unistd.h:#define __NR_renameat             295
output/build/linux-headers-4.16.2/arch/m68k/include/uapi/asm/unistd.h:#define __NR_renameat2            351
output/build/linux-headers-4.16.2/arch/blackfin/include/uapi/asm/unistd.h:#define __NR_rename            38
output/build/linux-headers-4.16.2/arch/blackfin/include/uapi/asm/unistd.h:#define __NR_renameat         302
output/build/linux-headers-4.16.2/arch/blackfin/include/uapi/asm/unistd.h:#define __NR_renameat2                387
output/build/linux-headers-4.16.2/arch/ia64/include/uapi/asm/unistd.h:#define __NR_rename                       1054
output/build/linux-headers-4.16.2/arch/ia64/include/uapi/asm/unistd.h:#define __NR_renameat                     1288
output/build/linux-headers-4.16.2/arch/ia64/include/uapi/asm/unistd.h:#define __NR_renameat2                    1338
output/build/linux-headers-4.16.2/arch/arm64/include/asm/unistd32.h:#define __NR_rename 38
output/build/linux-headers-4.16.2/arch/arm64/include/asm/unistd32.h:__SYSCALL(__NR_rename, sys_rename)
output/build/linux-headers-4.16.2/arch/arm64/include/asm/unistd32.h:#define __NR_renameat 329
output/build/linux-headers-4.16.2/arch/arm64/include/asm/unistd32.h:__SYSCALL(__NR_renameat, sys_renameat)
output/build/linux-headers-4.16.2/arch/arm64/include/asm/unistd32.h:#define __NR_renameat2 382
output/build/linux-headers-4.16.2/arch/arm64/include/asm/unistd32.h:__SYSCALL(__NR_renameat2, sys_renameat2)
output/build/linux-headers-4.16.2/arch/frv/include/uapi/asm/unistd.h:#define __NR_rename                 38
output/build/linux-headers-4.16.2/arch/frv/include/uapi/asm/unistd.h:#define __NR_renameat              302
output/build/linux-headers-4.16.2/arch/mn10300/include/uapi/asm/unistd.h:#define __NR_rename             38
output/build/linux-headers-4.16.2/arch/mn10300/include/uapi/asm/unistd.h:#define __NR_renameat          303
output/build/linux-headers-4.16.2/arch/powerpc/include/uapi/asm/unistd.h:#define __NR_rename             38
output/build/linux-headers-4.16.2/arch/powerpc/include/uapi/asm/unistd.h:#define __NR_renameat          293
output/build/linux-headers-4.16.2/arch/powerpc/include/uapi/asm/unistd.h:#define __NR_renameat2         357
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_rename                       (__NR_Linux +  38)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_renameat                     (__NR_Linux + 295)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_renameat2                    (__NR_Linux + 351)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_rename                       (__NR_Linux +  80)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_renameat                     (__NR_Linux + 254)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_renameat2                    (__NR_Linux + 311)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_rename                       (__NR_Linux +  80)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_renameat                     (__NR_Linux + 258)
output/build/linux-headers-4.16.2/arch/mips/include/uapi/asm/unistd.h:#define __NR_renameat2                    (__NR_Linux + 315)
output/build/linux-headers-4.16.2/arch/xtensa/include/uapi/asm/unistd.h:#define __NR_rename                              33
output/build/linux-headers-4.16.2/arch/xtensa/include/uapi/asm/unistd.h:#define __NR_renameat                           292
output/build/linux-headers-4.16.2/arch/xtensa/include/uapi/asm/unistd.h:#define __NR_renameat2                          336
output/build/linux-headers-4.16.2/arch/cris/include/uapi/asm/unistd.h:#define __NR_rename                38
output/build/linux-headers-4.16.2/arch/cris/include/uapi/asm/unistd.h:#define __NR_renameat             302
output/build/linux-headers-4.16.2/arch/cris/include/uapi/asm/unistd.h:#define __NR_renameat2            354
output/build/linux-headers-4.16.2/usr/include/asm-generic/unistd.h:#define __NR_renameat 38
output/build/linux-headers-4.16.2/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_renameat, sys_renameat)
output/build/linux-headers-4.16.2/usr/include/asm-generic/unistd.h:#define __NR_renameat2 276
output/build/linux-headers-4.16.2/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_renameat2, sys_renameat2)
output/build/linux-headers-4.16.2/usr/include/asm-generic/unistd.h:#define __NR_rename 1034
output/build/linux-headers-4.16.2/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_rename, sys_rename)
output/build/linux-headers-4.16.2/include/uapi/asm-generic/unistd.h:#define __NR_renameat 38
output/build/linux-headers-4.16.2/include/uapi/asm-generic/unistd.h:__SYSCALL(__NR_renameat, sys_renameat)
output/build/linux-headers-4.16.2/include/uapi/asm-generic/unistd.h:#define __NR_renameat2 276
output/build/linux-headers-4.16.2/include/uapi/asm-generic/unistd.h:__SYSCALL(__NR_renameat2, sys_renameat2)
output/build/linux-headers-4.16.2/include/uapi/asm-generic/unistd.h:#define __NR_rename 1034
output/build/linux-headers-4.16.2/include/uapi/asm-generic/unistd.h:__SYSCALL(__NR_rename, sys_rename)
output/build/linux-headers-4.16.2/include/asm-generic/audit_dir_write.h:#ifdef __NR_rename
output/build/linux-headers-4.16.2/include/asm-generic/audit_dir_write.h:__NR_rename,
output/build/linux-headers-4.16.2/include/asm-generic/audit_dir_write.h:#ifdef __NR_renameat
output/build/linux-headers-4.16.2/include/asm-generic/audit_dir_write.h:__NR_renameat,
output/build/linux-headers-4.16.2/include/asm-generic/audit_dir_write.h:#ifdef __NR_renameat2
output/build/linux-headers-4.16.2/include/asm-generic/audit_dir_write.h:__NR_renameat2,
grep: output/target/dev/log: No such file or directory
grep: output/target/etc/mtab: No such file or directory
grep: output/target/etc/resolv.conf: No such file or directory
root@2064d50385ea:/code/buildroot#

@xuefengedu
Copy link

I don't know if it is a bug or what, but I overcome the issue to modify the file: root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# vi libc/sysdeps/linux/common/rename.c

More detailed commands:

root@2064d50385ea:/code/buildroot# ls /code/buildroot/output/build/linux-headers-4.16.2/usr/include/bits
ls: cannot access '/code/buildroot/output/build/linux-headers-4.16.2/usr/include/bits': No such file or directory
root@2064d50385ea:/code/buildroot# find / -name bits
/usr/include/x86_64-linux-gnu/bits
/usr/include/x86_64-linux-gnu/c++/6/bits
/usr/include/bits
/usr/include/c++/6/bits
/usr/include/c++/6/experimental/bits
/usr/lib/x86_64-linux-gnu/perl/5.24.1/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/pthread/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/sh/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/aarch64/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/csky/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/m68k/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/arc/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/nios2/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/metag/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/nds32/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/mips/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/or1k/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/i386/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libpthread/linuxthreads/sysdeps/pthread/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/bfin/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/sh/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/avr32/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/aarch64/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/sparc/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/microblaze/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/alpha/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/csky/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/tile/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/m68k/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/arc/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/common-generic/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/x86_64/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/c6x/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/ia64/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/h8300/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/lm32/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/frv/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/nios2/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/sparc64/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/metag/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/nds32/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/powerpc/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/mips/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/or1k/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/i386/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/hppa/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/arm/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/xtensa/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/common/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/libc/sysdeps/linux/cris/bits
/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27/include/bits
/code/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/fixincludes/tests/base/bits
/code/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/libstdc++-v3/config/cpu/i486/opt/bits
/code/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/libstdc++-v3/config/cpu/generic/opt/bits
/code/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/libstdc++-v3/include/bits
/code/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/libstdc++-v3/include/experimental/bits
root@2064d50385ea:/code/buildroot# cd /code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# ls
COPYING.LIB              MAINTAINERS    Makefile.in  Rules.mak  include  libc      libintl     librt          libutil
COPYING.LIB.boilerplate  Makefile       Makerules    docs       ldso     libcrypt  libm        libuargp       uclibc-ng.config
INSTALL                  Makefile.help  README       extra      lib      libiconv  libpthread  libubacktrace  utils
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# cat libc/sysdeps/linux/common/rename.c
/*
 * rename() for uClibc
 *
 * Copyright (C) 2000-2006 Erik Andersen <[email protected]>
 *
 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 */

#include <sys/syscall.h>
#include <stdio.h>
#include <unistd.h>

#if defined __NR_renameat && !defined __NR_rename
# include <fcntl.h>
int rename(const char *oldpath, const char *newpath)
{
        return renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath);
}
#else
_syscall2(int, rename, const char *, oldpath, const char *, newpath)
#endif
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a345
bash: vi: command not found
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# apt install vi                                               Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vi
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# apt install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libgpm2 vim-common vim-runtime xxd
Suggested packages:
  gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
  libgpm2 vim vim-common vim-runtime xxd
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 6766 kB of archives.
After this operation, 31.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cdn-fastly.deb.debian.org/debian stable/main amd64 xxd amd64 2:8.0.0197-4+deb9u1 [132 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian stable/main amd64 vim-common all 2:8.0.0197-4+deb9u1 [159 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian stable/main amd64 libgpm2 amd64 1.20.4-6.2+b1 [34.2 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian stable/main amd64 vim-runtime all 2:8.0.0197-4+deb9u1 [5407 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stable/main amd64 vim amd64 2:8.0.0197-4+deb9u1 [1034 kB]
Fetched 6766 kB in 0s (8216 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package xxd.
(Reading database ... 17156 files and directories currently installed.)
Preparing to unpack .../xxd_2%3a8.0.0197-4+deb9u1_amd64.deb ...
Unpacking xxd (2:8.0.0197-4+deb9u1) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_2%3a8.0.0197-4+deb9u1_all.deb ...
Unpacking vim-common (2:8.0.0197-4+deb9u1) ...
Selecting previously unselected package libgpm2:amd64.
Preparing to unpack .../libgpm2_1.20.4-6.2+b1_amd64.deb ...
Unpacking libgpm2:amd64 (1.20.4-6.2+b1) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a8.0.0197-4+deb9u1_all.deb ...
Adding 'diversion of /usr/share/vim/vim80/doc/help.txt to /usr/share/vim/vim80/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim80/doc/tags to /usr/share/vim/vim80/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.0.0197-4+deb9u1) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a8.0.0197-4+deb9u1_amd64.deb ...
Unpacking vim (2:8.0.0197-4+deb9u1) ...
Processing triggers for mime-support (3.60) ...
Setting up xxd (2:8.0.0197-4+deb9u1) ...
Setting up libgpm2:amd64 (1.20.4-6.2+b1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up vim-common (2:8.0.0197-4+deb9u1) ...
Setting up vim-runtime (2:8.0.0197-4+deb9u1) ...
Setting up vim (2:8.0.0197-4+deb9u1) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# vi libc/sysdeps/linux/common/rename.c
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# cat libc/sysdeps/linux/common/rename.c
/*
 * rename() for uClibc
 *
 * Copyright (C) 2000-2006 Erik Andersen <[email protected]>
 *
 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 */

#include <sys/syscall.h>
#include <stdio.h>
#include <unistd.h>

#define __NR_rename 1034

#if defined __NR_renameat && !defined __NR_rename
# include <fcntl.h>
int rename(const char *oldpath, const char *newpath)
{
        return renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath);
}
#else
_syscall2(int, rename, const char *, oldpath, const char *, newpath)
#endif
root@2064d50385ea:/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27# cd /code/buildroot
root@2064d50385ea:/code/buildroot# make
make: Circular /code/buildroot/output/build/toolchain/.stamp_configured <- toolchain-buildroot dependency dropped.
>>> uclibc bb379dc1fb1544998838e5a3451f1937ea66ab27 Building
/usr/bin/make -j2 -C /code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27 ARCH="csky" CROSS_COMPILE="/code/buildroot/output/host/bin/csky-buildroot-linux-uclibcabiv1-" UCLIBC_EXTRA_CFLAGS=" " HOSTCC="/usr/bin/gcc" headers
make[1]: Entering directory '/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27'
Makefile.in:152: warning: overriding recipe for target 'include/bits/kernel_stat.h'
Makefile.in:148: warning: ignoring old recipe for target 'include/bits/kernel_stat.h'
make[2]: Nothing to be done for 'locale_headers'.
make[1]: Leaving directory '/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27'
/usr/bin/make -j2 -C /code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27 ARCH="csky" CROSS_COMPILE="/code/buildroot/output/host/bin/csky-buildroot-linux-uclibcabiv1-" UCLIBC_EXTRA_CFLAGS=" " HOSTCC="/usr/bin/gcc"
make[1]: Entering directory '/code/buildroot/output/build/uclibc-bb379dc1fb1544998838e5a3451f1937ea66ab27'
Makefile.in:152: warning: overriding recipe for target 'include/bits/kernel_stat.h'
Makefile.in:148: warning: ignoring old recipe for target 'include/bits/kernel_stat.h'
make[2]: Nothing to be done for 'locale_headers'.
  CC libc/sysdeps/linux/common/close.os
  CC libc/sysdeps/linux/common/sched_setscheduler.os
  CC libc/sysdeps/linux/common/rename.os
  CC libc/sysdeps/linux/common/getrlimit.os
  CC libc/sysdeps/linux/common/getdtablesize.os
  CC libc/sysdeps/linux/common/dup.os
  CC libc/sysdeps/linux/common/fchownat.os
  CC libc/sysdeps/linux/common/epoll_create.os

@xuefengedu
Copy link

bad experience, I have gave it up.
That's all I have tried to build it: https://github.com/xuefengedu/csky

@guoren83
Copy link
Member

这应该是个BUG 马上解决

@guoren83
Copy link
Member

确实是我们的问题,后续会把这个配置也加入我们的 gitlab-CI

Fixup:
https://gitlab.com/c-sky/buildroot/commit/21b5cbee2d2a1d06726ab49954c1a67ad9255303

@Zulolo
Copy link

Zulolo commented Apr 13, 2019

确实是我们的问题,后续会把这个配置也加入我们的 gitlab-CI

Fixup:
https://gitlab.com/c-sky/buildroot/commit/21b5cbee2d2a1d06726ab49954c1a67ad9255303

I think this issue can be closed. I have met the same issue and after following the change, this build step passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants