【问题标题】:Buildroot in WSL vs. Antimalware Service ExecutableWSL 中的 Buildroot 与反恶意软件服务可执行文件
【发布时间】:2019-05-19 21:29:16
【问题描述】:

我正在尝试使用 WSL(Linux 的 Windows 子系统)中的 Buildroot-2019.02.2 构建嵌入式 Raspberry Pi Linux 操作系统。编译一直失败,我不知道从哪里开始修复它。我也尝试了最新的 Git 版本的 Buildroot 并且遇到了同样的问题。任何建议将不胜感激!

最后 100 行左右的输出:

  CC librt/spawn_faction_addclose.os
  CC librt/mq_timedsend.os
  CC librt/spawn_faction_addopen.os
  CC librt/mq_send.os
  CC librt/mq_timedreceive.os
  CC librt/clock_gettime.os
  CC librt/shm.os
  CC librt/clock_getcpuclockid.os
  CC librt/spawn_faction_adddup2.os
  CC librt/mq_getsetattr.os
  CC librt/spawn.os
  CC librt/clock_nanosleep.os
  CC librt/dso_handle.os
  CC librt/mq_open.os
  CC librt/mq_unlink.os
  CC libintl/libintl.os
libintl/libintl.c:81:13: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 const char *_nl_expand_alias () { return NULL; }
             ^~~~~~~~~~~~~~~~
  CC libc/misc/internals/__uClibc_main.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/arm/fork.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/register-atfork.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/unregister-atfork.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/getpid.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/raise.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.os
  CC libpthread/nptl/alloca_cutoff.os
  CC libpthread/nptl/libc-cancellation.os
  CC libpthread/nptl/sysdeps/arm/libc-tls.os
  CC libpthread/nptl/sysdeps/generic/dl-tls.os
  AS libc/sysdeps/linux/arm/libc-aeabi_read_tp.os
  CC libc/sysdeps/linux/arm/aeabi_lcsts.os
  CC libc/sysdeps/linux/arm/aeabi_math.os
  AS libc/sysdeps/linux/arm/aeabi_sighandlers.os
  CC libc/misc/elf/dl-support.os
  CC libc/misc/elf/dl-core.os
In file included from ./include/bits/waitstatus.h:72:0,
                 from ./include/stdlib.h:44,
                 from ./ldso/include/ldso.h:33,
                 from libc/misc/elf/../../../ldso/ldso/dl-symbols.c:18,
                 from libc/misc/elf/dl-core.c:18:
./ldso/include/dl-syscall.h: In function '_dl_pread':
./ldso/include/dl-syscall.h:169:69: warning: right shift count >= width of type [-Wshift-count-overflow]
 turn __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR((offset >> 32), (offset & 0xffffffff)));
                                                                  ^
./include/endian.h:52:39: note: in definition of macro '__LONG_LONG_PAIR'
 # define __LONG_LONG_PAIR(HI, LO) LO, HI
                                       ^~
  CC libc/misc/elf/dl-iterate-phdr.os
In file included from ./include/elf.h:29:0,
                 from ./include/link.h:24,
                 from libc/misc/elf/dl-iterate-phdr.c:15:
./ldso/include/dl-syscall.h: In function '_dl_pread':
./ldso/include/dl-syscall.h:169:69: warning: right shift count >= width of type [-Wshift-count-overflow]
 turn __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR((offset >> 32), (offset & 0xffffffff)));
                                                                  ^
./include/endian.h:52:39: note: in definition of macro '__LONG_LONG_PAIR'
 # define __LONG_LONG_PAIR(HI, LO) LO, HI
                                       ^~
  CC libc/stdlib/atexit.os
  CC libc/stdlib/system.os
  CC ldso/libdl/libdl.os
In file included from ./include/bits/waitstatus.h:72:0,
                 from ./include/stdlib.h:44,
                 from ./ldso/include/ldso.h:33,
                 from ldso/libdl/libdl.c:40:
./ldso/include/dl-syscall.h: In function '_dl_pread':
./ldso/include/dl-syscall.h:169:69: warning: right shift count >= width of type [-Wshift-count-overflow]
 turn __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR((offset >> 32), (offset & 0xffffffff)));
                                                                  ^
