x86 Linux系统下构建交叉编译工具(3)

news2024/11/17 19:35:05

接前一篇文章:x86 Linux系统下构建交叉编译工具(2)

本文参考以下文章:

建立交叉编译器 for arm (binutils-2.17 gcc-3.4.6 glibc-2.3.6)

特此致谢!

上一回构建了binutils的交叉环境,本回进行引导编译器交的构建。

二、编译构建

2. 引导编译器构建

(1)build-tools目录下创建build-binutils文件夹

进入到cross-compiler/build-tools目录。如下所示:

~$ cd cross-compiler/build-tools/
~/cross-compiler/build-tool$ ls
binutils-2.41  binutils-2.41.tar.xz  build-binuitls  gcc-13.2.0.tar.xz  glibc-2.38.tar.xz

(2)解压glibc源码压缩包

通过tar命令解压glibc源码压缩包。实际命令及结果如下所示(截取部分):

$ tar xvf glibc-2.38.tar.xz 
……
glibc-2.38/wcsmbs/wcstoull_l.c
glibc-2.38/wcsmbs/wcswidth.c
glibc-2.38/wcsmbs/wcsxfrm.c
glibc-2.38/wcsmbs/wcsxfrm_l.c
glibc-2.38/wcsmbs/wctob.c
glibc-2.38/wcsmbs/wcwidth.c
glibc-2.38/wcsmbs/wcwidth.h
glibc-2.38/wcsmbs/wmemchr.c
glibc-2.38/wcsmbs/wmemcmp.c
glibc-2.38/wcsmbs/wmemcpy.c
glibc-2.38/wcsmbs/wmemmove.c
glibc-2.38/wcsmbs/wmempcpy.c
glibc-2.38/wcsmbs/wmemset.c
glibc-2.38/wctype/
glibc-2.38/wctype/Makefile
glibc-2.38/wctype/Versions
glibc-2.38/wctype/bits/
glibc-2.38/wctype/bits/wctype-wchar.h
glibc-2.38/wctype/bug-wctypeh.c
glibc-2.38/wctype/iswctype.c
glibc-2.38/wctype/iswctype_l.c
glibc-2.38/wctype/test_wcfuncs.c
glibc-2.38/wctype/test_wctype.c
glibc-2.38/wctype/towctrans.c
glibc-2.38/wctype/towctrans_l.c
glibc-2.38/wctype/wcfuncs.c
glibc-2.38/wctype/wcfuncs_l.c
glibc-2.38/wctype/wchar-lookup.h
glibc-2.38/wctype/wctrans.c
glibc-2.38/wctype/wctrans_l.c
glibc-2.38/wctype/wctype.c
glibc-2.38/wctype/wctype.h
glibc-2.38/wctype/wctype_l.c
$ 

解压后glibc-2.38目录内容如下:

$ ls glibc-2.38
abi-tags        crypt           iconv              Makeconfig     o-iterator.mk   socket
aclocal.m4      csu             iconvdata          Makefile       po              soft-fp
argp            ctype           include            Makefile.help  posix           stdio-common
assert          debug           inet               Makefile.in    pwd             stdlib
benchtests      dirent          INSTALL            Makerules      README          string
bits            dlfcn           intl               malloc         resolv          sunrpc
catgets         elf             io                 manual         resource        support
ChangeLog.old   extra-lib.mk    libc-abis          math           rt              sysdeps
config.h.in     gen-locales.mk  libio              mathvec        Rules           sysvipc
config.make.in  gmon            libof-iterator.mk  misc           scripts         termios
configure       gnulib          LICENSES           NEWS           SECURITY.md     test-skeleton.c
configure.ac    grp             locale             nis            setjmp          time
conform         gshadow         localedata         nptl           shadow          timezone
CONTRIBUTED-BY  hesiod          login              nptl_db        SHARED-FILES    version.h
COPYING         htl             mach               nscd           shlib-versions  wcsmbs
COPYING.LIB     hurd            MAINTAINERS        nss            signal          wctype

(3)下载glibc-linuxthreads源码压缩包

到以下页面下载gibc-linuxthreads源码压缩包:http://ftp.vim.org/ftp/gnu/glibc/

 选择glibc-linuxthreads-2.5.tar.bz2,下载并将其放入到~/cross_compiler/build-tools目录。

(4)解压glibc-linuxthreads源码压缩包

进入~/cross-compiler/build-tools目录,通过tar命令解压glibc-linuxthreads源码压缩包。实际命令及结果如下所示:

