EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

compilation of dsPIC c30 compiler sources

Started by Wojciech Zabolotny September 28, 2004
Hi All,

I've tried to compile the sources of the Microchip's C compiler for dsPIC:
http://ww1.microchip.com/downloads/en/DeviceDoc/mplabc30_v1_20_02.tar.gz

Unfortunately after:
 ./configure --target=pic30 --enable-languages="c"
 make
I get the following error message:

cppinit.c: In function `path_include':
cppinit.c:191: error: assignment of read-only location
make[1]: *** [cppinit.o] Error 1
make[1]: Leaving directory `/tmp/gcc-3.3/gcc-3.3/gcc'
make: *** [all-gcc] Error 2

Has anybody succeeded to compile these sources?

BTW. What is the legal status of this compiler? The sources are
available and published under the GPL, while binaries are
available only as 60-day trial demo. How does it comply with the GPL?
Are the binaries compiled from other sources? But the version number is
the same for both the sources (link above) and the binaries:
http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB%20C30%20v1.20.02.exe

-- 
TIA & Regards,
Wojtek Zabolotny
wzab@ise.pw.edu.pl


In article <Pine.SOL.4.33.0409282335340.17422-100000@elektron.elka.pw.edu.pl>, Wojciech Zabolotny wrote:
> Has anybody succeeded to compile these sources?
I've successfully compiled it (perhaps because I was using an older version of GCC than you are -- 2.96). However, I have not sucessfully built a dsPIC executable with it. The link phase fails looking for __reset. I suspect that this is startup code which is not included in the open source portion of the compiler, but I did not spend much time on it. Since Microchip is selling the compiler, I would think it's very unlikely that the open source package includes everything you need to build a useful environment. I doubt the GPL can mandate the source distribution of things written from scratch by Microchip, such as libraries or an assembly language optimizer. The code on the web site probably just complies with what the GPL requires. -- John W. Temples, III
John Temples wrote:
> Wojciech Zabolotny wrote: > >> Has anybody succeeded to compile these sources? > > I've successfully compiled it (perhaps because I was using an > older version of GCC than you are -- 2.96). However, I have not > sucessfully built a dsPIC executable with it. The link phase > fails looking for __reset. I suspect that this is startup code > which is not included in the open source portion of the compiler, > but I did not spend much time on it. > > Since Microchip is selling the compiler, I would think it's very > unlikely that the open source package includes everything you > need to build a useful environment. I doubt the GPL can mandate > the source distribution of things written from scratch by > Microchip, such as libraries or an assembly language optimizer. > The code on the web site probably just complies with what the > GPL requires.
They are entitled to sell it, and even to charge their costs for source distribution, if they have used GPLd code in the package. What they are not entitled to do is to conceal any portion of the modified source, or source that encapsulates the GPLd code. An exception would be an IDE that simply generates calls to the compiler, because that does not incorporate the GPLd code. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
"John Temples" <usenet@xargs-spam.com> wrote in message
news:slrncljp6m.94h.usenet@jwt.xargs.com...
> In article
<Pine.SOL.4.33.0409282335340.17422-100000@elektron.elka.pw.edu.pl>, Wojciech Zabolotny wrote:
> > Has anybody succeeded to compile these sources? > > I've successfully compiled it (perhaps because I was using an older > version of GCC than you are -- 2.96). However, I have not sucessfully > built a dsPIC executable with it. The link phase fails looking for > __reset. I suspect that this is startup code which is not included in > the open source portion of the compiler, but I did not spend much time > on it. > > Since Microchip is selling the compiler, I would think it's very > unlikely that the open source package includes everything you need to > build a useful environment. I doubt the GPL can mandate the source > distribution of things written from scratch by Microchip, such as > libraries or an assembly language optimizer. The code on the web site > probably just complies with what the GPL requires. >
Any code they wrote that is directly linked to gpl'ed code also has to be gpl'ed, while code that is not linked to gpl'ed code is unaffected. This means that anything directly connected to the compiler (such as an assembly language optomizer built as part of the compiler) would have to be gpl'ed, while seperate programs (an IDE, or a stand-alone format converter) and target-code libraries are unaffected. It's a strange idea for a chip company to be selling a gcc port. Chip companies often make, sponser or encourage gcc ports, but they are freely available without any of this "comply with the letter of the GPL without complying with the spirit" nonsense - a gcc port gives customers a readily available toolchain and thus encourages sales of the chip. Charging for gcc binaries in a nice box, with a manual, simple installation program, support contract, etc., is fine of course.
> -- > John W. Temples, III
> > > Has anybody succeeded to compile these sources?
Yes. Yessss!!! I did!!! (well, almost...) With SuSE linux 9.1, gcc 3.3.3, a bit of patience, I managed to compile run everything (even the simulator!!). The steps were: 1) download source for assembler (gas). 2) Unzip, ./configure --target=pic30 && make && make install 3) download source for gcc. 4) Unzip, ./configure --target=pic30 && make && make install 5) Some executables are left out of installation -- put them in place: # cp gcc-3.3/gcc-3.3/gcc/pic30-* /usr/local/bin/ 6) Now, the tricky part: -install the Windows 60-days demo somewhere -take the whole "....\include" directory and copy it under /usr/local/pic30/include - copy all files under ".....\lib\" on /usr/local/pic30/lib That's it!! Now you can copy the examples and build them. I also managed to run sim30.exe under Wine -- it worked (with some Wine warning, but nothing important). As a side note, I didn't even had access to a Windows machine. The installer for the demo worked fine in Wine. On the Windows demo, you can even find the library sources.
> > It's a strange idea for a chip company to be selling a gcc port. Chip > companies often make, sponser or encourage gcc ports, but they are freely > available without any of this "comply with the letter of the GPL without > complying with the spirit" nonsense - a gcc port gives customers a readily > available toolchain and thus encourages sales of the chip. Charging for gcc > binaries in a nice box, with a manual, simple installation program, support > contract, etc., is fine of course.
What they seem to do is, really, charging for libraries. Note that libraries are statically linked with the executable you build, so you probably need a license to distribute it. If someone was willing to wrote a clean room version of the libraries (or, at least, the bare minimum to build a working executable) well, we'd have a perfectly legal GPL compiler...

The 2024 Embedded Online Conference