./include/endian.h:52:39: note: in definition of macro '__LONG_LONG_PAIR'
 # define __LONG_LONG_PAIR(HI, LO) LO, HI
                                       ^~
  AS ldso/ldso/arm/resolve.os
  CC libpthread/nptl/pthread_atfork.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/arm/pthread_once.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getaffinity.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_yield.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/sem_post.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/sem_timedwait.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/sem_trywait.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/sem_wait.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/pthread_sigqueue.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/lowlevellock.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.os
  CC libpthread/nptl/sysdeps/arm/pthread_spin_lock.os
  CC libpthread/nptl/sysdeps/arm/pthread_spin_trylock.os
  CC libpthread/nptl/sysdeps/pthread/pthread_barrier_destroy.os
  CC libpthread/nptl/sysdeps/pthread/pthread_barrier_init.os
  CC libpthread/nptl/sysdeps/pthread/pthread_barrier_wait.os
  CC libpthread/nptl/sysdeps/pthread/pthread_cond_broadcast.os
  CC libpthread/nptl/sysdeps/pthread/pthread_cond_signal.os
  CC libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.os
  CC libpthread/nptl/sysdeps/pthread/pthread_cond_wait.os
  CC libpthread/nptl/sysdeps/pthread/pthread_rwlock_rdlock.os
  CC libpthread/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.os
  CC libpthread/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.os
  CC libpthread/nptl/sysdeps/pthread/pthread_rwlock_unlock.os
  CC libpthread/nptl/sysdeps/pthread/pthread_rwlock_wrlock.os
  CC libpthread/nptl/sysdeps/pthread/pthread_sigmask.os
  CC libpthread/nptl/sysdeps/pthread/pthread_spin_destroy.os
  CC libpthread/nptl/sysdeps/pthread/pthread_spin_init.os
  CC libpthread/nptl/sysdeps/pthread/pthread_spin_unlock.os
  CC libpthread/nptl/sysdeps/pthread/pt-sigaction.os
  CC libpthread/nptl/sysdeps/pthread/tpp.os
  CC libpthread/nptl/pthread_attr_getstackaddr.os
  CC libpthread/nptl/pthread_mutex_init.os
  CC libpthread/nptl/pthread_testcancel.os
  CC libpthread/nptl/pthread_attr_setstackaddr.os
  CC libpthread/nptl/pthread_timedjoin.os
  CC libpthread/nptl/pthread_rwlock_trywrlock.os
  CC libpthread/nptl/pthread_barrierattr_getpshared.os
  CC libpthread/nptl/pthread_setresgid.os
  CC libpthread/nptl/pthread_mutexattr_getrobust.os
  CC libpthread/nptl/pthread_mutexattr_gettype.os
  CC libpthread/nptl/pthread_setreuid.os
  CC libpthread/nptl/pthread_setcancelstate.os
  CC libpthread/nptl/pthread_getschedparam.os
  CC libpthread/nptl/pthread_kill_other_threads.os
  CC libpthread/nptl/pthread_mutexattr_settype.os
  CC libpthread/nptl/pthread_rwlockattr_setkind_np.os
  CC libpthread/nptl/pthread_mutex_lock.os
  CC libpthread/nptl/pthread_seteuid.os
  CC libpthread/nptl/pthread_barrierattr_destroy.os
  CC libpthread/nptl/pthread_attr_init.os
  CC libpthread/nptl/vars.os
  CC libpthread/nptl/pt-cleanup.os
  CC libpthread/nptl/init.os
  CC libpthread/nptl/pthread_barrierattr_init.os
  CC libpthread/nptl/pthread_setresuid.os
  CC libpthread/nptl/pthread_mutex_unlock.os
  CC libpthread/nptl/pthread_mutexattr_setrobust.os
  CC libpthread/nptl/cleanup_defer.os
  CC libpthread/nptl/pthread_mutex_timedlock.os
  CC libpthread/nptl/pthread_mutex_consistent.os
  CC libpthread/nptl/events.os
  CC libpthread/nptl/cleanup.os
  CC libpthread/nptl/pthread_mutexattr_setprotocol.os
  CC libpthread/nptl/pthread_attr_getschedpolicy.os
  CC libpthread/nptl/pthread_tryjoin.os
  CC libpthread/nptl/pthread_attr_setschedpolicy.os
  CC libpthread/nptl/pthread_getname.os
  CC libpthread/nptl/pthread_rwlockattr_getkind_np.os
  CC libpthread/nptl/pthread_equal.os
  CC libpthread/nptl/pthread_attr_setguardsize.os
  CC libpthread/nptl/pthread_detach.os
  CC libpthread/nptl/pthread_attr_getstacksize.os
  CC libpthread/nptl/pthread_setname.os
  CC libpthread/nptl/pthread_mutex_trylock.os
  CC libpthread/nptl/herrno.os
  CC libpthread/nptl/pthread_attr_setstacksize.os
  CC libpthread/nptl/cleanup_defer_compat.os
  CC libpthread/nptl/pthread_attr_getdetachstate.os
  CC libpthread/nptl/pthread_cancel.os
  CC libpthread/nptl/pthread_rwlock_destroy.os
  CC libpthread/nptl/pthread_condattr_getclock.os
  CC libpthread/nptl/sem_unlink.os
  CC libpthread/nptl/pthread_rwlock_init.os
  CC libpthread/nptl/pthread_rwlockattr_destroy.os
  CC libpthread/nptl/pthread_condattr_setclock.os
  CC libpthread/nptl/pthread_key_create.os
  CC libpthread/nptl/pthread_setschedparam.os
  CC libpthread/nptl/pthread_rwlockattr_init.os
  CC libpthread/nptl/pthread_attr_destroy.os
  CC libpthread/nptl/pthread_getspecific.os
  CC libpthread/nptl/pthread_rwlockattr_getpshared.os
  CC libpthread/nptl/pthread_exit.os
  CC libpthread/nptl/pthread_attr_setdetachstate.os
  CC libpthread/nptl/pthread_getconcurrency.os
  CC libpthread/nptl/pthread_setspecific.os
  CC libpthread/nptl/pthread_rwlockattr_setpshared.os
  CC libpthread/nptl/pthread_cond_init.os
  CC libpthread/nptl/pthread_setconcurrency.os
  CC libpthread/nptl/sem_getvalue.os
  CC libpthread/nptl/pthread_setregid.os
  CC libpthread/nptl/pthread_attr_getguardsize.os
  CC libpthread/nptl/pthread_self.os
  CC libpthread/nptl/pthread_barrierattr_setpshared.os
  CC libpthread/nptl/pthread_setschedprio.os
  CC libpthread/nptl/pthread_condattr_init.os
  CC libpthread/nptl/pthread_mutexattr_getprotocol.os
  CC libpthread/nptl/pthread_attr_getstack.os
  CC libpthread/nptl/pthread_mutexattr_getpshared.os
  CC libpthread/nptl/pthread_attr_getschedparam.os
  CC libpthread/nptl/pthread_condattr_getpshared.os
  CC libpthread/nptl/unwind.os
  CC libpthread/nptl/pthread_attr_setstack.os
  CC libpthread/nptl/pthread_condattr_setpshared.os
  CC libpthread/nptl/pthread_cond_destroy.os
  CC libpthread/nptl/sem_destroy.os
  CC libpthread/nptl/pthread_mutexattr_getprioceiling.os
  CC libpthread/nptl/pthread_attr_getinheritsched.os
  CC libpthread/nptl/pthread_attr_setschedparam.os
  CC libpthread/nptl/pthread_setegid.os
  CC libpthread/nptl/sem_init.os
  CC libpthread/nptl/pthread_attr_getscope.os
  CC libpthread/nptl/pthread_mutexattr_setprioceiling.os
  CC libpthread/nptl/pthread_attr_setinheritsched.os
  CC libpthread/nptl/cleanup_routine.os
  CC libpthread/nptl/pthread_rwlock_tryrdlock.os
  CC libpthread/nptl/pthread_attr_setscope.os
  CC libpthread/nptl/pthread_mutex_getprioceiling.os
  CC libpthread/nptl/pthread_mutexattr_setpshared.os
  CC libpthread/nptl/pthread_getattr_np.os
  CC libpthread/nptl/pthread_mutex_setprioceiling.os
  CC libpthread/nptl/pthread_key_delete.os
  CC libpthread/nptl/pthread_create.os
In file included from libpthread/nptl/pthread_create.c:48:0:
libpthread/nptl/allocatestack.c: In function 'allocate_stack':
libpthread/nptl/allocatestack.c:602:6: warning: label 'mprot_error' defined but not used [-Wunused-label]
      mprot_error:
      ^~~~~~~~~~~
  CC libpthread/nptl/pthread_join.os
  CC libpthread/nptl/cleanup_compat.os
  CC libpthread/nptl/pthread_mutexattr_destroy.os
  CC libpthread/nptl/pthread_setcanceltype.os
  CC libpthread/nptl/sem_open.os
  CC libpthread/nptl/pthread_mutexattr_init.os
  CC libpthread/nptl/pthread_condattr_destroy.os
  CC libpthread/nptl/cancellation.os
  CC libpthread/nptl/sem_close.os
  CC libpthread/nptl/pthread_mutex_destroy.os
  CC libpthread/nptl/errno_location.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/timer_create.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/timer_delete.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/timer_getoverr.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/timer_gettime.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.os
  CC libpthread/nptl/sysdeps/unix/sysv/linux/timer_settime.os
  CC libpthread/nptl/sysdeps/pthread/librt-cancellation.os
  AR cr lib/libc.a
  STRIP -x -R .note -R .comment lib/libc.a
  CC libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.o
  AR cr lib/uclibc_nonshared.a
  STRIP -x -R .note -R .comment lib/uclibc_nonshared.a
  AR cr libc/libc_so.a
  STRIP -x -R .note -R .comment libc/libc_so.a
  CC libpthread/nptl/pthread_atfork.oS
  AR cr lib/libpthread_nonshared.a
  STRIP -x -R .note -R .comment lib/libpthread_nonshared.a
  LD libuClibc-1.0.31.so