$ tar xvf glibc-linuxthreads-2.5.tar.bz2 --directory=glibc-2.38
linuxthreads/
linuxthreads/ChangeLog
linuxthreads/Banner
linuxthreads/FAQ.html
linuxthreads/Changes
linuxthreads/Makeconfig
linuxthreads/LICENSE
linuxthreads/Examples/
linuxthreads/Examples/Makefile
linuxthreads/Examples/ex1.c
linuxthreads/Examples/ex10.c
linuxthreads/Examples/ex11.c
linuxthreads/Examples/ex12.c
linuxthreads/Examples/ex13.c
linuxthreads/Examples/ex14.c
linuxthreads/Examples/ex15.c
linuxthreads/Examples/ex16.c
linuxthreads/Examples/ex17.c
linuxthreads/Examples/ex18.c
linuxthreads/Examples/ex2.c
linuxthreads/Examples/ex3.c
linuxthreads/Examples/ex4.c
linuxthreads/Examples/ex5.c
linuxthreads/Examples/ex6.c
linuxthreads/Examples/ex7.c
linuxthreads/Examples/ex8.c
linuxthreads/Examples/ex9.c
linuxthreads/Examples/tststatic.c
linuxthreads/Makefile
linuxthreads/README
linuxthreads/README.Xfree3.2
linuxthreads/Versions
linuxthreads/alloca_cutoff.c
linuxthreads/attr.c
linuxthreads/barrier.c
linuxthreads/bug-sleep.c
linuxthreads/cancel.c
linuxthreads/condvar.c
linuxthreads/configure
linuxthreads/configure.in
linuxthreads/descr.h
linuxthreads/ecmutex.c
linuxthreads/errno.c
linuxthreads/events.c
linuxthreads/forward.c
linuxthreads/internals.h
linuxthreads/join.c
linuxthreads/joinrace.c
linuxthreads/libc-cancellation.c
linuxthreads/libc-tls-loc.c
linuxthreads/libc-tsd.c
linuxthreads/libc_pthread_init.c
linuxthreads/linuxthreads.texi
linuxthreads/lockfile.c
linuxthreads/manager.c
linuxthreads/mutex.c
linuxthreads/old_pthread_atfork.c
linuxthreads/oldsemaphore.c
linuxthreads/pt-allocrtsig.c
linuxthreads/pt-machine.c
linuxthreads/pt-system.c
linuxthreads/ptcleanup.c
linuxthreads/ptclock_gettime.c
linuxthreads/ptclock_settime.c
linuxthreads/ptfork.c
linuxthreads/pthandles.c
linuxthreads/pthread.c
linuxthreads/pthread_atfork.c
linuxthreads/pthread_setegid.c
linuxthreads/pthread_seteuid.c
linuxthreads/pthread_setgid.c
linuxthreads/pthread_setregid.c
linuxthreads/pthread_setresgid.c
linuxthreads/pthread_setresuid.c
linuxthreads/pthread_setreuid.c
linuxthreads/pthread_setuid.c
linuxthreads/queue.h
linuxthreads/restart.h
linuxthreads/rwlock.c
linuxthreads/semaphore.c
linuxthreads/semaphore.h
linuxthreads/shlib-versions
linuxthreads/sighandler.c
linuxthreads/signals.c
linuxthreads/specific.c
linuxthreads/spinlock.c
linuxthreads/spinlock.h
linuxthreads/tst-_res1.c
linuxthreads/tst-_res1mod1.c
linuxthreads/tst-_res1mod2.c
linuxthreads/tst-align.c
linuxthreads/tst-attr1.c
linuxthreads/tst-cancel-static.c
linuxthreads/tst-cancel-wrappers.sh
linuxthreads/tst-cancel.c
linuxthreads/tst-cancel1.c
linuxthreads/tst-cancel2.c
linuxthreads/tst-cancel3.c
linuxthreads/tst-cancel4.c
linuxthreads/tst-cancel5.c
linuxthreads/tst-cancel6.c
linuxthreads/tst-cancel7.c
linuxthreads/tst-cancel8.c
linuxthreads/tst-clock1.c
linuxthreads/tst-context.c
linuxthreads/tst-popen.c
linuxthreads/tst-popen2.c
linuxthreads/tst-sighandler1.c
linuxthreads/tst-sighandler2.c
linuxthreads/tst-signal.c
linuxthreads/tst-signal.sh
linuxthreads/tst-stack1.c
linuxthreads/tst-stackguard1-static.c
linuxthreads/tst-stackguard1.c
linuxthreads/tst-static-locale.c
linuxthreads/tst-tls1.c
linuxthreads/tst-tls1.h
linuxthreads/tst-tls1mod.c
linuxthreads/tst-tls1moda.c
linuxthreads/tst-tls1modb.c
linuxthreads/tst-tls1modc.c
linuxthreads/tst-tls1modd.c
linuxthreads/tst-tls1mode.c
linuxthreads/tst-tls1modf.c
linuxthreads/tst-tls2.sh
linuxthreads/tst-tsd1.c
linuxthreads/tststack.c
linuxthreads/unload.c
linuxthreads/man/
linuxthreads/man/Makefile
linuxthreads/man/pthread_atfork.man
linuxthreads/man/pthread_attr_init.man
linuxthreads/man/pthread_cancel.man
linuxthreads/man/pthread_cleanup_push.man
linuxthreads/man/pthread_cond_init.man
linuxthreads/man/pthread_condattr_init.man
linuxthreads/man/pthread_create.man
linuxthreads/man/pthread_detach.man
linuxthreads/man/pthread_equal.man
linuxthreads/man/pthread_exit.man
linuxthreads/man/pthread_join.man
linuxthreads/man/pthread_key_create.man
linuxthreads/man/pthread_kill_other_threads_np.man
linuxthreads/man/pthread_mutex_init.man
linuxthreads/man/pthread_mutexattr_init.man
linuxthreads/man/pthread_mutexattr_setkind_np.man
linuxthreads/man/pthread_once.man
linuxthreads/man/pthread_self.man
linuxthreads/man/pthread_setschedparam.man
linuxthreads/man/pthread_sigmask.man
linuxthreads/man/sem_init.man
linuxthreads/man/troffprepro
linuxthreads/sysdeps/
linuxthreads/sysdeps/alpha/
linuxthreads/sysdeps/alpha/elf/
linuxthreads/sysdeps/alpha/elf/pt-initfini.c
linuxthreads/sysdeps/alpha/pspinlock.c
linuxthreads/sysdeps/alpha/pt-machine.h
linuxthreads/sysdeps/alpha/tls.h
linuxthreads/sysdeps/cris/
linuxthreads/sysdeps/cris/pspinlock.c
linuxthreads/sysdeps/cris/pt-machine.h
linuxthreads/sysdeps/i386/
linuxthreads/sysdeps/i386/i486/
linuxthreads/sysdeps/i386/i486/pt-machine.h
linuxthreads/sysdeps/i386/i586/
linuxthreads/sysdeps/i386/i586/Versions
linuxthreads/sysdeps/i386/i586/pt-machine.h
linuxthreads/sysdeps/i386/Makefile
linuxthreads/sysdeps/i386/pspinlock.c
linuxthreads/sysdeps/i386/pt-machine.h
linuxthreads/sysdeps/i386/tcb-offsets.sym
linuxthreads/sysdeps/i386/tls.h
linuxthreads/sysdeps/i386/useldt.h
linuxthreads/sysdeps/i386/i686/
linuxthreads/sysdeps/i386/i686/Versions
linuxthreads/sysdeps/i386/i686/pt-machine.h
linuxthreads/sysdeps/ia64/
linuxthreads/sysdeps/ia64/Makefile
linuxthreads/sysdeps/ia64/Versions
linuxthreads/sysdeps/ia64/pspinlock.c
linuxthreads/sysdeps/ia64/pt-machine.h
linuxthreads/sysdeps/ia64/tcb-offsets.sym
linuxthreads/sysdeps/ia64/tls.h
linuxthreads/sysdeps/m68k/
linuxthreads/sysdeps/m68k/pspinlock.c
linuxthreads/sysdeps/m68k/pt-machine.h
linuxthreads/sysdeps/mips/
linuxthreads/sysdeps/mips/pspinlock.c
linuxthreads/sysdeps/mips/pt-machine.h
linuxthreads/sysdeps/mips/tls.h
linuxthreads/sysdeps/powerpc/
linuxthreads/sysdeps/powerpc/powerpc32/
linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c
linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h
linuxthreads/sysdeps/powerpc/Makefile
linuxthreads/sysdeps/powerpc/tcb-offsets.sym
linuxthreads/sysdeps/powerpc/tls.h
linuxthreads/sysdeps/powerpc/powerpc64/
linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c
linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h
linuxthreads/sysdeps/pthread/
linuxthreads/sysdeps/pthread/bits/
linuxthreads/sysdeps/pthread/bits/initspin.h
linuxthreads/sysdeps/pthread/bits/libc-lock.h
linuxthreads/sysdeps/pthread/bits/libc-tsd.h
linuxthreads/sysdeps/pthread/bits/pthreadtypes.h
linuxthreads/sysdeps/pthread/bits/typesizes.h
linuxthreads/sysdeps/pthread/Makefile
linuxthreads/sysdeps/pthread/Subdirs
linuxthreads/sysdeps/pthread/errno-loc.c
linuxthreads/sysdeps/pthread/flockfile.c
linuxthreads/sysdeps/pthread/ftrylockfile.c
linuxthreads/sysdeps/pthread/funlockfile.c
linuxthreads/sysdeps/pthread/gai_misc.h
linuxthreads/sysdeps/pthread/getcpuclockid.c
linuxthreads/sysdeps/pthread/herrno-loc.c
linuxthreads/sysdeps/pthread/list.h
linuxthreads/sysdeps/pthread/malloc-machine.h
linuxthreads/sysdeps/pthread/posix-timer.h
linuxthreads/sysdeps/pthread/pt-initfini.c
linuxthreads/sysdeps/pthread/pthread-functions.h
linuxthreads/sysdeps/pthread/pthread.h
linuxthreads/sysdeps/pthread/ptlongjmp.c
linuxthreads/sysdeps/pthread/res-state.c
linuxthreads/sysdeps/pthread/semaphore.h
linuxthreads/sysdeps/pthread/sigaction.c
linuxthreads/sysdeps/pthread/tcb-offsets.h
linuxthreads/sysdeps/pthread/timer_create.c
linuxthreads/sysdeps/pthread/timer_delete.c
linuxthreads/sysdeps/pthread/timer_getoverr.c
linuxthreads/sysdeps/pthread/timer_gettime.c
linuxthreads/sysdeps/pthread/timer_routines.c
linuxthreads/sysdeps/pthread/timer_settime.c
linuxthreads/sysdeps/pthread/tst-timer.c
linuxthreads/sysdeps/s390/
linuxthreads/sysdeps/s390/s390-32/
linuxthreads/sysdeps/s390/s390-32/pt-machine.h
linuxthreads/sysdeps/s390/Makefile
linuxthreads/sysdeps/s390/pspinlock.c
linuxthreads/sysdeps/s390/tcb-offsets.sym
linuxthreads/sysdeps/s390/tls.h
linuxthreads/sysdeps/s390/s390-64/
linuxthreads/sysdeps/s390/s390-64/pt-machine.h
linuxthreads/sysdeps/sh/
linuxthreads/sysdeps/sh/Makefile
linuxthreads/sysdeps/sh/pspinlock.c
linuxthreads/sysdeps/sh/pt-machine.h
linuxthreads/sysdeps/sh/tcb-offsets.sym
linuxthreads/sysdeps/sh/tls.h
linuxthreads/sysdeps/sparc/
linuxthreads/sysdeps/sparc/sparc32/
linuxthreads/sysdeps/sparc/sparc32/sparcv9/
linuxthreads/sysdeps/sparc/sparc32/sparcv9/Versions
linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
linuxthreads/sysdeps/sparc/Makefile
linuxthreads/sysdeps/sparc/tcb-offsets.sym
linuxthreads/sysdeps/sparc/tls.h
linuxthreads/sysdeps/sparc/sparc64/
linuxthreads/sysdeps/sparc/sparc64/Versions
linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
linuxthreads/sysdeps/unix/
linuxthreads/sysdeps/unix/sysv/
linuxthreads/sysdeps/unix/sysv/linux/
linuxthreads/sysdeps/unix/sysv/linux/Makefile
linuxthreads/sysdeps/unix/sysv/linux/Implies
linuxthreads/sysdeps/unix/sysv/linux/alpha/
linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/
linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h
linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
linuxthreads/sysdeps/unix/sysv/linux/alpha/Makefile
linuxthreads/sysdeps/unix/sysv/linux/alpha/Versions
linuxthreads/sysdeps/unix/sysv/linux/alpha/aio_cancel.c
linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S
linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/Versions
linuxthreads/sysdeps/unix/sysv/linux/allocalim.h
linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c
linuxthreads/sysdeps/unix/sysv/linux/execve.c
linuxthreads/sysdeps/unix/sysv/linux/fork.c
linuxthreads/sysdeps/unix/sysv/linux/fork.h
linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c
linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c
linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c
linuxthreads/sysdeps/unix/sysv/linux/raise.c
linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c
linuxthreads/sysdeps/unix/sysv/linux/sigwait.c
linuxthreads/sysdeps/unix/sysv/linux/smp.h
linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c
linuxthreads/sysdeps/unix/sysv/linux/bits/
linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h
linuxthreads/sysdeps/unix/sysv/linux/bits/sigthread.h
linuxthreads/sysdeps/unix/sysv/linux/i386/
linuxthreads/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/ia64/
linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/
linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
linuxthreads/sysdeps/unix/sysv/linux/ia64/Makefile
linuxthreads/sysdeps/unix/sysv/linux/ia64/Versions
linuxthreads/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h
linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c
linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c
linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/m68k/
linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/mips/
linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/
linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/mips/Makefile
linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/powerpc/
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/powerpc/Makefile
linuxthreads/sysdeps/unix/sysv/linux/powerpc/Versions
linuxthreads/sysdeps/unix/sysv/linux/powerpc/ptlongjmp.c
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/s390/
linuxthreads/sysdeps/unix/sysv/linux/s390/bits/
linuxthreads/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/sh/
linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c
linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h
linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/sparc/
linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/
linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h
linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
linuxthreads/sysdeps/unix/sysv/linux/sparc/Versions
linuxthreads/sysdeps/unix/sysv/linux/sparc/aio_cancel.c
linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/x86_64/
linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile
linuxthreads/sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c
linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S
linuxthreads/sysdeps/x86_64/
linuxthreads/sysdeps/x86_64/Makefile
linuxthreads/sysdeps/x86_64/Versions
linuxthreads/sysdeps/x86_64/pspinlock.c
linuxthreads/sysdeps/x86_64/pt-machine.h
linuxthreads/sysdeps/x86_64/tcb-offsets.sym
linuxthreads/sysdeps/x86_64/tls.h
linuxthreads_db/
linuxthreads_db/ChangeLog
linuxthreads_db/Banner
linuxthreads_db/Makefile
linuxthreads_db/Versions
linuxthreads_db/proc_service.h
linuxthreads_db/shlib-versions
linuxthreads_db/td_init.c
linuxthreads_db/td_log.c
linuxthreads_db/td_symbol_list.c
linuxthreads_db/td_ta_clear_event.c
linuxthreads_db/td_ta_delete.c
linuxthreads_db/td_ta_enable_stats.c
linuxthreads_db/td_ta_event_addr.c
linuxthreads_db/td_ta_event_getmsg.c
linuxthreads_db/td_ta_get_nthreads.c
linuxthreads_db/td_ta_get_ph.c
linuxthreads_db/td_ta_get_stats.c
linuxthreads_db/td_ta_map_id2thr.c
linuxthreads_db/td_ta_map_lwp2thr.c
linuxthreads_db/td_ta_new.c
linuxthreads_db/td_ta_reset_stats.c
linuxthreads_db/td_ta_set_event.c
linuxthreads_db/td_ta_setconcurrency.c
linuxthreads_db/td_ta_thr_iter.c
linuxthreads_db/td_ta_tsd_iter.c
linuxthreads_db/td_thr_clear_event.c
linuxthreads_db/td_thr_dbresume.c
linuxthreads_db/td_thr_dbsuspend.c
linuxthreads_db/td_thr_event_enable.c
linuxthreads_db/td_thr_event_getmsg.c
linuxthreads_db/td_thr_get_info.c
linuxthreads_db/td_thr_getfpregs.c
linuxthreads_db/td_thr_getgregs.c
linuxthreads_db/td_thr_getxregs.c
linuxthreads_db/td_thr_getxregsize.c
linuxthreads_db/td_thr_set_event.c
linuxthreads_db/td_thr_setfpregs.c
linuxthreads_db/td_thr_setgregs.c
linuxthreads_db/td_thr_setprio.c
linuxthreads_db/td_thr_setsigpending.c
linuxthreads_db/td_thr_setxregs.c
linuxthreads_db/td_thr_sigsetmask.c
linuxthreads_db/td_thr_tls_get_addr.c
linuxthreads_db/td_thr_tlsbase.c
linuxthreads_db/td_thr_tsd.c
linuxthreads_db/td_thr_validate.c
linuxthreads_db/thread_db.h
linuxthreads_db/thread_dbP.h
$ 

