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

📄 crosstool-uclibc-0.28-rc5-ter.patch

📁 linux下编译交叉工具链的工具源码
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
+    case ${C_LIBRARY} in+        glibc) -    # 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+            if test '!' -f Makefile; then+                # 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.  build and host are a bit odd, but --host=$TARGET+                # picks the right target, and --build=$HOST keeps it from+                # thinking it's a native toolchain ever+                CC=gcc \+                    ${LIBC_DIR}/configure --host=$TARGET --prefix=/usr \+                    --build=$BUILD \+                    --without-cvs --disable-sanity-checks \+                    --with-headers=${PREFIX}/${TARGET}/include \+                    --enable-hacker-mode+            fi++            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.+                make sysdeps/gnu/errlist.c+                mkdir -p stdio-common+                touch stdio-common/errlist-compat.c+            fi+            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 ${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)+            if test '!' -f Makefile; then+                perl ${LIBC_DIR}/relocate+            fi++            # 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++            # 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_headers +            ;;+    esac     cd .. fi @@ -254,14 +365,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+	--enable-languages=c \+	--disable-shared \+	${GCC_EXTRA_CONFIG} fi  make $PARALLELMFLAGS all-gcc install-gcc@@ -273,72 +384,119 @@ #--------------------------------------------------------- echo Build glibc 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+    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" CC=${TARGET}-gcc \+                AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \+                ${LIBC_DIR}/configure --host=$TARGET --prefix=/usr \+                --build=$HOST ${GLIBC_EXTRA_CONFIG} \+                --without-tls --without-__thread --enable-kernel=2.4.3 \+                --without-cvs --disable-profile --disable-debug --without-gd \+                --enable-add-ons --with-headers=$HEADERDIR+        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+        make install install_root=${SYSROOT} $GLIBC_SYSROOT_ARG++        # This doesn't seem to work when building a crosscompiler,+        # as it tries to execute localedef using the just-build 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+            done+        done++        ;;++    uclibc)+        if test '!' -f Makefile; then+            perl ${LIBC_DIR}/relocate+        fi++        # Go find a .config, or make a new default one.+        if test '!' -f .config; then+            if test -f ../build-libc-headers/.config; then+                cp ../build-libc-headers/.config .config+            elif 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++        # uClibc uses the CROSS environment variable as a prefix to the+        # compiler tools to use.  The newly built tools should be in our+        # path, so we need only give the correct name for them.+        CROSS=${TARGET}- PREFIX=${PREFIX}/${TARGET}/ \+            make all install -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" CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \-        ${GLIBC_DIR}/configure --host=$TARGET --prefix=/usr \-	--build=$HOST \-        ${GLIBC_EXTRA_CONFIG} \-        --without-tls --without-__thread --enable-kernel=2.4.3 \-        --without-cvs --disable-profile --disable-debug --without-gd \-        --enable-add-ons --with-headers=$HEADERDIR-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-make install install_root=${SYSROOT} $GLIBC_SYSROOT_ARG--# This doesn't seem to work when building a crosscompiler,-# as it tries to execute localedef using the just-build ld.so!?-#make localedata/install-locales install_root=${SYSROOT}--# Fix problems in linker scripts.-# -# 1. Remove absolute paths

⌨️ 快捷键说明

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