%global target msp430-elf %global gcc_version 4.9.1 %global ti_version_number 3_05_00_00 Name: mspgcc Version: 3.5.0.0 Release: 3 Summary: Red Hat / TI developed version of the GNU toolchain for the MSP430 Group: Development/Debuggers License: GPLv2 URL: http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/%{ti_version_number}/index_FDS.html Source0: http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/%{ti_version_number}/exports/msp430-gcc-source.tar.bz2 #Dynamically link expat Patch0: dynamic_expat.patch Patch1: libgloss_destdir.patch Patch2: gnu++98_filter.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: expect BuildRequires: flex BuildRequires: bison BuildRequires: texinfo BuildRequires: expat-devel BuildRequires: ncurses-devel %description TI has partnered with Red Hat to bring you a new and fully supported open source compiler. This free GCC compiler has no code size limit. In addition, this compiler can be used standalone or selected within Code Composer 6.0 (beta). %package -n msp430-elf-gcc Summary: GCC for the MSP430 Group: Development/Debuggers %description -n msp430-elf-gcc This is a cross compiling version of GNU GCC, which can be used to compile for the %{target} platform, instead of for the native %{_arch} platform. %package -n msp430-elf-gdb Summary: GDB for the MSP430 Group: Development/Debuggers %description -n msp430-elf-gdb This is a version of GDB, the GNU Project debugger, for (remote) debugging %{target} binaries. GDB allows you to see and modify what is going on inside another program while it is executing. %package -n msp430-elf-binutils Summary: GCC for the MSP430 Group: Development/Debuggers %description -n msp430-elf-binutils This is a Cross Compiling version of GNU binutils, which can be used to assemble and link binaries for the %{target} platform, instead of for the native %{_arch} platform. %prep %setup -q -c -n %{name} pushd sources %patch0 -p1 %patch1 -p1 %patch2 -p1 popd %build mkdir -p build cd build #Force gnu89 and gnu++98 for compiling old GCC version with GCC 5, and GCC 6, #disable rpaths to keep rpmbuild happy (still required even with #dynamic_expat.patch) CFLAGS="$CFLAGS -std=gnu89" CXXFLAGS="$CXXFLAGS -std=gnu++98" \ ../sources/tools/configure \ --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \ --infodir=%{_infodir} --target=%{target} --enable-languages=c,c++ \ --disable-itcl --disable-tk --disable-tcl --disable-libgui \ --disable-gdbtk --disable-rpath make %install rm -rf %{buildroot} cd build make install DESTDIR=%{buildroot} # we don't want these as this is a cross-compiler rm -rf %{buildroot}%{_infodir} rm -f %{buildroot}%{_libdir}/libiberty.a # Don't ship the static library file: rm -f %{buildroot}%{_libdir}/libmsp430-sim.a # Dejagnu can be installed from elsewhere rm -f %{buildroot}/usr/include/dejagnu.h rm -rf %{buildroot}/usr/share/dejagnu # Clean up unwanted syscalls rm -f %{buildroot}/usr/share/gdb/syscalls/arm-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/amd64-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/gdb-syscalls.dtd rm -f %{buildroot}/usr/share/gdb/syscalls/i386-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/mips-n32-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/mips-n64-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/mips-o32-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/ppc-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/ppc64-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/sparc-linux.xml rm -f %{buildroot}/usr/share/gdb/syscalls/sparc64-linux.xml # Unnecessary header rm -f %{buildroot}/usr/include/gdb/jit-reader.h # Unwanted python functions rm -rf %{buildroot}/usr/share/gcc-%{gcc_version}/python rm -rf %{buildroot}/usr/share/gdb/python rm -rf %{buildroot}/usr/share/gdb/system-gdbinit # Duplicate messages rm -rf %{buildroot}/usr/share/locale/*/LC_MESSAGES # Unwanted documentation rm -f %{buildroot}/usr/share/man/man1/%{target}-dlltool.1 rm -f %{buildroot}/usr/share/man/man1/%{target}-nlmconv.1 rm -f %{buildroot}/usr/share/man/man1/%{target}-windmc.1 rm -f %{buildroot}/usr/share/man/man1/%{target}-windres.1 rm -f %{buildroot}/usr/share/man/man1/gdb.1 rm -f %{buildroot}/usr/share/man/man1/gdbserver.1 rm -f %{buildroot}/usr/share/man/man5/gdbinit.5 rm -f %{buildroot}/usr/share/man/man7/fsf-funding.7 rm -f %{buildroot}/usr/share/man/man7/gfdl.7 rm -f %{buildroot}/usr/share/man/man7/gpl.7 # Prevent 'Unhandled relocation' issues chmod -x %{buildroot}%{_libdir}/gcc/%{target}/%{gcc_version}/*.o # Don't strip msp430 libraries %define __ar_no_strip %{_builddir}/%{name}/build/ar-no-strip cat >%{__ar_no_strip} < - 3.5.0.0-3 - Explicitly require gcc / gcc-c++ as per Fedora packaging guidelines * Fri Jun 10 2016 Brandon Nielsen - 3.5.0.0-2 - Force -std=gnu++98 for building on Fedora 24 - Add gnu++98_filter.patch to ensure libstdc++-v3/src/c++11 CXXFLAGS are used - Fix license * Mon Oct 26 2015 Brandon Nielsen - 3.5.0.0-1 - Update to 3.5.0.0 * Fri Aug 14 2015 Brandon Nielsen - 3.4.5.1-1 - Update to 3.4.5.1 * Tue Jun 09 2015 Brandon Nielsen - 3.3.4-2 - Add patch to allow use of provided install macro * Fri May 29 2015 Brandon Nielsen - 3.3.4-1 - Update to 3.3.4 - Force gnu89 for compiling on Fedora 22 with GCC 5 * Sun Feb 15 2015 Brandon Nielsen - 3.2.3-1 - Update to 3.2.3 * Mon Feb 09 2015 Brandon Nielsen - 3.2.2-2 - Workaround for strip issue * Tue Jan 20 2015 Brandon Nielsen - 3.2.2-1 - Initial release