再次查看glibc-2.38目录内容:

$ ls glibc-2.38
abi-tags    ChangeLog.old   COPYING      dlfcn           gshadow    inet               LICENSES         MAINTAINERS    manual   nptl_db        README       setjmp          stdio-common  termios
aclocal.m4  config.h.in     COPYING.LIB  elf             hesiod     INSTALL            linuxthreads     Makeconfig     math     nscd           resolv       shadow          stdlib        test-skeleton.c
argp        config.make.in  crypt        extra-lib.mk    htl        intl               linuxthreads_db  Makefile       mathvec  nss            resource     SHARED-FILES    string        time
assert      configure       csu          gen-locales.mk  hurd       io                 locale           Makefile.help  misc     o-iterator.mk  rt           shlib-versions  sunrpc        timezone
benchtests  configure.ac    ctype        gmon            iconv      libc-abis          localedata       Makefile.in    NEWS     po             Rules        signal          support       version.h
bits        conform         debug        gnulib          iconvdata  libio              login            Makerules      nis      posix          scripts      socket          sysdeps       wcsmbs
catgets     CONTRIBUTED-BY  dirent       grp             include    libof-iterator.mk  mach             malloc         nptl     pwd            SECURITY.md  soft-fp         sysvipc       wctype

可以看到,多了linuxthreads和linuxthreads_db两个目录。内容分别如下:

$ ls glibc-2.38/linuxthreads/
alloca_cutoff.c  configure.in  joinrace.c           man                   pthandles.c          pthread_setuid.c  shlib-versions  tst-cancel2.c           tst-clock1.c       tst-signal.sh             tst-tls1mod.c
attr.c           descr.h       libc-cancellation.c  manager.c             pthread_atfork.c     pt-machine.c      sighandler.c    tst-cancel3.c           tst-context.c      tst-stack1.c              tst-tls1modc.c
Banner           ecmutex.c     libc_pthread_init.c  mutex.c               pthread.c            pt-system.c       signals.c       tst-cancel4.c           tst-popen2.c       tststack.c                tst-tls1modd.c
barrier.c        errno.c       libc-tls-loc.c       old_pthread_atfork.c  pthread_setegid.c    queue.h           specific.c      tst-cancel5.c           tst-popen.c        tst-stackguard1.c         tst-tls1mode.c
bug-sleep.c      events.c      libc-tsd.c           oldsemaphore.c        pthread_seteuid.c    README            spinlock.c      tst-cancel6.c           tst-_res1.c        tst-stackguard1-static.c  tst-tls1modf.c
cancel.c         Examples      LICENSE              pt-allocrtsig.c       pthread_setgid.c     README.Xfree3.2   spinlock.h      tst-cancel7.c           tst-_res1mod1.c    tst-static-locale.c       tst-tls2.sh
ChangeLog        FAQ.html      linuxthreads.texi    ptcleanup.c           pthread_setregid.c   restart.h         sysdeps         tst-cancel8.c           tst-_res1mod2.c    tst-tls1.c                tst-tsd1.c
Changes          forward.c     lockfile.c           ptclock_gettime.c     pthread_setresgid.c  rwlock.c          tst-align.c     tst-cancel.c            tst-sighandler1.c  tst-tls1.h                unload.c
condvar.c        internals.h   Makeconfig           ptclock_settime.c     pthread_setresuid.c  semaphore.c       tst-attr1.c     tst-cancel-static.c     tst-sighandler2.c  tst-tls1moda.c            Versions
configure        join.c        Makefile             ptfork.c              pthread_setreuid.c   semaphore.h       tst-cancel1.c   tst-cancel-wrappers.sh  tst-signal.c       tst-tls1modb.c
$ ls glibc-2.38/linuxthreads_db
Banner          td_init.c            td_ta_enable_stats.c  td_ta_get_stats.c    td_ta_setconcurrency.c  td_thr_dbresume.c      td_thr_getgregs.c     td_thr_setfpregs.c      td_thr_sigsetmask.c    thread_db.h
ChangeLog       td_log.c             td_ta_event_addr.c    td_ta_map_id2thr.c   td_ta_set_event.c       td_thr_dbsuspend.c     td_thr_get_info.c     td_thr_setgregs.c       td_thr_tlsbase.c       thread_dbP.h
Makefile        td_symbol_list.c     td_ta_event_getmsg.c  td_ta_map_lwp2thr.c  td_ta_thr_iter.c        td_thr_event_enable.c  td_thr_getxregs.c     td_thr_setprio.c        td_thr_tls_get_addr.c  Versions
proc_service.h  td_ta_clear_event.c  td_ta_get_nthreads.c  td_ta_new.c          td_ta_tsd_iter.c        td_thr_event_getmsg.c  td_thr_getxregsize.c  td_thr_setsigpending.c  td_thr_tsd.c
shlib-versions  td_ta_delete.c       td_ta_get_ph.c        td_ta_reset_stats.c  td_thr_clear_event.c    td_thr_getfpregs.c     td_thr_set_event.c    td_thr_setxregs.c       td_thr_validate.c