./lib/ld-uClibc.so.1: warning: multiple common of `_dl_internal_error_number'
libc/libc_so.a(libdl.oS): warning: previous common is here
./lib/ld-uClibc.so.1: warning: multiple common of `_dl_error_number'
libc/libc_so.a(libdl.oS): warning: previous common is here
./lib/ld-uClibc.so.1: warning: multiple common of `_dl_free_function'
libc/libc_so.a(libdl.oS): warning: previous common is here
./lib/ld-uClibc.so.1: warning: multiple common of `_dl_malloc_function'
libc/libc_so.a(libdl.oS): warning: previous common is here
libc/libc_so.a(dl-iterate-phdr.oS): In function `dl_iterate_phdr':
dl-iterate-phdr.c:(.text+0xd4): undefined reference to `_dl_phnum'
dl-iterate-phdr.c:(.text+0xdc): undefined reference to `_dl_phdr'
libc/libc_so.a(__uClibc_main.oS): In function `__uClibc_init':
__uClibc_main.c:(.text+0x98): undefined reference to `__libc_setup_tls'
libc/libc_so.a(__uClibc_main.oS): In function `__uClibc_fini':
__uClibc_main.c:(.text+0x140): undefined reference to `__fini_array_start'
__uClibc_main.c:(.text+0x144): undefined reference to `__fini_array_end'
libc/libc_so.a(__uClibc_main.oS): In function `__uClibc_main':
__uClibc_main.c:(.text+0x21c): undefined reference to `_dl_aux_init'
__uClibc_main.c:(.text+0x560): undefined reference to `__preinit_array_end'
__uClibc_main.c:(.text+0x564): undefined reference to `__preinit_array_start'
__uClibc_main.c:(.text+0x56c): undefined reference to `__init_array_end'
__uClibc_main.c:(.text+0x570): undefined reference to `__init_array_start'
libc/libc_so.a(libdl.oS): In function `_dl_do_reloc':
libdl.c:(.text+0xfac): undefined reference to `_dl_allocate_static_tls'
libc/libc_so.a(libdl.oS): In function `_dl_load_elf_shared_library':
libdl.c:(.text+0x1c34): undefined reference to `_dl_next_tls_modid'
libdl.c:(.text+0x1e1c): undefined reference to `_dl_linux_resolve'
/mnt/e/work-current/buildroot-2019.02.2/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/7.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: lib/libuClibc-1.0.31.so: hidden symbol `__fini_array_end' isn't defined
/mnt/e/work-current/buildroot-2019.02.2/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/7.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
libc/Makefile.in:77: recipe for target 'lib/libc.so' failed
make[2]: *** [lib/libc.so] Error 1
package/pkg-generic.mk:238: recipe for target '/mnt/e/work-current/buildroot-2019.02.2/output/build/uclibc-1.0.31/.stamp_built' failed
make[1]: *** [/mnt/e/work-current/buildroot-2019.02.2/output/build/uclibc-1.0.31/.stamp_built] Error 2
Makefile:84: recipe for target '_all' failed
make: *** [_all] Error 2

【问题讨论】:

    标签: linux raspberry-pi windows-10 windows-subsystem-for-linux buildroot


    【解决方案1】:

    确实,Windows 不是受支持的构建环境。随着即将到来的 Windows 变化,它也许可以工作,但总的来说,开发 Linux 系统的最佳环境是 Linux。

    【讨论】:

      【解决方案2】:

      问题已通过禁用“反恶意软件服务可执行文件”进程(Windows Defender 的一部分)来解决,该进程会干扰构建进程。

      1. 运行“regedit”(Windows 键 + R)
      2. 导航到 HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender
      3. 创建名为 DisableAntiSpyware 的注册表项,新建 > DWORD(32 位)值并设置为 1
      4. 重启

      【讨论】:

      • 值得一提的是,在解决了这个问题后,我在 WSL 中使用 Buildroot 时遇到了其他问题,以至于我现在已经切换到使用 OracleVM 的 Ubuntu 虚拟机。
      • 这可能是您最好的选择。与虚拟机不同,WSL 不提供完整的 Linux 内核或操作系统环境。它更像是一个包装器,提供了在该 shell 上运行 shell 和工具的能力。但是...Bad News! Windows 10 Will Soon Have a Real Linux Kernel 看起来您可能等待的时间不会太长。
      • 2021 年报告:WSL 2 中的 buildroot 有效(并不奇怪..).. 我走了很长一段路.. 1. 尝试使用 WSL1,2. 尝试使用 WSL1 中的 Docker 3. 尝试与 WSL2。由于可以同时拥有 WSL1 和 2 个发行版,因此很容易利用这两个世界的优势..
      猜你喜欢
      • 2016-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-01
      • 1970-01-01
      • 2023-03-24
      • 2012-03-26
      • 1970-01-01
      相关资源
      最近更新 更多