参考更优雅的(不拆硬盘)拯救死翘翘了的WD MyCloud(Ubuntu 17.10)编译出来的Busybox
是只有3MB
大小的样子,这样编译出来的东西非常基础,功能有限。如果想要增加其他软件的时候,最少改动的情况下,一般都依赖GLIBC
,而GLIBC
完整编译出来的库接近50MB
,而我们修复系统,是一个纯内存文件系统。直接采用GLIBC
会非常浪费不多的内存空间。
因此在低内存的系统上采用uClibc
,变成一个不错的选择。下面我们讲一下如何通过crosstool-ng-1.23.0
构建一个我们需要的编译系统出来。
首先编译crosstool-ng-1.23.0
源代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get -y install autoconf $ sudo apt-get -y install gperf $ sudo apt-get -y install bison $ sudo apt-get -y install flex $ sudo apt-get -y install texinfo $ sudo apt-get -y install help2man $ sudo apt-get -y install ncurses-dev $ cd ~ $ git clone https://github.com/crosstool-ng/crosstool-ng $ cd crosstool-ng $ ./bootstrap $ ./configure --prefix=`echo ~`/wd_crosstool $ make $ make install |
如果下载crosstool-ng
源代码存在问题,可以从本站下载一份代码拷贝。点击此处下载。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$ cd ~ $ mkdir wd_fix_toolchain $ cd wd_fix_toolchain $ export PATH=~/wd_crosstool/bin/:$PATH $ cp ~/crosstool-ng/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config .config $ ct-ng oldconfig #默认一路回车,只是注意,中间选择Linux内核版本的使用,选择使用Linux 3.2 CT_LINUX_V_3_2=y $ ct-ng build |
最终的.config
文件,可以参考下面的配置信息,或者简单的拷贝这个文件到编译目录即可
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 |
# # Automatically generated file; DO NOT EDIT. # crosstool-NG crosstool-ng-1.23.0-280-g01e32905 Configuration # CT_CONFIGURE_has_static_link=y CT_CONFIGURE_has_wget=y CT_CONFIGURE_has_stat_flavor_GNU=y CT_CONFIGURE_has_make_3_81_or_newer=y CT_CONFIGURE_has_autoconf_2_63_or_newer=y CT_CONFIGURE_has_autoreconf_2_63_or_newer=y CT_CONFIGURE_has_automake_1_15_or_newer=y CT_CONFIGURE_has_gnu_m4_1_4_12_or_newer=y CT_CONFIGURE_has_git=y CT_MODULES=y # # Paths and misc options # # # crosstool-NG behavior # # CT_OBSOLETE is not set CT_EXPERIMENTAL=y # CT_ALLOW_BUILD_AS_ROOT is not set # CT_DEBUG_CT is not set # # Paths # CT_LOCAL_TARBALLS_DIR="${HOME}/src" CT_SAVE_TARBALLS=y CT_WORK_DIR="${CT_TOP_DIR}/.build" CT_BUILD_TOP_DIR="${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}" CT_PREFIX_DIR="${CT_PREFIX:-${HOME}/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}" CT_RM_RF_PREFIX_DIR=y CT_REMOVE_DOCS=y CT_PREFIX_DIR_RO=y CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y # CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set # # Downloading # CT_DOWNLOAD_AGENT_WGET=y # CT_DOWNLOAD_AGENT_NONE is not set # CT_FORBID_DOWNLOAD is not set # CT_FORCE_DOWNLOAD is not set CT_CONNECT_TIMEOUT=10 CT_DOWNLOAD_WGET_OPTIONS="--passive-ftp --tries=3 -nc --progress=dot:binary" # CT_ONLY_DOWNLOAD is not set # CT_USE_MIRROR is not set CT_VERIFY_DOWNLOAD_DIGEST=y CT_VERIFY_DOWNLOAD_DIGEST_SHA512=y # CT_VERIFY_DOWNLOAD_DIGEST_SHA256 is not set # CT_VERIFY_DOWNLOAD_DIGEST_SHA1 is not set # CT_VERIFY_DOWNLOAD_DIGEST_MD5 is not set CT_VERIFY_DOWNLOAD_DIGEST_ALG="sha512" # CT_VERIFY_DOWNLOAD_SIGNATURE is not set # # Extracting # # CT_FORCE_EXTRACT is not set CT_OVERRIDE_CONFIG_GUESS_SUB=y # CT_ONLY_EXTRACT is not set CT_PATCH_BUNDLED=y # CT_PATCH_LOCAL is not set # CT_PATCH_BUNDLED_LOCAL is not set # CT_PATCH_LOCAL_BUNDLED is not set # CT_PATCH_NONE is not set CT_PATCH_ORDER="bundled" # # Build behavior # CT_PARALLEL_JOBS=0 CT_LOAD="" CT_USE_PIPES=y CT_EXTRA_CFLAGS_FOR_BUILD="" CT_EXTRA_LDFLAGS_FOR_BUILD="" CT_EXTRA_CFLAGS_FOR_HOST="" CT_EXTRA_LDFLAGS_FOR_HOST="" # CT_CONFIG_SHELL_SH is not set # CT_CONFIG_SHELL_ASH is not set CT_CONFIG_SHELL_BASH=y # CT_CONFIG_SHELL_CUSTOM is not set CT_CONFIG_SHELL="${bash}" # # Logging # # CT_LOG_ERROR is not set # CT_LOG_WARN is not set # CT_LOG_INFO is not set CT_LOG_EXTRA=y # CT_LOG_ALL is not set # CT_LOG_DEBUG is not set CT_LOG_LEVEL_MAX="EXTRA" # CT_LOG_SEE_TOOLS_WARN is not set CT_LOG_PROGRESS_BAR=y CT_LOG_TO_FILE=y CT_LOG_FILE_COMPRESS=y # # Target options # # CT_ARCH_ALPHA is not set CT_ARCH_ARM=y # CT_ARCH_AVR is not set # CT_ARCH_M68K is not set # CT_ARCH_MICROBLAZE is not set # CT_ARCH_MIPS is not set # CT_ARCH_MSP430 is not set # CT_ARCH_NIOS2 is not set # CT_ARCH_POWERPC is not set # CT_ARCH_RISCV is not set # CT_ARCH_S390 is not set # CT_ARCH_SH is not set # CT_ARCH_SPARC is not set # CT_ARCH_X86 is not set # CT_ARCH_XTENSA is not set CT_ARCH="arm" CT_ARCH_CHOICE_KSYM="ARM" CT_ARCH_CPU="arm926ej-s" CT_ARCH_ARM_PKG_KSYM="" CT_ARCH_ARM_MODE="arm" CT_ARCH_ARM_MODE_ARM=y # CT_ARCH_ARM_MODE_THUMB is not set # CT_ARCH_ARM_INTERWORKING is not set CT_ARCH_ARM_EABI_FORCE=y CT_ARCH_ARM_EABI=y CT_ARCH_ARM_TUPLE_USE_EABIHF=y CT_ARCH_SUFFIX="" # # Generic target options # # CT_MULTILIB is not set CT_DEMULTILIB=y CT_ARCH_SUPPORTS_BOTH_MMU=y CT_ARCH_DEFAULT_HAS_MMU=y CT_ARCH_USE_MMU=y CT_ARCH_SUPPORTS_EITHER_ENDIAN=y CT_ARCH_DEFAULT_LE=y # CT_ARCH_BE is not set CT_ARCH_LE=y # CT_ARCH_BE_LE is not set # CT_ARCH_LE_BE is not set CT_ARCH_ENDIAN="little" CT_ARCH_SUPPORTS_32=y CT_ARCH_SUPPORTS_64=y CT_ARCH_DEFAULT_32=y CT_ARCH_BITNESS=32 CT_ARCH_32=y # CT_ARCH_64 is not set # # Target optimisations # CT_ARCH_SUPPORTS_WITH_ARCH=y CT_ARCH_SUPPORTS_WITH_CPU=y CT_ARCH_SUPPORTS_WITH_TUNE=y CT_ARCH_SUPPORTS_WITH_FLOAT=y CT_ARCH_SUPPORTS_WITH_FPU=y CT_ARCH_SUPPORTS_SOFTFP=y CT_ARCH_EXCLUSIVE_WITH_CPU=y CT_ARCH_FPU="" # CT_ARCH_FLOAT_AUTO is not set CT_ARCH_FLOAT_HW=y # CT_ARCH_FLOAT_SOFTFP is not set # CT_ARCH_FLOAT_SW is not set CT_TARGET_CFLAGS="" CT_TARGET_LDFLAGS="" CT_ARCH_FLOAT="hard" # # Toolchain options # # # General toolchain options # CT_FORCE_SYSROOT=y CT_USE_SYSROOT=y CT_SYSROOT_NAME="sysroot" CT_SYSROOT_DIR_PREFIX="" CT_WANTS_STATIC_LINK=y CT_WANTS_STATIC_LINK_CXX=y # CT_STATIC_TOOLCHAIN is not set CT_SHOW_CT_VERSION=y CT_TOOLCHAIN_PKGVERSION="" CT_TOOLCHAIN_BUGURL="" # # Tuple completion and aliasing # CT_TARGET_VENDOR="unknown" CT_TARGET_ALIAS_SED_EXPR="" CT_TARGET_ALIAS="" # # Toolchain type # # CT_NATIVE is not set CT_CROSS=y # CT_CROSS_NATIVE is not set # CT_CANADIAN is not set CT_TOOLCHAIN_TYPE="cross" # # Build system # CT_BUILD="" CT_BUILD_PREFIX="" CT_BUILD_SUFFIX="" # # Misc options # # CT_TOOLCHAIN_ENABLE_NLS is not set # # Operating System # CT_KERNEL_SUPPORTS_SHARED_LIBS=y # CT_KERNEL_BARE_METAL is not set CT_KERNEL_LINUX=y CT_KERNEL="linux" CT_KERNEL_CHOICE_KSYM="LINUX" CT_KERNEL_LINUX_PKG_KSYM="LINUX" CT_LINUX_DIR_NAME="linux" CT_LINUX_PKG_NAME="linux" CT_LINUX_SRC_RELEASE=y # CT_LINUX_SRC_DEVEL is not set # CT_LINUX_SRC_CUSTOM is not set # CT_LINUX_V_4_14 is not set # CT_LINUX_V_4_13 is not set # CT_LINUX_V_4_12 is not set # CT_LINUX_V_4_11 is not set # CT_LINUX_V_4_10 is not set # CT_LINUX_V_4_9 is not set # CT_LINUX_V_4_4 is not set # CT_LINUX_V_4_1 is not set # CT_LINUX_V_3_16 is not set # CT_LINUX_V_3_13 is not set # CT_LINUX_V_3_12 is not set # CT_LINUX_V_3_10 is not set # CT_LINUX_V_3_4 is not set CT_LINUX_V_3_2=y # CT_LINUX_V_2_6_32 is not set CT_LINUX_VERSION="3.2.96" CT_LINUX_MIRRORS="$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION})" CT_LINUX_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_LINUX_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_LINUX_ARCHIVE_FORMATS=".tar.xz .tar.gz" CT_LINUX_SIGNATURE_FORMAT="unpacked/.sign" CT_LINUX_3_2_or_later=y CT_KERNEL_LINUX_VERBOSITY_0=y # CT_KERNEL_LINUX_VERBOSITY_1 is not set # CT_KERNEL_LINUX_VERBOSITY_2 is not set CT_KERNEL_LINUX_VERBOSE_LEVEL=0 CT_KERNEL_LINUX_INSTALL_CHECK=y # # Common kernel options # CT_SHARED_LIBS=y # # Binary utilities # CT_ARCH_BINFMT_ELF=y CT_BINUTILS_BINUTILS=y CT_BINUTILS="binutils" CT_BINUTILS_CHOICE_KSYM="BINUTILS" CT_BINUTILS_BINUTILS_PKG_KSYM="BINUTILS" CT_BINUTILS_DIR_NAME="binutils" CT_BINUTILS_USE_GNU=y CT_BINUTILS_USE="BINUTILS" CT_BINUTILS_PKG_NAME="binutils" CT_BINUTILS_SRC_RELEASE=y # CT_BINUTILS_SRC_DEVEL is not set # CT_BINUTILS_SRC_CUSTOM is not set CT_BINUTILS_V_2_29_1=y # CT_BINUTILS_V_2_28_1 is not set # CT_BINUTILS_V_2_27 is not set # CT_BINUTILS_V_2_26_1 is not set CT_BINUTILS_VERSION="2.29.1" CT_BINUTILS_MIRRORS="$(CT_Mirrors GNU binutils) $(CT_Mirrors sourceware binutils/releases)" CT_BINUTILS_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_BINUTILS_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_BINUTILS_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz" CT_BINUTILS_SIGNATURE_FORMAT="packed/.sig" CT_BINUTILS_2_25_or_later=y CT_BINUTILS_2_23_or_later=y # # GNU binutils # CT_BINUTILS_HAS_HASH_STYLE=y CT_BINUTILS_HAS_GOLD=y CT_BINUTILS_HAS_PLUGINS=y CT_BINUTILS_HAS_PKGVERSION_BUGURL=y CT_BINUTILS_GOLD_SUPPORTS_ARCH=y CT_BINUTILS_GOLD_SUPPORT=y # CT_BINUTILS_LINKER_LD is not set # CT_BINUTILS_LINKER_GOLD is not set CT_BINUTILS_LINKER_LD_GOLD=y # CT_BINUTILS_LINKER_GOLD_LD is not set CT_BINUTILS_GOLD_INSTALLED=y CT_BINUTILS_GOLD_THREADS=y CT_BINUTILS_LINKER_BOTH=y CT_BINUTILS_LINKERS_LIST="ld,gold" CT_BINUTILS_LD_WRAPPER=y CT_BINUTILS_LINKER_DEFAULT="bfd" CT_BINUTILS_PLUGINS=y CT_BINUTILS_EXTRA_CONFIG_ARRAY="" # CT_BINUTILS_FOR_TARGET is not set # # C-library # # CT_LIBC_BIONIC is not set # CT_LIBC_GLIBC is not set # CT_LIBC_MUSL is not set CT_LIBC_UCLIBC=y CT_LIBC="uClibc" CT_LIBC_CHOICE_KSYM="UCLIBC" CT_THREADS="nptl" CT_LIBC_UCLIBC_PKG_KSYM="UCLIBC" CT_UCLIBC_DIR_NAME="uClibc" CT_UCLIBC_USE_UCLIBC_NG_ORG=y CT_UCLIBC_USE="UCLIBC_NG" CT_UCLIBC_NG_PKG_NAME="uClibc-ng" CT_UCLIBC_NG_SRC_RELEASE=y # CT_UCLIBC_NG_SRC_DEVEL is not set # CT_UCLIBC_NG_SRC_CUSTOM is not set CT_UCLIBC_NG_V_1_0_27=y # CT_UCLIBC_NG_V_1_0_26 is not set # CT_UCLIBC_NG_V_1_0_25 is not set CT_UCLIBC_NG_VERSION="1.0.27" CT_UCLIBC_NG_MIRRORS="http://downloads.uclibc-ng.org/releases/${CT_UCLIBC_NG_VERSION}" CT_UCLIBC_NG_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_UCLIBC_NG_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_UCLIBC_NG_ARCHIVE_FORMATS=".tar.xz .tar.lz .tar.bz2 .tar.gz" CT_UCLIBC_NG_SIGNATURE_FORMAT="packed/.asc" CT_UCLIBC_1_0_15_or_later=y CT_UCLIBC_1_0_0_or_later=y CT_UCLIBC_0_9_33_2_or_later=y CT_LIBC_UCLIBC_PARALLEL=y CT_LIBC_UCLIBC_NG=y CT_UCLIBC_MERGED_LINUXTHREADS=y CT_LIBC_UCLIBC_VERBOSITY_0=y # CT_LIBC_UCLIBC_VERBOSITY_1 is not set # CT_LIBC_UCLIBC_VERBOSITY_2 is not set CT_LIBC_UCLIBC_VERBOSITY="" CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y # CT_LIBC_UCLIBC_DEBUG_LEVEL_1 is not set # CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set # CT_LIBC_UCLIBC_DEBUG_LEVEL_3 is not set CT_LIBC_UCLIBC_DEBUG_LEVEL=0 CT_LIBC_UCLIBC_CONFIG_FILE="" CT_LIBC_UCLIBC_LNXTHRD="" # CT_LIBC_UCLIBC_LOCALES is not set # CT_LIBC_UCLIBC_IPV6 is not set CT_LIBC_UCLIBC_WCHAR=y # CT_LIBC_UCLIBC_FENV is not set # CT_LIBC_UCLIBC_RPC is not set CT_LIBC_UCLIBC_USE_GNU_SUFFIX=y CT_LIBC_SUPPORT_THREADS_ANY=y CT_LIBC_SUPPORT_THREADS_NATIVE=y CT_LIBC_SUPPORT_THREADS_LT=y CT_LIBC_SUPPORT_THREADS_NONE=y # # Common C library options # CT_THREADS_NATIVE=y # CT_THREADS_LT is not set # CT_THREADS_NONE is not set # CT_CREATE_LDSO_CONF is not set CT_LIBC_XLDD=y # # C compiler # CT_CC_CORE_PASSES_NEEDED=y CT_CC_CORE_PASS_1_NEEDED=y CT_CC_CORE_PASS_2_NEEDED=y CT_CC_SUPPORT_CXX=y CT_CC_SUPPORT_FORTRAN=y CT_CC_SUPPORT_ADA=y CT_CC_SUPPORT_OBJC=y CT_CC_SUPPORT_OBJCXX=y CT_CC_SUPPORT_GOLANG=y CT_CC_GCC=y CT_CC="gcc" CT_CC_CHOICE_KSYM="GCC" CT_CC_GCC_PKG_KSYM="GCC" CT_GCC_DIR_NAME="gcc" CT_GCC_USE_GNU=y # CT_GCC_USE_LINARO is not set CT_GCC_USE="GCC" CT_GCC_PKG_NAME="gcc" CT_GCC_SRC_RELEASE=y # CT_GCC_SRC_DEVEL is not set # CT_GCC_SRC_CUSTOM is not set CT_GCC_V_7_2_0=y # CT_GCC_V_6_4_0 is not set # CT_GCC_V_5_5_0 is not set # CT_GCC_V_4_9_4 is not set CT_GCC_VERSION="7.2.0" CT_GCC_MIRRORS="$(CT_Mirrors GNU gcc/gcc-${CT_GCC_VERSION}) $(CT_Mirrors sourceware gcc/releases/gcc-${CT_GCC_VERSION})" CT_GCC_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_GCC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_GCC_ARCHIVE_FORMATS=".tar.xz .tar.gz" CT_GCC_SIGNATURE_FORMAT="" CT_GCC_7_or_later=y CT_GCC_6_or_later=y CT_GCC_5_or_later=y CT_GCC_4_9_2_or_later=y CT_GCC_4_9_or_later=y CT_GCC_4_8_or_later=y CT_CC_GCC_ENABLE_PLUGINS=y CT_CC_GCC_GOLD=y CT_CC_GCC_HAS_LIBMPX=y CT_CC_GCC_ENABLE_CXX_FLAGS="" CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="" CT_CC_GCC_EXTRA_CONFIG_ARRAY="" CT_CC_GCC_STATIC_LIBSTDCXX=y # CT_CC_GCC_SYSTEM_ZLIB is not set CT_CC_GCC_CONFIG_TLS=m # # Optimisation features # CT_CC_GCC_USE_GRAPHITE=y CT_CC_GCC_USE_LTO=y # # Settings for libraries running on target # CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y # CT_CC_GCC_LIBMUDFLAP is not set # CT_CC_GCC_LIBGOMP is not set # CT_CC_GCC_LIBSSP is not set # CT_CC_GCC_LIBQUADMATH is not set # # Misc. obscure options. # CT_CC_CXA_ATEXIT=y # CT_CC_GCC_DISABLE_PCH is not set CT_CC_GCC_SJLJ_EXCEPTIONS=m CT_CC_GCC_LDBL_128=m # CT_CC_GCC_BUILD_ID is not set CT_CC_GCC_LNK_HASH_STYLE_DEFAULT=y # CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set # CT_CC_GCC_LNK_HASH_STYLE_GNU is not set # CT_CC_GCC_LNK_HASH_STYLE_BOTH is not set CT_CC_GCC_LNK_HASH_STYLE="" CT_CC_GCC_DEC_FLOAT_AUTO=y # CT_CC_GCC_DEC_FLOAT_BID is not set # CT_CC_GCC_DEC_FLOAT_DPD is not set # CT_CC_GCC_DEC_FLOATS_NO is not set # # Additional supported languages: # CT_CC_LANG_CXX=y # CT_CC_LANG_FORTRAN is not set # CT_CC_LANG_ADA is not set # CT_CC_LANG_OBJC is not set # CT_CC_LANG_OBJCXX is not set # CT_CC_LANG_GOLANG is not set CT_CC_LANG_OTHERS="" # # Debug facilities # CT_DEBUG_DUMA=y CT_DEBUG_DUMA_PKG_KSYM="DUMA" CT_DUMA_DIR_NAME="duma" CT_DUMA_PKG_NAME="duma" CT_DUMA_SRC_RELEASE=y # CT_DUMA_SRC_DEVEL is not set # CT_DUMA_SRC_CUSTOM is not set CT_DUMA_V_2_5_15=y CT_DUMA_VERSION="2_5_15" CT_DUMA_MIRRORS="http://downloads.sourceforge.net/project/duma/duma/${CT_DUMA_VERSION//_/.}" CT_DUMA_ARCHIVE_FILENAME="@{pkg_name}_@{version}" CT_DUMA_ARCHIVE_DIRNAME="@{pkg_name}_@{version}" CT_DUMA_ARCHIVE_FORMATS=".tar.gz .zip" CT_DUMA_SIGNATURE_FORMAT="" CT_DUMA_SO=y CT_DUMA_CUSTOM_WRAPPER=y CT_DEBUG_GDB=y CT_DEBUG_GDB_PKG_KSYM="GDB" CT_GDB_DIR_NAME="gdb" CT_GDB_USE_GNU=y CT_GDB_USE="GDB" CT_GDB_PKG_NAME="gdb" CT_GDB_SRC_RELEASE=y # CT_GDB_SRC_DEVEL is not set # CT_GDB_SRC_CUSTOM is not set CT_GDB_V_8_0_1=y # CT_GDB_V_7_12_1 is not set # CT_GDB_V_7_11_1 is not set CT_GDB_VERSION="8.0.1" CT_GDB_MIRRORS="$(CT_Mirrors GNU gdb) $(CT_Mirrors sourceware gdb/releases)" CT_GDB_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_GDB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_GDB_ARCHIVE_FORMATS=".tar.xz .tar.gz" CT_GDB_SIGNATURE_FORMAT="" CT_GDB_8_0_or_later=y CT_GDB_7_2_or_later=y CT_GDB_7_0_or_later=y CT_GDB_CROSS=y CT_GDB_CROSS_STATIC=y # CT_GDB_CROSS_SIM is not set CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="" CT_GDB_NATIVE=y CT_GDB_NATIVE_STATIC=y CT_GDB_GDBSERVER=y CT_GDB_GDBSERVER_HAS_IPA_LIB=y # CT_GDB_GDBSERVER_STATIC is not set # CT_GDB_GDBSERVER_STATIC_LIBSTDCXX is not set # CT_GDB_GDBSERVER_BUILD_IPA_LIB is not set CT_GDB_HAS_PKGVERSION_BUGURL=y CT_GDB_HAS_PYTHON=y CT_GDB_INSTALL_GDBINIT=y CT_DEBUG_LTRACE=y CT_DEBUG_LTRACE_PKG_KSYM="LTRACE" CT_LTRACE_DIR_NAME="ltrace" CT_LTRACE_PKG_NAME="ltrace" CT_LTRACE_SRC_RELEASE=y # CT_LTRACE_SRC_DEVEL is not set # CT_LTRACE_SRC_CUSTOM is not set CT_LTRACE_V_0_7_3=y CT_LTRACE_VERSION="0.7.3" CT_LTRACE_MIRRORS="http://ftp.debian.org/debian/pool/main/l/ltrace ftp:://ftp.debian.org/debian/pool/main/l/ltrace" CT_LTRACE_ARCHIVE_FILENAME="@{pkg_name}_@{version}.orig" CT_LTRACE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_LTRACE_ARCHIVE_FORMATS=".tar.bz2" CT_LTRACE_SIGNATURE_FORMAT="" CT_DEBUG_STRACE=y CT_DEBUG_STRACE_PKG_KSYM="STRACE" CT_STRACE_DIR_NAME="strace" CT_STRACE_PKG_NAME="strace" CT_STRACE_SRC_RELEASE=y # CT_STRACE_SRC_DEVEL is not set # CT_STRACE_SRC_CUSTOM is not set CT_STRACE_V_4_20=y # CT_STRACE_V_4_19 is not set # CT_STRACE_V_4_18 is not set # CT_STRACE_V_4_17 is not set # CT_STRACE_V_4_16 is not set # CT_STRACE_V_4_15 is not set CT_STRACE_VERSION="4.20" CT_STRACE_MIRRORS="http://downloads.sourceforge.net/project/strace/strace/${CT_STRACE_VERSION}" CT_STRACE_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_STRACE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_STRACE_ARCHIVE_FORMATS=".tar.xz" CT_STRACE_SIGNATURE_FORMAT="" # # Companion libraries # # CT_COMPLIBS_CHECK is not set # CT_COMP_LIBS_CLOOG is not set CT_COMP_LIBS_EXPAT=y CT_COMP_LIBS_EXPAT_PKG_KSYM="EXPAT" CT_EXPAT_DIR_NAME="expat" CT_EXPAT_PKG_NAME="expat" CT_EXPAT_SRC_RELEASE=y # CT_EXPAT_SRC_DEVEL is not set # CT_EXPAT_SRC_CUSTOM is not set CT_EXPAT_V_2_2_5=y CT_EXPAT_VERSION="2.2.5" CT_EXPAT_MIRRORS="http://downloads.sourceforge.net/project/expat/expat/${CT_EXPAT_VERSION}" CT_EXPAT_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_EXPAT_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_EXPAT_ARCHIVE_FORMATS=".tar.bz2" CT_EXPAT_SIGNATURE_FORMAT="" # CT_COMP_LIBS_GETTEXT is not set CT_COMP_LIBS_GMP=y CT_COMP_LIBS_GMP_PKG_KSYM="GMP" CT_GMP_DIR_NAME="gmp" CT_GMP_PKG_NAME="gmp" CT_GMP_SRC_RELEASE=y # CT_GMP_SRC_DEVEL is not set # CT_GMP_SRC_CUSTOM is not set CT_GMP_V_6_1_2=y CT_GMP_VERSION="6.1.2" CT_GMP_MIRRORS="https://gmplib.org/download/gmp https://gmplib.org/download/gmp/archive $(CT_Mirrors GNU gmp)" CT_GMP_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_GMP_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_GMP_ARCHIVE_FORMATS=".tar.xz .tar.lz .tar.bz2" CT_GMP_SIGNATURE_FORMAT="packed/.sig" CT_GMP_5_1_or_later=y CT_COMP_LIBS_ISL=y CT_COMP_LIBS_ISL_PKG_KSYM="ISL" CT_ISL_DIR_NAME="isl" CT_ISL_PKG_NAME="isl" CT_ISL_SRC_RELEASE=y # CT_ISL_SRC_DEVEL is not set # CT_ISL_SRC_CUSTOM is not set CT_ISL_V_0_18=y # CT_ISL_V_0_17_1 is not set # CT_ISL_V_0_16_1 is not set # CT_ISL_V_0_15 is not set CT_ISL_VERSION="0.18" CT_ISL_MIRRORS="http://isl.gforge.inria.fr" CT_ISL_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_ISL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_ISL_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz" CT_ISL_SIGNATURE_FORMAT="" CT_ISL_0_15_or_later=y CT_ISL_REQUIRE_0_15_or_later=y CT_ISL_0_14_or_later=y CT_ISL_REQUIRE_0_14_or_later=y CT_ISL_0_13_or_later=y CT_ISL_0_12_or_later=y CT_ISL_REQUIRE_0_12_or_later=y CT_COMP_LIBS_LIBELF=y CT_COMP_LIBS_LIBELF_PKG_KSYM="LIBELF" CT_LIBELF_DIR_NAME="libelf" CT_LIBELF_PKG_NAME="libelf" CT_LIBELF_SRC_RELEASE=y # CT_LIBELF_SRC_DEVEL is not set # CT_LIBELF_SRC_CUSTOM is not set CT_LIBELF_V_0_8_13=y CT_LIBELF_VERSION="0.8.13" CT_LIBELF_MIRRORS="http://www.mr511.de/software" CT_LIBELF_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_LIBELF_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_LIBELF_ARCHIVE_FORMATS=".tar.gz" CT_LIBELF_SIGNATURE_FORMAT="" # CT_COMP_LIBS_LIBICONV is not set CT_COMP_LIBS_MPC=y CT_COMP_LIBS_MPC_PKG_KSYM="MPC" CT_MPC_DIR_NAME="mpc" CT_MPC_PKG_NAME="mpc" CT_MPC_SRC_RELEASE=y # CT_MPC_SRC_DEVEL is not set # CT_MPC_SRC_CUSTOM is not set CT_MPC_V_1_0_3=y CT_MPC_VERSION="1.0.3" CT_MPC_MIRRORS="http://www.multiprecision.org/mpc/download $(CT_Mirrors GNU mpc)" CT_MPC_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_MPC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_MPC_ARCHIVE_FORMATS=".tar.gz" CT_MPC_SIGNATURE_FORMAT="packed/.sig" CT_COMP_LIBS_MPFR=y CT_COMP_LIBS_MPFR_PKG_KSYM="MPFR" CT_MPFR_DIR_NAME="mpfr" CT_MPFR_PKG_NAME="mpfr" CT_MPFR_SRC_RELEASE=y # CT_MPFR_SRC_DEVEL is not set # CT_MPFR_SRC_CUSTOM is not set CT_MPFR_V_3_1_6=y CT_MPFR_VERSION="3.1.6" CT_MPFR_MIRRORS="http://www.mpfr.org/mpfr-${CT_MPFR_VERSION} $(CT_Mirrors GNU mpfr)" CT_MPFR_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_MPFR_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_MPFR_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz .zip" CT_MPFR_SIGNATURE_FORMAT="packed/.asc" CT_COMP_LIBS_NCURSES=y CT_COMP_LIBS_NCURSES_PKG_KSYM="NCURSES" CT_NCURSES_DIR_NAME="ncurses" CT_NCURSES_PKG_NAME="ncurses" CT_NCURSES_SRC_RELEASE=y # CT_NCURSES_SRC_DEVEL is not set # CT_NCURSES_SRC_CUSTOM is not set CT_NCURSES_V_6_0=y CT_NCURSES_VERSION="6.0" CT_NCURSES_MIRRORS="ftp://invisible-island.net/ncurses $(CT_Mirrors GNU ncurses)" CT_NCURSES_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_NCURSES_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_NCURSES_ARCHIVE_FORMATS=".tar.gz" CT_NCURSES_SIGNATURE_FORMAT="packed/.sig" # CT_NCURSES_NEW_ABI is not set CT_NCURSES_HOST_CONFIG_ARGS="" CT_NCURSES_HOST_DISABLE_DB=y CT_NCURSES_HOST_FALLBACKS="linux,xterm,xterm-color,xterm-256color,vt100" CT_NCURSES_TARGET_CONFIG_ARGS="" # CT_NCURSES_TARGET_DISABLE_DB is not set CT_NCURSES_TARGET_FALLBACKS="" # CT_COMP_LIBS_ZLIB is not set # CT_LIBICONV_NEEDED is not set # CT_GETTEXT_NEEDED is not set CT_GMP_NEEDED=y CT_MPFR_NEEDED=y CT_ISL_NEEDED=y CT_MPC_NEEDED=y CT_LIBELF_TARGET=y CT_EXPAT_NEEDED=y CT_EXPAT_TARGET=y CT_NCURSES_NEEDED=y CT_NCURSES_TARGET=y # CT_ZLIB_NEEDED is not set CT_GMP=y CT_MPFR=y CT_ISL=y CT_MPC=y CT_EXPAT=y CT_NCURSES=y # # Companion tools # # CT_COMP_TOOLS_FOR_HOST is not set # CT_COMP_TOOLS_AUTOCONF is not set # CT_COMP_TOOLS_AUTOMAKE is not set CT_COMP_TOOLS_LIBTOOL=y CT_COMP_TOOLS_LIBTOOL_PKG_KSYM="LIBTOOL" CT_LIBTOOL_DIR_NAME="libtool" CT_LIBTOOL_PKG_NAME="libtool" CT_LIBTOOL_SRC_RELEASE=y # CT_LIBTOOL_SRC_DEVEL is not set # CT_LIBTOOL_SRC_CUSTOM is not set CT_LIBTOOL_V_2_4_6=y CT_LIBTOOL_VERSION="2.4.6" CT_LIBTOOL_MIRRORS="$(CT_Mirrors GNU libtool)" CT_LIBTOOL_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_LIBTOOL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_LIBTOOL_ARCHIVE_FORMATS=".tar.xz .tar.gz" CT_LIBTOOL_SIGNATURE_FORMAT="packed/.sig" # CT_COMP_TOOLS_M4 is not set # CT_COMP_TOOLS_MAKE is not set # # Test suite # # CT_TEST_SUITE_GCC is not set |
最终在如下目录生成我们需要的编译程序
1 |
~/x-tools/arm-unknown-linux-uclibcgnueabihf |
编译过程中的源代码下载可能会非常缓慢,可以从本站下载一份代码的拷贝。点击这里下载。下载完成后,解压缩到当前用户根目录,编译的时候,会自动使用已经下载的文件。可以使用下面的命令进行下载解压缩操作:
1 2 3 4 5 |
$ cd ~ $ wget https://www.mobibrw.com/wp-content/uploads/2017/12/src.tar.xz $ tar -xvf src.tar.xz |
如果懒得编译,也可点击这里下载一份已经编译好的编译工具。
博主,想请教一个问题。我按照你的流程创建了针对WDMyCloud Gen2的toolchain,这个机器的cpu是Marvell Armada 375,cotex a9 armv7-a,因此我稍微修改了一下.config,我的config传到https://github.com/machsix/WDMyCloud-Gen2/blob/master/toolchain/.config了。toolchain成功编译出来后,我先静态编译了c和c++的helloword,传到wdmycloud上也都正确运行了。然后我就照着别人的脚本写了个编译aria2的。环境变量设置在这里https://github.com/machsix/WDMyCloud-Gen2/blob/master/toolchain/source.sh,编译的脚本在这里https://github.com/machsix/WDMyCloud-Gen2/blob/master/compile_aria_mach6.sh。用的lib有expat+zlib+openssl+sqlite3+libssh2, 我在本机上成功编译出来了,但是这次传到wd上就提示segmentation fault。请问您觉得能是什么原因造成的?多谢
这种情况一般是由于链接的动态库导致的,如果只编译helloword能正常运行,那么说明glibc这部分是适合的,但是其他的很难说是哪个库导致的问题,如果有条件建议编译调试版本,并使用gdb调试一下。另外,建议查看系统日志,一般系统会记录应用崩溃信息的