(5)创建并进入build-glibc-headers文件夹

在cross-compiler/build-tools目录下创建build-glibc-headers目录,并进入。如下所示:

~/cross-compiler/build-tools$ mkdir build-glibc-headers
~/cross-compiler/build-tools$ cd build-glibc-headers/
~/cross-compiler/build-tools/build-glibc-headers$ 

(6)配置

执行configure进行glibc的配置。实际命令及结果如下:

$ ../glibc-2.38/configure --host=arm-linux --prefix="/usr" --enable-add-ons=linuxthreads --with-headers=/usr/local/arm/arm-linux/include/
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking for arm-linux-gcc... no
checking for gcc... gcc
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for gcc... gcc
checking for arm-linux-g++... no
checking for arm-linux-c++... no
checking for arm-linux-gpp... no
checking for arm-linux-aCC... no
checking for arm-linux-CC... no
checking for arm-linux-cxx... no
checking for arm-linux-cc++... no
checking for arm-linux-cl.exe... no
checking for arm-linux-FCC... no
checking for arm-linux-KCC... no
checking for arm-linux-RCC... no
checking for arm-linux-xlC_r... no
checking for arm-linux-xlC... no
checking for arm-linux-clang++... no
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking whether g++ can link programs... yes
checking for sysdeps preconfigure fragments... aarch64 alpha arc arm configure: WARNING: arm/preconfigure: Did not find ARM architecture type; using default
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
csky hppa i386 loongarch m68k microblaze checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/grep -E
mips nios2 or1k powerpc riscv s390 sh checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/grep -E
sparc x86_64 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ld... ld
checking version of ld... 2.38, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 4.3, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.21, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 6.8, ok
checking for sed... sed
checking version of sed... 4.8, ok
checking for gawk... gawk
checking version of gawk... 5.1.1, ok
checking for bison... bison
checking version of bison... 3.8.2, ok
checking if gcc is sufficient to build libc... yes
checking for python3... python3
checking version of python3... 3.11.2, ok
checking for use of fpu sysdeps directories... yes
checking for -fstack-protector... yes
checking for -fstack-protector-strong... yes
checking for -fstack-protector-all... yes
checking for assembler and linker STT_GNU_IFUNC support... yes
checking for gcc attribute ifunc support... yes
checking whether the linker supports textrels along with ifunc... yes
checking for GNU attribute retain support... yes
checking if compiler warns about alias for function with incompatible types... yes
checking sysdep dirs... sysdeps/unix/sysv/linux/arm/le sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/le sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic
checking LD_LIBRARY_PATH variable... ok
checking for bash... /usr/bin/bash
checking for perl... /usr/bin/perl
checking for install-info... /usr/bin/install-info
checking for .set assembler directive... yes
checking linker support for protected data symbol... yes
checking linker support for INSERT in linker script... yes
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for libunwind-support in compiler... no
checking whether --noexecstack is desirable for .S files... yes
checking for linker that supports -z execstack... yes
checking for linker that supports -z start-stop-gc... yes
checking for linker that supports --depaudit... yes
checking for linker that supports -z pack-relative-relocs... yes
checking for linker that supports --no-dynamic-linker... yes
checking for -static-pie... yes
checking for -fpie... yes
checking for GLOB_DAT reloc... yes
checking for -mtls-dialect=gnu2... yes
checking if -Wno-ignored-attributes is required for aliases... 
checking whether cc puts quotes around section names... no
checking for __builtin_memset... yes
checking for redirection of built-in functions... yes
checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
checking for compiler option that -fsignaling-nans... -fsignaling-nans
checking if gcc accepts -fno-tree-loop-distribute-patterns with __attribute__ ((__optimize__))... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking for maximum supported _FORTIFY_SOURCE level... 3
checking whether the assembler requires one version per symbol... no
checking for __builtin_trap with no external dependencies... yes
checking whether the C++ compiler supports thread_local... yes
running configure fragment for sysdeps/unix/sysv/linux
checking installed Linux kernel header files... missing or too old!
configure: error: GNU libc requires kernel header files from
Linux 3.2.0 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
Linux 3.2.0 or later.  This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files.  To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.

