⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crosstool-0.32-uclibc5.diff

📁 做好的交叉编译工具链
💻 DIFF
📖 第 1 页 / 共 5 页
字号:
+            # The following three things have to be done to build glibc-2.3.x, but they don't hurt older versions.+            # 1. override CC to keep glibc's configure from using $TARGET-gcc. +            # 2. disable linuxthreads, which needs a real cross-compiler to generate tcb-offsets.h properly+            # 3. build with gcc 3.2 or later+            # Compare these options with the ones used when building glibc for real below - they're different.+            # As of glibc-2.3.2, to get this step to work for hppa-linux, you need --enable-hacker-mode+            # so when configure checks to make sure gcc has access to the assembler you just built...+            # Alternately, we could put ${PREFIX}/${TARGET}/bin on the path.+            # Set --build so maybe we don't have to specify "cross-compiling=yes" below (haven't tried yet)+            # Note: the warning+            # "*** WARNING: Are you sure you do not want to use the `linuxthreads'"+            # *** add-on?"+            # is ok here, since all we want are the basic headers at this point.+            # Override libc_cv_ppc_machine so glibc-cvs doesn't complain+            # 'a version of binutils that supports .machine "altivec" is needed'.+          libc_cv_ppc_machine=yes \+          CC=gcc \+            ${LIBC_DIR}/configure --prefix=/usr \             --build=$BUILD --host=$TARGET \             --without-cvs --disable-sanity-checks --with-headers=$HEADERDIR \             --enable-hacker-mode-    fi+        fi -    if grep -q GLIBC_2.3 ${GLIBC_DIR}/ChangeLog; then-        # glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c, which fails without a real cross-compiler.-        # Fortunately, we don't need errlist-compat.c, since we just need .h files, -        # so work around this by creating a fake errlist-compat.c and satisfying its dependencies.-        # Another workaround might be to tell configure to not use any cross options to $(CC).-        # The real fix would be to get install-headers to not generate errlist-compat.c.-        libc_cv_ppc_machine=yes \+        if grep -q GLIBC_2.3 ${LIBC_DIR}/ChangeLog; then+            # glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c, which fails without a real cross-compiler.+            # Fortunately, we don't need errlist-compat.c, since we just need .h files, +            # so work around this by creating a fake errlist-compat.c and satisfying its dependencies.+            # Another workaround might be to tell configure to not use any cross options to $(CC).+            # The real fix would be to get install-headers to not generate errlist-compat.c.+            libc_cv_ppc_machine=yes \                 make sysdeps/gnu/errlist.c-        mkdir -p stdio-common-        # sleep for 2 seconds for benefit of filesystems with lousy time resolution, like FAT,-        # so make knows for sure errlist-compat.c doesn't need generating-        sleep 2-        touch stdio-common/errlist-compat.c-    fi-    libc_cv_ppc_machine=yes \-    make cross-compiling=yes install_root=${SYSROOT} $GLIBC_SYSROOT_ARG install-headers+            mkdir -p stdio-common+            # sleep for 2 seconds for benefit of filesystems with lousy time resolution, like FAT,+            # so make knows for sure errlist-compat.c doesn't need generating+            sleep 2+            touch stdio-common/errlist-compat.c+        fi+        libc_cv_ppc_machine=yes \+        make cross-compiling=yes install_root=${SYSROOT} $GLIBC_SYSROOT_ARG install-headers -    # Two headers -- stubs.h and features.h -- aren't installed by install-headers,-    # so do them by hand.  We can tolerate an empty stubs.h for the moment.-    # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html--    mkdir -p $HEADERDIR/gnu-    touch $HEADERDIR/gnu/stubs.h-    cp ${GLIBC_DIR}/include/features.h $HEADERDIR/features.h-    # Building the bootstrap gcc requires either setting inhibit_libc, or-    # having a copy of stdio_lim.h... see-    # http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html-    cp bits/stdio_lim.h $HEADERDIR/bits/stdio_lim.h+        # Two headers -- stubs.h and features.h -- aren't installed by install-headers,+        # so do them by hand.  We can tolerate an empty stubs.h for the moment.+        # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html++        mkdir -p $HEADERDIR/gnu+        touch $HEADERDIR/gnu/stubs.h+        cp ${LIBC_DIR}/include/features.h $HEADERDIR/features.h+        # Building the bootstrap gcc requires either setting inhibit_libc, or+        # having a copy of stdio_lim.h... see+        # http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html+        cp bits/stdio_lim.h $HEADERDIR/bits/stdio_lim.h+   +      ;;+      +      uclibc)+      +        # currently uClibc cannot be built offtree, so we copy the source +        cp -a ${LIBC_DIR}/* .++          # Go find a .config, or make a new default one.+          if test '!' -f .config; then+            if test -z "${UCLIBCCONFIG}"; then+              if test -f ${LIBC_DIR}/.config; then+                cp ${LIBC_DIR}/.config .config+              else+                defaultuClibcConfig+              fi+            else+              cp ${UCLIBCCONFIG} .config+            fi+          fi++          correctuClibcConfig++          # answer all questions with default; this is all we can do+          # when no specific .config file has been provided.+          yes "" | make oldconfig+         +          # uClibc uses the CROSS environment variable as a prefix to the+          # compiler tools to use.  Setting it to the empty string forces+          # use of the native build host tools, which we need at this+          # stage, as we don't have target tools yet.+          CROSS= PREFIX=${SYSROOT}/ make headers install_dev++          ;;+    esac      cd .. fi@@ -353,14 +466,14 @@         --with-local-prefix=${SYSROOT} \         --disable-multilib \         --with-newlib \-        ${GCC_EXTRA_CONFIG} \         ${GCC_SYSROOT_ARG_CORE} \         --disable-nls \         --enable-threads=no \         --enable-symvers=gnu \         --enable-__cxa_atexit \         --enable-languages=c \-        --disable-shared+        --disable-shared \+        ${GCC_EXTRA_CONFIG} fi  test "$CANADIAN_BUILD" = "" || make $PARALLELMFLAGS all-build-libiberty || true@@ -372,92 +485,130 @@ test -x ${PREFIX}/bin/${TARGET}-gcc${EXEEXT} || abort Build failed during gcc-core   #----------------------------------------------------------echo Build glibc and linuxthreads+echo Build libc and linuxthreads -mkdir -p build-glibc; cd build-glibc+mkdir -p build-libc; cd build-libc -# sh4 really needs to set configparms as of gcc-3.4/glibc-2.3.2-# note: this is awkward, doesn't work well if you need more than one line in configparms-echo ${GLIBC_CONFIGPARMS} > configparms+case ${C_LIBRARY} in -if test '!' -f Makefile; then-    # Configure with --prefix the way we want it on the target...-    # There are a whole lot of settings here.  You'll probably want-    # to read up on what they all mean, and customize a bit.-    # e.g. I picked --enable-kernel=2.4.3 here just because it's the kernel Bill -    # used in his example gcc2.95.3 script.  That means some backwards compatibility -    # stuff is turned on in glibc that you may not need if you're using a newer kernel.-    # Compare these options with the ones used when installing the glibc headers above - they're different.-    # Adding "--without-gd" option to avoid error "memusagestat.c:36:16: gd.h: No such file or directory" -    # See also http://sources.redhat.com/ml/libc-alpha/2000-07/msg00024.html. -    # Set BUILD_CC, or you won't be able to build datafiles-    # Set --build, else glibc-2.3.2 will think you're not cross-compiling, and try to run the test programs--    BUILD_CC=gcc CFLAGS="$TARGET_CFLAGS $EXTRA_TARGET_CFLAGS" CC="${TARGET}-gcc $GLIBC_EXTRA_CC_ARGS" \-    AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \-        ${GLIBC_DIR}/configure --prefix=/usr \-        --build=$BUILD --host=$TARGET \-        ${GLIBC_EXTRA_CONFIG} \-        --enable-kernel=2.4.3 \-        --without-cvs --disable-profile --disable-debug --without-gd \-        --without-tls --without-__thread \-        $SHARED_MODE \-        --enable-add-ons${GLIBC_ADDON_OPTIONS} --with-headers=$HEADERDIR-fi--if grep -l '^install-lib-all:' ${GLIBC_DIR}/Makerules > /dev/null; then-    # nptl-era glibc.-    # If the install-lib-all target (which is added by our make-install-lib-all.patch) is present,-    # it means we're building glibc-2.3.3 or later, and we can't build programs yet,-    # as they require libeh, which won't be installed until full build of gcc-    GLIBC_INITIAL_BUILD_RULE=lib-    GLIBC_INITIAL_INSTALL_RULE="install-lib-all install-headers"-    GLIBC_INSTALL_APPS_LATER=yes-else-    # classic glibc.  -    # We can build and install everything with the bootstrap compiler.-    GLIBC_INITIAL_BUILD_RULE=all-    GLIBC_INITIAL_INSTALL_RULE=install-    GLIBC_INSTALL_APPS_LATER=no-fi-# If this fails with an error like this:-# ...  linux/autoconf.h: No such file or directory -# then you need to set the KERNELCONFIG variable to point to a .config file for this arch.-# The following architectures are known to need kernel .config: alpha, arm, ia64, s390, sh, sparc-# Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, at least on macosx-# No need for PARALLELMFLAGS here, Makefile already reads this environment variable-make LD=${TARGET}-ld RANLIB=${TARGET}-ranlib $GLIBC_INITIAL_BUILD_RULE-make install_root=${SYSROOT} $GLIBC_SYSROOT_ARG $GLIBC_INITIAL_INSTALL_RULE--# This doesn't seem to work when building a crosscompiler,-# as it tries to execute localedef using the just-built ld.so!?-#make localedata/install-locales install_root=${SYSROOT}--# Fix problems in linker scripts.-# -# 1. Remove absolute paths-# Any file in a list of known suspects that isn't a symlink is assumed to be a linker script.-# FIXME: test -h is not portable-# FIXME: probably need to check more files than just these three...-# Need to use sed instead of just assuming we know what's in libc.so because otherwise alpha breaks-# But won't need to do this at all once we use --with-sysroot (available in gcc-3.3.3 and up)-#-# 2. Remove lines containing BUG per http://sources.redhat.com/ml/bug-glibc/2003-05/msg00055.html,-# needed to fix gcc-3.2.3/glibc-2.3.2 targeting arm-#-# To make "strip *.so.*" not fail (ptxdist does this), rename to .so_orig rather than .so.orig-for file in libc.so libpthread.so libgcc_s.so; do-  for lib in lib lib64 usr/lib usr/lib64; do-        if test -f ${SYSROOT}/$lib/$file && test ! -h ${SYSROOT}/$lib/$file; then-                mv ${SYSROOT}/$lib/$file ${SYSROOT}/$lib/${file}_orig-                if test -z "$USE_SYSROOT"; then-                  sed 's,/usr/lib/,,g;s,/usr/lib64/,,g;s,/lib/,,g;s,/lib64/,,g;/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file-                else-                  sed '/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file-                fi-        fi+  glibc)++    # sh4 really needs to set configparms as of gcc-3.4/glibc-2.3.2+    # note: this is awkward, doesn't work well if you need more than one line in configparms+    echo ${GLIBC_CONFIGPARMS} > configparms++    if test '!' -f Makefile; then+        # Configure with --prefix the way we want it on the target...+        # There are a whole lot of settings here.  You'll probably want+        # to read up on what they all mean, and customize a bit.+        # e.g. I picked --enable-kernel=2.4.3 here just because it's the kernel Bill +        # used in his example gcc2.95.3 script.  That means some backwards compatibility +        # stuff is turned on in glibc that you may not need if you're using a newer kernel.+        # Compare these options with the ones used when installing the glibc headers above - they're different.+        # Adding "--without-gd" option to avoid error "memusagestat.c:36:16: gd.h: No such file or directory" +        # See also http://sources.redhat.com/ml/libc-alpha/2000-07/msg00024.html. +        # Set BUILD_CC, or you won't be able to build datafiles+        # Set --build, else glibc-2.3.2 will think you're not cross-compiling, and try to run the test programs++        BUILD_CC=gcc CFLAGS="$TARGET_CFLAGS $EXTRA_TARGET_CFLAGS" CC="${TARGET}-gcc $GLIBC_EXTRA_CC_ARGS" \+        AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \+            ${LIBC_DIR}/configure --prefix=/usr \+            --build=$BUILD --host=$TARGET \+            ${GLIBC_EXTRA_CONFIG} \+            --enable-kernel=2.4.3 \+            --without-cvs --disable-profile --disable-debug --without-gd \+            --without-tls --without-__thread \+            $SHARED_MODE \+            --enable-add-ons${GLIBC_ADDON_OPTIONS} --with-headers=$HEADERDIR+    fi++    if grep -l '^install-lib-all:' ${LIBC_DIR}/Makerules > /dev/null; then+        # nptl-era glibc.+        # If the install-lib-all target (which is added by our make-install-lib-all.patch) is present,+        # it means we're building glibc-2.3.3 or later, and we can't build programs yet,+        # as they require libeh, which won't be installed until full build of gcc+        GLIBC_INITIAL_BUILD_RULE=lib+        GLIBC_INITIAL_INSTALL_RULE="install-lib-all install-headers"+        GLIBC_INSTALL_APPS_LATER=yes+    else+        # classic glibc.  +        # We can build and install everything with the bootstrap compiler.+        GLIBC_INITIAL_BUILD_RULE=all+        GLIBC_INITIAL_INSTALL_RULE=install+        GLIBC_INSTALL_APPS_LATER=no+    fi+    # If this fails with an error like this:+    # ...  linux/autoconf.h: No such file or directory +    # then you need to set the KERNELCONFIG variable to point to a .config file for this arch.+    # The following architectures are known to need kernel .config: alpha, arm, ia64, s390, sh, sparc+    # Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, at least on macosx+    # No need for PARALLELMFLAGS here, Makefile already reads this environment variable+    make LD=${TARGET}-ld RANLIB=${TARGET}-ranlib $GLIBC_INITIAL_BUILD_RULE+    make install_root=${SYSROOT} $GLIBC_SYSROOT_ARG $GLIBC_INITIAL_INSTALL_RULE++    # This doesn't seem to work when building a crosscompiler,+    # as it tries to execute localedef using the just-built ld.so!?+    #make localedata/install-locales install_root=${SYSROOT}++    # Fix problems in linker scripts.+    # +    # 1. Remove absolute paths+    # Any file in a list of known suspects that isn't a symlink is assumed to be a linker script.+    # FIXME: test -h is not portable+    # FIXME: probably need to check more files than just these three...+    # Need to use sed instead of just assuming we know what's in libc.so because otherwise alpha breaks+    # But won't need to do this at all once we use --with-sysroot (available in gcc-3.3.3 and up)+    #+    # 2. Remove lines containing BUG per http://sources.redhat.com/ml/bug-glibc/2003-05/msg00055.html,+    # needed to fix gcc-3.2.3/glibc-2.3.2 targeting arm+    #+    # To make "strip *.so.*" not fail (ptxdist does this), rename to .so_orig rather than .so.orig

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -