SDCC version info

From RepRap
Revision as of 06:22, 18 July 2015 by Glenn (talk | contribs) (Glenn moved page SDCCVersionInfo to SDCC version info)
Jump to: navigation, search

SDCC Version Info

The Initial Problem

The current Makefile in obtains the sdcc sources using:

CVSROOT=:pserver:[email protected]:/cvsroot/sdcc cvs co -D 20051210 sdcc

Notice the specific date in there! This results in downloading a very very old version of sdcc. This code is so old it cannot be compiled by a modern GCC compiler. This issue was fixed long ago by the sdcc developers, and is not their fault. It is our fault, for choosing such an old version of their code.

The Quick Fix

A one line edit can "fix" the compilation issue. The patch is:

diff -u -r1.12 newcmdcl.h --- newcmdcl.h 27 Jul 2004 13:42:52 -0000 1.12 +++ newcmdcl.h 22 May 2007 19:49:43 -0000 @@ -124,7 +124,7 @@ cl_console(int portnumber, class cl_app *the_app); #endif virtual ~cl_console(void); - virtual class cl_console *cl_console::clone_for_exec(char *fin); + virtual class cl_console *clone_for_exec(char *fin); virtual int init(void); virtual bool accept_last(void);

In other words, change that one line by removing the unnecessary cl_console:: and all should be well. Sort of... you now can build and run a very old sdcc!

Update: The Makefile has now been enhanced to automatically make this one line edit for you, so just typing make now works once again.

-- Main.JonathanMarsden - 04 Jun 2007

SDCC Version Requirements for RepRap

Per AdrianBowyer in Main.RepRapLinuxSoftware the RepRap project needs to use an sdcc version newer than 4590. You might think that editing the Makefile to remove the -D 20051210 would do it, retrieving the newest sdcc from CVS. Not so: the sdcc project migrated to using svn, so using CVS even with no date specified using -D still gets you an old version. Just not quite so old!

The Medium Term Solution

Editing firmware/Makefile to use Subversion rather than CVS will cause the downloading and compilation of a newer version of sdcc. To do this, the patch is something like:

Index: Makefile '''<tt>===============================================================</tt>''' --- Makefile (revision 605) +++ Makefile (working copy) @@ -47,7 +47,8 @@ $(SDCCBASE)/share/sdcc/include/pic: if [ ! -d sdcc-build ]; then mkdir sdcc-build; fi cd sdcc-build && \ - CVSROOT=:pserver:[email protected]:/cvsroot/sdcc cvs co -D 20051210 sdcc && \ +# CVSROOT=:pserver:[email protected]:/cvsroot/sdcc cvs co -D 20051210 sdcc && \ + svn co sdcc && \ cd sdcc && \ ./configure --prefix=$(SDCCBASE) && \ make clean && \

In other words, comment out the line containing cvs and replace it with the one starting with svn instead.

Sadly, while this gets me a nice shiny new version of SDCC, so far at least the resulting sdcc compiler and toolchain will not actually build the RepRap PIC firmware!

Long Term Approach

Once we can build and use a current version of SDCC successfully, we can consider packaging it as a .deb for easier installation on both Debian and Ubuntu Linux systems. The current Debian sdcc package is unmaintained, so it's even possible that we (I) "adopt" it and officially become the Debian sdcc maintainer at some future time.

-- Main.JonathanMarsden - 22 May 2007