📄 gcc-cs-69-e500-dpfp.spec
字号:
%define pfx /opt/freescale/rootfs/%{_target_cpu} %define cs_version 4.1-69# WARNING: This package can NOT be built using the CodeSourcery multilib# toolchain, it will NOT function as expected! This is due to## limitations in the gcc configuration system; the e500v2 cross# toolchain on the build system MUST be configured identically# to the final toolchain (which is this package). StevepSummary : Various compilers (C, C++, Objective-C, Java, ...)Name : gccVersion : 4.1Release : 1License : GPLVendor : FreescalePackager : Steve PapacharalambousGroup : Development/LanguagesSource : %{name}-%{cs_version}.tar.bz2BuildRoot : %{_tmppath}/%{name}Prefix : %{pfx}%Description%{summary}This gcc package is built using the 4.1-69 sources from CodeSourcery.%Prep%setup%Build# This gcc spec file will only build with the single library toolchains built# from CodeSourcery release 69 sources, so prevent this gcc spec file from# building with any other toolchains.if [ "${TOOLCHAIN}" != "tc-fsl-x86lnx-e500-dp-4.1.69-1.i386.rpm" ] && [ "${TOOLCHAIN}" != "tc-fsl-ppclnx-e500-dp-4.1.69-1.ppc.rpm" ]then echo "This package cannot be built with ${TOOLCHAIN}." echo "It can only be built with the following toolchains:" echo "- tc-fsl-x86lnx-e500-dp-4.1.69-1.i386.rpm" echo "- tc-fsl-ppclnx-e500-dp-4.1.69-1.ppc.rpm" exit 1fi# Temporary hack - stevep# For building toolchain components an optimized version of the# target is needed. This should really be defined in the config# area of ltib, and not done in the toolchain spec files.# For now we assume that the optimised target can be derived by# stripping the trailing "-" off the toolchain prefix, but this# will not be true for all cases, eg when using uClibc toolchains.if [ ${TOOLCHAIN_PREFIX} = "arm_v6_vfp_le-" -o -n "$UCLIBC" ]then OPT_CFGHOST=$CFGHOSTelse OPT_CFGHOST=`echo ${TOOLCHAIN_PREFIX} | perl -n -e 's,-$,,;print'`fiCUR_DIR=`/bin/pwd`rm -rf build-gccmkdir build-gcccd build-gccexport CPP=$BUILDCPP AR_FOR_TARGET="${OPT_CFGHOST}-ar" \ NM_FOR_TARGET="${OPT_CFGHOST}-nm" \ OBJDUMP_FOR_TARGET="${OPT_CFGHOST}-objdump" \ STRIP_FOR_TARGET="${OPT_CFGHOST}-strip" \ CC_FOR_TARGET="${OPT_CFGHOST}-gcc"\ LD_FOR_TARGET="${OPT_CFGHOST}-ld" \ CC_FOR_BUILD="${BUILDCC}" \ ${RPM_BUILD_DIR}/gcc-%{version}/configure \ --host=${OPT_CFGHOST} --build=%{_build} --target=${OPT_CFGHOST} \ --prefix=%{_prefix}/local --enable-shared --enable-threads \ --disable-libmudflap --disable-libssp --disable-libgomp \ --disable-libstdcxx-pch --with-long-double-128 \ --with-gnu-as --with-gnu-ld --enable-languages=c,c++ \ --enable-symvers=gnu --enable-__cxa_atexit --disable-nls \ --disable-multilib --with-cpu=8548 --enable-e500_double# Hack to get documentation to build. For some reason in the file# build-gcc1/gcc/doc/invoke.texi @value{srcdir} is not getting corectly# evaluated. Connected with the version of etex. Stevep# The error is:# [snip]# /home/stevep/work/ltib/rpm/BUILD/gcc-4.1/gcc/doc/invoke.texi:1069:# I can't find file `'.# [/snip]perl -pi.orig -e 's,^\@include\s+\@value{srcdir},\@include '${RPM_BUILD_DIR}'/gcc-'%{version}'/gcc,;' ${RPM_BUILD_DIR}/gcc-%{version}/gcc/doc/invoke.texi# Need to remove references to /usr/local/lib in ltconfig to prevent libtool# looking in /usr/local/lib during the build and picking up wrong libraries# which cause the build to fail. This is for host build machines that have# a native compiler installed in /usr/local. - Stevepperl -pi.orig -e 's,\s+\/usr\/local\/lib\",\",; s,\s+\/usr\/local\/lib\,,\,,; s,\/usr\/local\/lib\s+,,; s,\s+\/usr\/local\/lib\s+, ,; s,\s+\/usr\/local\/lib\$\{libsuff\}\",\",;' ../ltconfigCFLAGS="-O -mcpu=8548 -mspe=yes -mabi=spe -mfloat-gprs=double" \AR_FOR_TARGET="${OPT_CFGHOST}-ar" \NM_FOR_TARGET="${OPT_CFGHOST}-nm" \OBJDUMP_FOR_TARGET="${OPT_CFGHOST}-objdump" \STRIP_FOR_TARGET="${OPT_CFGHOST}-strip" \CC_FOR_TARGET="${OPT_CFGHOST}-gcc" \LD_FOR_TARGET="${OPT_CFGHOST}-ar" \CC_FOR_BUILD="${BUILDCC}" \make -j1%Installrm -rf $RPM_BUILD_ROOTif [ ${TOOLCHAIN_PREFIX} = "arm_v6_vfp_le-" -o -n "$UCLIBC" ]then OPT_CFGHOST=$CFGHOSTelse OPT_CFGHOST=`echo ${TOOLCHAIN_PREFIX} | perl -n -e 's,-$,,;print'`fiif [ "$TOOLCHAIN_TYPE" = "64" ]then SLIBS="lib64"else SLIBS="lib"fi# Copy the crt files from the toolchain area to rootfs/usr/local/lib# These are the crt files built by glibc (I think - stevep).CRT_FILES_DIR="`dirname \`${TOOLCHAIN_PREFIX}gcc ${TOOLCHAIN_CFLAGS} -print-file-name=crti.o\``"X_DIR=`echo ${OPT_CFGHOST} | sed -e 's,-$,,'`mkdir -p ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/local/lib/{,gcc/${X_DIR}/%{version}}cp ${CRT_FILES_DIR}/*crt*.o ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/local/libcp ${CRT_FILES_DIR}/*crt*.o ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/local/lib/gcc/${X_DIR}/%{version}# Temporary hack: Don't build lilbiberty pdf.# This is to prevent the following error occuring on some build systems:# [snip]# Doing pdf in powerpc-linux-gnu/libiberty# make[3]: Entering directory# `/home/stevep/work/ltib/rpm/BUILD/gcc-4.1/build-gcc/powerpc-linux-gnu/libiberty'# texi2pdf ../../../libiberty/libiberty.texi# pdfetex: error while loading shared libraries:# /home/stevep/work/ltib/rpm/BUILD/gcc-4.1/build-gcc/./gcc/libgcc_s.so.1: ELF# file data encoding not little-endian# /opt/freescale/ltib/usr/bin/texi2dvi: texinfo.tex appears to be broken,# quitting.# make[3]: *** [libiberty.pdf] Error 1# make[3]: Leaving directory# `/home/stevep/work/ltib/rpm/BUILD/gcc-4.1/build-gcc/powerpc-linux-gnu/libiberty'# make[2]: *** [pdf-target-libiberty] Error 1# make[2]: Leaving directory# `/home/stevep/work/ltib/rpm/BUILD/gcc-4.1/build-gcc'# make[1]: *** [do-install-pdf] Error 2# make[1]: Leaving directory# `/home/stevep/work/ltib/rpm/BUILD/gcc-4.1/build-gcc'# make: *** [install] Error 2# [/snip]perl -pi.orig -e 's,^LIBIBERTY_PDFFILES\s+=\s+libiberty.pdf,LIBIBERTY_PDFFILES =,;' build-gcc/powerpc-linux-gnuspe/libiberty/Makefilecd build-gccCC_FOR_BUILD="${BUILDCC}" \AR_FOR_TARGET="${OPT_CFGHOST}-ar" \NM_FOR_TARGET="${OPT_CFGHOST}-nm" \OBJDUMP_FOR_TARGET="${OPT_CFGHOST}-objdump" \STRIP_FOR_TARGET="${OPT_CFGHOST}-strip" \CC_FOR_TARGET="${OPT_CFGHOST}-gcc" \LD_FOR_TARGET="${OPT_CFGHOST}-ld" \CFLAGS="-O -mcpu=8548 -mspe=yes -mabi=spe -mfloat-gprs=double" \make -j1 DESTDIR=${RPM_BUILD_ROOT}/%{pfx} install# Remove the c++ pre-compiled header files.X_DIR=`echo ${TOOLCHAIN_PREFIX} | sed -e 's,-$,,'`rm -f ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/local/include/c++/4.1.2/${X_DIR}/bits/stdc++.h.gch/O[02]g# Remove libtool .la filesfind ${RPM_BUILD_ROOT}/%{pfx} -name \*.la -exec rm {} \;# add a symlink for ccln -s gcc ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/local/bin/cc# Copy libc_nonshared.a to /usr/lib on the rootfs as this is needed by gcc# during the linking process. This is a hack as really the selection of gccu# should force the selection of all the static libs from glibc to the rootfs,# but this causes some packages not to build due to symbol version issues# (siglongjmp for example) with libc.a. For some reason if libc.a is on the# rootfs it seems to be used for linking which is possibly a problem with the# spoofing.mkdir -p ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/local/libcp `${TOOLCHAIN_PREFIX}gcc ${TOOLCHAIN_CFLAGS} -print-file-name=libc_nonshared.a` ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/local/lib%Cleanrm -rf ${RPM_BUILD_ROOT}%Files%defattr(-,root,root)%{pfx}/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -