I'm attempting to build an embedded Raspberry Pi Linux OS using Buildroot-2019.02.2 in WSL (Windows Subsystem for Linux). The compilation keeps failing and I have no idea where to start to fix it. I also tried with the latest Git version of Buildroot and had the same problem. Any suggestions would be greatly appreciated!
Last 100 lines or so of output:
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
Indeed, Windows is not a supported build environment. With the upcoming Windows changes it could perhaps be made to work, but in general, the best environment to develop a Linux system on is Linux.
Problem was solved by disabling the ‘Antimalware Service Executable’ process, part of Windows Defender, that was messing with the build process.
User contributions licensed under CC BY-SA 3.0