(7)编译

执行make命令进行glibc的编译。实际命令及结果如下:

~/cross-compiler/build-tools/build-glibc-headers$ make cross-compiling=yes install_root=/usr/local/arm/arm-linux/ prefix="" build_directory=../build-glibc-headers install-headers
make: *** 没有规则可制作目标“install-headers”。 停止。

将目录切换到glibc-2.38下,再次运行以上命令:

~/cross-compiler/build-tools/build-glibc-headers$ cd ../glibc-2.38/
~/cross-compiler/build-tools/glibc-2.38$ make cross-compiling=yes install_root=/usr/local/arm/arm-linux/ prefix="" build_directory=../build-glibc-headers install-headers
Makeconfig:43: *** objdir must be defined by the build-directory Makefile。 停止。

存在一定问题,也许是版本问题,也许是其它问题。需要后续深入解决。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/906129.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

实例040 限制窗体大小

实例说明 Windows窗体是可以随意改变大小的&#xff0c;然而对于一些要求严格的窗体&#xff0c;开发人员不希望用户随意的改变其大小&#xff0c;例如&#xff0c;定位准确的地图和游戏软件等。遇到这种情况必须对窗口的大小进行一些限制。本例设计一个限制了大小的窗体&#…

幼儿园托幼机构管理系统 微信小程序

