%global target msp430-elf %global gcc_version_base 8.2.0 %global gcc_version %{gcc_version_base}.52 %global ti_version_number 8_2_0_0 %global archive_name msp430-gcc-%{gcc_version}-source-full %global configure_args_common --target=msp430-elf --enable-languages=c,c++ --disable-nls --disable-rpath %global configure_args_binutils %(echo --disable-{sim,gdb,werror}) %global configure_args_gcc --enable-target-optspace --enable-newlib-nano-formatted-io %global configure_args_gdb %(echo --disable-{binutils,gas,ld,gprof,etc} --without-{mpfr,lzma} --with-python=no) %global base_path %(echo $PATH) Name: msp430-elf-toolchain Version: 8.2.0.52 Release: 1 Summary: Mitto Systems Limited / TI developed version of the GNU toolchain for the MSP430 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/%{archive_name}.tar.bz2 Source1: README.fedora BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: expect BuildRequires: flex BuildRequires: bison BuildRequires: texinfo BuildRequires: sed BuildRequires: expat-devel BuildRequires: gmp-devel BuildRequires: libmpc-devel BuildRequires: mpfr-devel BuildRequires: ncurses-devel BuildRequires: zlib-devel BuildRequires: expat-static %description TI has partnered with Mitto Systems Limited 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 within Code Composer Studio. %package -n msp430-elf-gcc Summary: GCC for the MSP430 Group: Development/Debuggers Provides: bundled(gnulib) Obsoletes: msp430-gcc %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-gcc-c++ Summary: GCC for the MSP430 Group: Development/Debuggers %description -n msp430-elf-gcc-c++ This is a cross compiling version of g++, 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} #Copy the README cp -a %{SOURCE1} . # Symlink libgloss / newlib ln -sr %{archive_name}/newlib/libgloss %{archive_name}/gcc ln -sr %{archive_name}/newlib/newlib %{archive_name}/gcc %build mkdir -p %{archive_name}/build cd %{archive_name}/build mkdir {binutils,gcc,gdb} cd binutils ../../binutils/configure --prefix=%{_prefix} --libdir=%{_libdir} %configure_args_common %configure_args_binutils make %{?_smp_mflags} cd - # Symlink binutils so we can build GCC mkdir bin ln -sr binutils/binutils/addr2line bin/msp430-elf-addr2line ln -sr binutils/binutils/ar bin/msp430-elf-ar ln -sr binutils/gas/as-new bin/msp430-elf-as ln -sr binutils/binutils/cxxfilt bin/msp430-elf-cxxfilt ln -sr binutils/binutils/elfedit bin/msp430-elf-elfedit ln -sr binutils/gprof/gprof bin/msp430-elf-gprof ln -sr binutils/ld/ld-new bin/msp430-elf-ld ln -sr binutils/binutils/libtool bin/msp430-elf-libtool ln -sr binutils/binutils/nm-new bin/msp430-elf-nm ln -sr binutils/binutils/objcopy bin/msp430-elf-objcopy ln -sr binutils/binutils/objdump bin/msp430-elf-objdump ln -sr binutils/binutils/ranlib bin/msp430-elf-ranlib ln -sr binutils/binutils/readelf bin/msp430-elf-readelf ln -sr binutils/binutils/size bin/msp430-elf-size ln -sr binutils/binutils/strings bin/msp430-elf-strings ln -sr binutils/binutils/strip-new bin/msp430-elf-strip cd gcc PATH=$PWD/../bin:$PATH ../../gcc/configure --prefix=%{_prefix} --libdir=%{_libdir} %configure_args_common %configure_args_gcc make %{?_smp_mflags} # Reset the path PATH=%{base_path} cd - cd gdb ../../gdb/configure --prefix=%{_prefix} --libdir=%{_libdir} %configure_args_common %configure_args_gdb make %{?_smp_mflags} cd - %install cd %{archive_name}/build cd binutils make install DESTDIR=%{buildroot} cd - cd gcc PATH=$PWD/../bin:$PATH make install DESTDIR=%{buildroot} # Reset the path PATH=%{base_path} cd - cd gdb make install DESTDIR=%{buildroot} cd - # Non-prefixed libcc rm %{buildroot}%{_libdir}/libcc1.* # No libtool archives rm %{buildroot}%{_libexecdir}/gcc/%{target}/%{gcc_version_base}/*.la rm %{buildroot}%{_libdir}/gcc/%{target}/%{gcc_version_base}/plugin/*.la rm %{buildroot}%{_prefix}/%{target}/lib/*.la rm %{buildroot}%{_prefix}/%{target}/lib/430/*.la rm %{buildroot}%{_prefix}/%{target}/lib/large/*.la # Install tools aren't useful for embedded targets rm -r %{buildroot}%{_libdir}/gcc/%{target}/%{gcc_version_base}/install-tools rm -r %{buildroot}%{_libexecdir}/gcc/%{target}/%{gcc_version_base}/install-tools # Clean up unwanted syscalls rm %{buildroot}%{_datarootdir}/gdb/syscalls/aarch64-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/arm-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/amd64-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/freebsd.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/gdb-syscalls.dtd rm %{buildroot}%{_datarootdir}/gdb/syscalls/i386-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/mips-n32-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/mips-n64-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/mips-o32-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/ppc-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/ppc64-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/s390-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/s390x-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/sparc-linux.xml rm %{buildroot}%{_datarootdir}/gdb/syscalls/sparc64-linux.xml # Unnecessary header rm %{buildroot}%{_includedir}/gdb/jit-reader.h # Unwanted python functions rm %{buildroot}%{_prefix}/%{target}/lib/*.py* rm %{buildroot}%{_prefix}/%{target}/lib/430/*.py* rm %{buildroot}%{_prefix}/%{target}/lib/large/*.py* rm -r %{buildroot}%{_datarootdir}/gcc-%{gcc_version_base}/python rm -r %{buildroot}%{_datarootdir}/gdb/system-gdbinit # Duplicate documentation rm %{buildroot}%{_mandir}/man1/* rm %{buildroot}%{_mandir}/man5/* rm %{buildroot}%{_mandir}/man7/* rm %{buildroot}%{_infodir}/* # Don't strip msp430 libraries, crude fix for # https://bugzilla.redhat.com/show_bug.cgi?id=1175942 %define __ar_no_strip %{_builddir}/%{name}/%{archive_name}/build/ar-no-strip cat >%{__ar_no_strip} < - 8.2.0.52-1 - Update to 8.2.0.52 * Mon Jun 25 2018 Brandon Nielsen - 6.0.1.0-1 - Update to 6.0.1.0, the first Mitto Systems Limited release * Sun Oct 29 2017 Brandon Nielsen - 5.1.0.0-1 - Update to 5.1.0.0 - Use %{optflags} without -Werror=format-security * Tue May 2 2017 Brandon Nielsen - 5.0.0.0-1 - Switch to TI / SOMNIUM Technology upstream - Add obsoletes msp430-gcc to msp430-elf-gcc - Don't package duplicate documentation * Thu Dec 1 2016 Brandon Nielsen - 3.5.0.0-3 - Fix remaining .gz manpage compression assumptions * Wed Nov 30 2016 Brandon Nielsen - 3.5.0.0-2 - Don't strip libsupc++.a - Don't assume .gz manpage compression * Wed Jun 29 2016 Brandon Nielsen - 3.5.0.0-1 - Rename mspgcc package to msp430-elf-toolchain - Remove redundant clean section - Remove redundant rm -rf buildroot at beginning of install - Remove unecessary source folders in prep * Fri Jun 24 2016 Brandon Nielsen - 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