|
- RPM_OPT_FLAGS=" -O0 -g "
- CC=gcc
- OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'`
- OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
- OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'`
- case "$OPT_FLAGS" in
- *-fasynchronous-unwind-tables*)
- sed -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
- ../gcc/Makefile.in
- ;;
- esac
- CC="$CC" CFLAGS="$OPT_FLAGS" CXXFLAGS="`echo $OPT_FLAGS | sed 's/ -Wall / /g'`" XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \
- GCJFLAGS="$OPT_FLAGS" \
- ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
- --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap \
- --enable-shared --enable-threads=posix --enable-checking=release \
- --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
- --enable-languages=c,c++,objc,obj-c++ \
- --disable-libgcj --enable-c99 --enable-long-long --with-abi=64 \
- --enable-clocale=gnu --disable-libstdcxx-pch --disable-multilib
- make BOOT_CFLAGS="$OPT_FLAGS" bootstrap -j1
复制代码 这里的 RPM_OPT_FLAGS=" -O0 -g " 如果等于 -O2 -g
会出现- config.status: creating config.h
- config.status: executing default commands
- make[3]: Entering directory `/usr/src/redhat/BUILD/gcc-4.4.0/obj-mips64el-unknown-linux-gnu/build-mips64el-unknown-linux-gnu/libiberty'
- if [ x"" != x ] && [ ! -d pic ]; then \
- mkdir pic; \
- else true; fi
- touch stamp-picdir
- if [ x"" != x ]; then \
- gcc -c -DHAVE_CONFIG_H -O2 -g -I. -I../../../libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic ../../../libiberty/regex.c -o pic/regex.o; \
- else true; fi
- gcc -c -DHAVE_CONFIG_H -O2 -g -I. -I../../../libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic ../../../libiberty/regex.c -o regex.o
- ../../../libiberty/regex.c:130: warning: function declaration isn't a prototype
- ../../../libiberty/regex.c:130: warning: conflicting types for built-in function 'malloc'
- ../../../libiberty/regex.c:131: warning: function declaration isn't a prototype
- ../../../libiberty/regex.c:131: warning: conflicting types for built-in function 'realloc'
- In file included from /usr/include/bits/string2.h:1299,
- from /usr/include/string.h:423,
- from ../../../libiberty/regex.c:149:
- /usr/include/stdlib.h:471: error: conflicting types for 'malloc'
- ../../../libiberty/regex.c:130: note: previous declaration of 'malloc' was here
- In file included from ../../../libiberty/regex.c:638:
- ../../../libiberty/regex.c: In function 'byte_regex_compile':
- ../../../libiberty/regex.c:2439: warning: implicit declaration of function 'free'
- ../../../libiberty/regex.c:2439: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c:2500: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c:2533: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c:2640: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c:3643: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c:4150: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c: In function 'byte_re_compile_fastmap':
- ../../../libiberty/regex.c:4835: warning: implicit declaration of function 'abort'
- ../../../libiberty/regex.c:4835: warning: incompatible implicit declaration of built-in function 'abort'
- ../../../libiberty/regex.c: In function 'byte_re_match_2_internal':
- ../../../libiberty/regex.c:7421: warning: incompatible implicit declaration of built-in function 'abort'
- ../../../libiberty/regex.c: In function 'xregcomp':
- ../../../libiberty/regex.c:7975: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c: In function 'xregexec':
- ../../../libiberty/regex.c:8050: warning: incompatible implicit declaration of built-in function 'free'
- ../../../libiberty/regex.c: In function 'xregerror':
- ../../../libiberty/regex.c:8078: warning: incompatible implicit declaration of built-in function 'abort'
- ../../../libiberty/regex.c: In function 'xregfree':
- ../../../libiberty/regex.c:8112: warning: incompatible implicit declaration of built-in function 'free'
- make[3]: *** [regex.o] Error 1
- make[3]: Leaving directory `/usr/src/redhat/BUILD/gcc-4.4.0/obj-mips64el-unknown-linux-gnu/build-mips64el-unknown-linux-gnu/libiberty'
- make[2]: *** [all-build-libiberty] Error 2
- make[2]: Leaving directory `/usr/src/redhat/BUILD/gcc-4.4.0/obj-mips64el-unknown-linux-gnu'
- make[1]: *** [stage1-bubble] Error 2
- make[1]: Leaving directory `/usr/src/redhat/BUILD/gcc-4.4.0/obj-mips64el-unknown-linux-gnu'
- make: *** [bootstrap] Error 2
- error: Bad exit status from /var/tmp/rpm-tmp.FAzaKQ (%build)
- RPM build errors:
- Bad exit status from /var/tmp/rpm-tmp.FAzaKQ (%build)
- [root@localhost SPECS]#
复制代码 但如果用 -O0 就没这个问题,可以编译成功!
为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!为什么?!
|
|