diff --git a/pcc-090808-optflags.patch b/pcc-090808-optflags.patch new file mode 100644 index 0000000..3d45b96 --- /dev/null +++ b/pcc-090808-optflags.patch @@ -0,0 +1,12 @@ +diff -up pcc-090808/pcc-libs/csu/linux/Makefile.orig pcc-090808/pcc-libs/csu/linux/Makefile +--- pcc-090808/pcc-libs/csu/linux/Makefile.orig 2009-01-23 09:10:09.000000000 +0200 ++++ pcc-090808/pcc-libs/csu/linux/Makefile 2009-08-08 13:42:43.616850463 +0300 +@@ -25,7 +25,7 @@ crtn.o: $(MACH)/crtn.c + $(CC) -O $(CFLAGS) -c -o $@ $< + + crtbegin.o: crtbegin.c +- $(CC) -O $(CFLAGS) -c -o $@ $< ++ $(CC) -O $(CFLAGS_NODEBUG) -c -o $@ $< + + crtend.o: crtend.c + $(CC) -O $(CFLAGS) -c -o $@ $< diff --git a/pcc.spec b/pcc.spec new file mode 100644 index 0000000..b2c7c54 --- /dev/null +++ b/pcc.spec @@ -0,0 +1,103 @@ +%global snapshot 090813 + +Name: pcc +Version: 0.9.9 +Release: 0.3.%{snapshot}cvs%{?dist} +Summary: The Portable C Compiler +Group: Development/Languages +License: BSD and ISC +URL: http://pcc.ludd.ltu.se/ +Source0: http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-%{snapshot}.tgz +Source1: http://pcc.ludd.ltu.se/ftp/pub/pcc-libs/pcc-libs-%{snapshot}.tgz +# Patch to disable the use of -g on pcc-libs-090805/csu/linux/crtbegin.c which is partly assembler code +Patch0: pcc-090808-optflags.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# Currently only x86 supported both in ppc and ppc-libs +ExclusiveArch: %{ix86} +BuildRequires: bison flex +Requires: glibc-devel + +%description +The compiler is based on the original Portable C Compiler by Stephen C. +Johnson, written in the late 70's. Even though much of the compiler has been +rewritten, some of the basics still remain. +PCC debuted in Unix Version 7 and replaced the DMR compiler (Dennis Ritchie's +original C compiler) in both System V and the BSD 4.x releases. Some history +about pcc is in the A History of UNIX before Berkeley: UNIX Evolution: +1975-1984 and in the Evolution of C. + +About 50% of the frontend code and 80% of the backend code has been rewritten. +Most stuff is written by Anders Magnusson, with the exception of the data-flow +analysis part and the SSA conversion code which is written by Peter A Jonsson, +and the Mips port that were written as part of a project by undergraduate +students at LuleƄ University of Technology (LTU). + +%prep +%setup -q -n pcc-%{snapshot} -a1 +# Get rid of the default optimization flag +find . -name Makefile.in |xargs sed -i 's| -O | |g' +# Rename the libs directory for the patch to work +mv pcc-libs-%{snapshot} pcc-libs +# Apply patch +%patch0 -p1 + + +%build +export CFLAGS_NODEBUG=`echo %{optflags}|sed "s|-g||g"` +# First, build the library. +cd pcc-libs +%configure +make CFLAGS="-I%{_arch} -I. %{optflags}" CFLAGS_NODEBUG="-I%{_arch} -I. $CFLAGS_NODEBUG" %{?_smp_mflags} +cd .. +# Then, build the compiler +%configure --with-assembler=%{_bindir}/as --with-linker=%{_bindir}/ld \ + --with-libdir=%{_libdir} --with-incdir=%{_includedir} +make %{?_smp_mflags} + + +%install +rm -rf %{buildroot} +# Install the libraries +make -C pcc-libs install DESTDIR=%{buildroot} strip=no +# Install the compiler +make install DESTDIR=%{buildroot} strip=no +# Fix man file perms +chmod 644 %{buildroot}%{_mandir}/man1/* +# Install symlink +ln -s %{_target_platform}-pcc %{buildroot}%{_bindir}/pcc +# Directory for pcc-specific include files +mkdir -p %{buildroot}%{_includedir}/pcc + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%{_bindir}/pcc +%{_bindir}/%{_target_platform}-pcc +%{_libdir}/pcc/ +%{_includedir}/pcc/ +%{_libexecdir}/%{_target_platform}-cpp +%{_libexecdir}/%{_target_platform}-ccom +%{_mandir}/man1/%{_target_platform}-ccom.1.* +%{_mandir}/man1/%{_target_platform}-cpp.1.* +%{_mandir}/man1/%{_target_platform}-pcc.1.* + +%changelog +* Thu Aug 13 2009 Jussi Lehtola - 0.9.9-0.3.090813cvs +- Removed unneeded BR: byacc. +- Update to 20090813. + +* Tue Aug 11 2009 Jussi Lehtola - 0.9.9-0.2.090811cvs +- Spec file cleanups. +- Update to 20090811. + +* Sun Aug 09 2009 Jussi Lehtola - 0.9.9-0.2.090809cvs +- Changed --with-libdir to %%{_libdir} to make pcc use the glibc version of crt0.o by suggestion of upstream. +- Update to 20090809. + +* Sat Aug 08 2009 Jussi Lehtola - 0.9.9-0.1.090808cvs +- First release. diff --git a/sources b/sources index e69de29..8cafafa 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +1ab38c96c30b04f97c8de5f113e7fb8f pcc-090813.tgz +b339afe4381e344011f9009c52458f8d pcc-libs-090813.tgz