托幼机构管理系统微信小程序从功能、数据流程、可行性、运行环境进行需求分析。对托幼机构管理系统微信小程序的数据库、功能进行了详细设计&#xff0c;分析了主要界面设计和相关组件设计&#xff0c;托幼机构管理系统微信小程序的具体实现进行了介绍。从数据库中获取数据、向…

小航助学GESP_C++一级模拟测试卷第4套(含题库答题软件账号)

需要在线模拟训练的题库账号请点击 小航助学编程在线模拟试卷系统&#xff08;含题库答题软件账号&#xff09;_程序猿下山的博客-CSDN博客 需要在线模拟训练的题库账号请点击 小航助学编程在线模拟试卷系统&#xff08;含题库答题软件账号&#xff09;_程序猿下山的博客-CSD…

qt中窗口的布局

qt中窗口的布局 常用的窗口布局方式使用拖拽控件的方式调用窗口布局使用Widget控件完成窗口布局布局中嵌套布局demo&#xff08;制作登录页面&#xff09; 如果不使用窗口布局&#xff0c;会带来的后果&#xff1a; 控件可能显示不出来不能按照期望的大小显示不能跟随窗口进行…

时间戳转换成浏览器对应的UTC时间、时间戳根据对应的时区转换成对应的UTC时间

/*** 毫秒级时间戳转成 浏览器时间对应的 UTC时间**/toBrowserTime(timestamp) {//输入毫秒级 timestamp1692579702028if (!timestamp) {return null} else {let date moment(timestamp).format()let browserTime date.replace(/-/g, "/").replace(/T/g, " &q…

如何说服技术老大用 Redis ?

这个问题很微妙&#xff0c;可能这位同学内心深处&#xff0c;觉得 Redis 是所有应用缓存的标配。 缓存的世界很广阔&#xff0c;对于应用系统来讲&#xff0c;我们经常将缓存划分为本地缓存和分布式缓存。 本地缓存 &#xff1a;应用中的缓存组件&#xff0c;缓存组件和应用…

FPGA_学习_16_IP核_ROM(延迟一拍输出)

在寻找APD最合适的偏压的过程中&#xff0c;一般会用到厂商提供一条曲线&#xff0c;横坐标是温度的变化&#xff0c;纵坐标表示击穿偏压的变化&#xff0c;但每个产品真正的击穿偏压是有差异的。 为了能够快速的找到当前温度下真实的击穿偏压&#xff0c;我们可以这样做&#…

YOLO入门介绍

YOLO&#xff08;You Only Look Once&#xff09;是一种基于深度学习的目标检测算法&#xff0c;它的核心思想是将目标检测任务转化为一个回归问题&#xff0c;通过单次前向传播即可完成目标检测。相比于传统的目标检测算法&#xff0c;YOLO具有更快的检测速度和更高的准确率&a…

定时检测接口是否正常飞书告警脚本

第一版 支持多个接口地址&#xff0c;循环检测&#xff0c;定时每分钟执行一次脚本 告警效果 脚本 飞书机器人创建忽略跳过&#xff0c;各大协作平台大同小异拿出机器人hook地址 #!/bin/bash URL_LIST(https://gatewaxxxxxxxxxxxxxxxxxx https://sandbox-gatexxxxxxxxxxxxxxx…

机器学习深度学习——NLP实战(情感分析模型——textCNN实现)

&#x1f468;‍&#x1f393;作者简介&#xff1a;一位即将上大四&#xff0c;正专攻机器学习的保研er &#x1f30c;上期文章&#xff1a;机器学习&&深度学习——NLP实战&#xff08;情感分析模型——RNN实现&#xff09; &#x1f4da;订阅专栏&#xff1a;机器学习…

NDK 的配置记录~

NDK 的配置 NDK配置 NDK设置在 AS 路径中设置在 local.properties设置在 build.gradle ndk 和 gradle 对应关系gradle的插件和版本对应关系gradle 插件和NDK对应关系 NDK NDK&#xff08;Native Development Kit&#xff09;是一组工具和库&#xff0c;用于在 Android 平台上开…

加强预算管理一体化,走进全面预算管理的数智化时代

自2021年&#xff0c;国务院印发《国务院关于进一步深化预算管理制度改革的意见》&#xff08;国发〔2021〕5号&#xff09;以来&#xff0c;中央政府对企业实施全面预算管理越来越重视&#xff0c;预算绩效管理逐渐进入大家的视线。各个企业逐步落实应用&#xff0c;推进预算管…

C++的常用基础知识100个

1、定义一个常量 2、数据类型-整型 3、数据类型-字符型 4、数据的输入 5、运算符 6、三目运算符 7、循环案例-99乘法表 8、数组 9、冒泡排序 10、函数的定义 11、函数的分文件编写 12、指针 12、结构体 13、通讯录项目 创建一个空项目&#xff0c;并命名为通讯录管理系统。 14…

“我来拿”APP设计报告

1.设计摘要 想必大家对学校的悬赏互助群并不陌生&#xff0c;学生们在群里提出要求并标明价格&#xff0c;就可以找人帮忙。我们的跑腿平台就是以此为灵感&#xff0c;让学生之间通过一个专门的020平台实现有报酬的互助跑腿&#xff0c;但是相比QQ、微信群&#xff0c;我们让定…

js数组常用的方法(总结)

目录 1.数组头和尾操作——push、pop、unshift/shift 2、数组转为字符串 —— join() 3、数组截取 —— slice() 4、数组更新 —— splice() 5、反转数组 —— reverse() 6、连接数组 —— concat() 7、ES6连接数组 —— ... ES5数组新增方法 8、索引方法 —— indexO…

PgSQL中的DATE_PART使用

用法&#xff1a; DATE_PART(field, source) 这个DATE_PART()函数返回类型为double precision的值 century decade year month day hour minute second microseconds milliseconds dow doy epoch isodow isoyear timezone timezone_hour timezone_minute

水经微图网页版发布

水经微图网页版&#xff0c;可轻松将关注的地点制作成你的个人地图。 你可以在任意位置添加标注点或绘制地图&#xff0c;查找地点并将其保存到你的地图中&#xff0c;或导入地图数据迅速制作地图并保存&#xff0c;你还可以运用图标和颜色展示个性风采&#xff0c;从而可让每…

线程阻塞队列

阻塞队列 一、BlockingQueue 接口 BlockingQueue 是阻塞队列接口实现机制是使用两条线程&#xff0c;允许两个线程同时操作队列一个线程用于写入 Put ,一个线程用于读取 Take当队列中没有数据的情况下&#xff0c;读取线程会自动阻塞&#xff0c;直到有数据放入队列当队列中数…

opencv进阶12-EigenFaces 人脸识别

EigenFaces 通常也被称为 特征脸&#xff0c;它使用主成分分析&#xff08;Principal Component Analysis&#xff0c;PCA&#xff09; 方法将高维的人脸数据处理为低维数据后&#xff08;降维&#xff09;&#xff0c;再进行数据分析和处理&#xff0c;获取识别结果。 基本原理…

蓝牙资讯|消息称富士康投资4亿美元在印度生产苹果 AirPods 耳机

根据印度最大通讯社 PTI 报道&#xff0c;苹果和富士康已经签署一项新的协议&#xff0c;富士康将投资 4 亿美元在印度第四大城市海得拉巴扩建工厂&#xff0c;负责为苹果生产 AirPods TWS 耳机。 报道称苹果已经决定在印度本土生产 AirPods 耳机&#xff0c;富士康计划投资 …