Microchip Xc8 Xc16 Xc32 Compilers V.1.33.zip
Hanna Code (link) error: ID is not numeric. If you miss the latter, the compilation will abort with a nasty 'unable to detect exception model' error. The -with-sysroot option tells the build system where it can find the target libraries so it can build it's own. If you fail to set this, you will get a 'Link tests are not allowed after GCCNOEXECUTABLES' error.
Microchip XC8 XC16 XC32 compilers v.1.33.zip fast download, free download via HTTP available as well. Uploaded two days ago. File Description.
If you are lucky running this, you will get the compiler done, and it will get quite far into compiling it's standard libraries for the target, but will eventually fail. The failure which happened to hit me is that within the Microchip libraries (!, that 1.5Gig stuff you copied in from the IDE) in a header (sys/posix.h) there is a reference to unistd.h at a not even existing path! This left me somewhat confused. How Microchip was supposed to build this if it fails on their own library? Anyway I patched this problem (there is an unistd.h within there which I used for the purpose), but the compile still failed later, now again with a 'Link tests are not allowed after GCCNOEXECUTABLES' error.
I stopped at this point: for one, it already compiled the compiler, for two, it already took more than a hour on a four core machine to get to the error. Experiences with the result? See some chapters below! Bye-bye, license check So how to fulfil our original purpose and make the compiler actually optimizing?
The clue lies in the messages it barfs out telling you to register it. It is a nice string to search for, so basically I did a grep -r 'compiler license'./ on the gcc source directory. For this version I got this finding two sources, one in gcc/config/pic30, the other in gcc/config/pic32. Then I did search the (huge!!! The saying about manageable module size was really some 500, but LINES, not KILOBYTES, dammit!) source files for the string.
Currently the problem is easily fixable: you will see there is a nice variable with a long name there holding which license you have, and with some search you will also get the constants to use on it. The simplest thing is to just slap the constant for the PRO license in each occurrence of assignments to this variable in both source files (replacing any FREE license constants, -1 or zero). Compile, and smile: it works and optimizes happily! Experiences with the result, how to actually use it When you get the compiler binary, you may need to take it away and maybe use it with the IDE. But since this was a Cygwin compile for a Cygwin host, no matter that the resulting gcc is a bloated monster (having everything static compiled within), it still needs some Cygwin dll's.
To find out which, you can do cygcheck cc1.exe and so on on all the necessary executables. This will tell which dll's they use, so you can copy them off the Cygwin installation to a place where the binaries can find them without running the exe's from within Cygwin (dropping them next to the binary works). It is not ideal, but at us so far only cc1.exe was replaced (old non-optimizing cc1.exe was archived, just in case) within the Microchip IDE, and it seems to work all right for C programs (the project does not use C, so we didn't try that). Probably later we will experiment some more, but for now it works, solved the immediate problem (binary barely fitting in the PIC32 micro). At least this is a proof of concept that it is indeed doable. Some words on GPL, and why this is scary The General Public License's intentions are to (if necessary, forcibly) keep software being publicly accessible and develop-able, to disallow taking someone's work and to lock it up probably even slapping some software patents on it with a probable intention of 'hijacking' it. A GPL-ed software is free, end of story.
GPL technically forces people to at least publish the source of their work with the allowance of doing whatever one wants with it (as long as the resulting work is kept released under GPL). In Microchip's case, it is technically true. There is a source, it is compilable, and apparently it gives the compiler all fine. So technically, by the words of law, they did not violate GPL with this thing. The problem is there that GPL does not state (or not clearly enough) that one also needs to provide the informations necessary to actually build the software. If I go far with this, I may well end up developing a software from a GPL-ed one for which, inside the company, we have, say, an A/4 sized build instructions list with a good set of arcane flags, switches, maybe even codes.
The source is there, now go, compile it. That's not our problem. (The Microchip source has some main build script, but partly seems to be completely unrelated building several other packages: to actually build this thing, one has to figure it all on his own wading through the Internet for days) So although Microchip does not actually violate GPL here, I really think it goes against it's intentions. They can since the PIC32 is not a so common architecture that anyone will pick their compiler up, and keep up with them releasing 'proper' truly GPL conforming sources and maybe binaries. Well, if anything else, I would be interested to hear your opinions, be it related to GPL or if you found something out about the compilation process itself! External links. This thing makes your Windows box (somewhat) feel like a Linux box.
How Dwarf2 exception handling works?. Compilers, IDE-s, and tools for PICs. I believe Microchip is in violation of the provision that: GPL2: The source code for a work means the preferred form of the work for making modifications to it.
For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. GPL3: The 'Corresponding Source' for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. Last time I tried building their compiler, they did not have scripts that would allow you to build the exact exe's they provided. Hello again, all of the sudden I wanted to check the building flags xc32 was compiled with and ran./bin/xc32-g -v. Suddenly there appeared a SHA-256 string which differs from the ones in the gcc/gcc/config/mchp-cci/mchpsha.h of the sources. I could finally find this string in the above mentioned binaries cc1, cc1plus and lto1 in bin/bin/gcc/pic32mx/4.8.3/.
Changed it to the one of my xclm which returns 6 from the main function and voila, looks like optimization is working. Thank you very much for the initial article and the comments! Hello, I tried to unlock the optimization for v1.44 through the dummy xclm. In the sources I could find the SHA-256 value for the xclm file in gcc/gcc/config/mchp-cci/mchpsha.h. But afterwards I could not find neither of the three (Win, Linux, OS X) SHA-256 strings, or substrings of them, in the above mentioned binaries.
I searched for it with an OS X app called 'iHex' and with 'strings' in the terminal, both methods didn't hit anything. I'am curious if they changed the validation of the xclm or if i'am doing something completely wrong.
A comment below states that it is still working with v1.42. I am following your directions, trying to recompile the latest 1.4 xc30 compiler. However, I get an error at the PPL stage: finfo(const T&, bool open) ^ make6:. pplcRationalBox.lo Error 1 In looking on google, I tried adding -fpermissive to the compiler flags, and it got further along, but still bonked with the same error.
I'm on Ubuntu 14.04. Teknomw3 2.7.1.2. Any idea what I'm doing wrong? Are there other options? Perhaps a pre-patched xc32 and xc16 that can be downloaded w/out the license check?
Your guide is great! Hi guys, Thanks for this useful article. I had the same problem and was looking for a simple solution.
I'm a hobbyist with a really limited budget. First I installed MPLAB and the compiler every two months on a different machine. But one day I had no more unused equipment left. Later I tried to write my own xclm script. Unfortunately it didn't work (SHA-1 test).
Well, I found a really simple solution: I'm using a Unix system (Mac OS X) and discovered that the xclm hostid is identical to the en0 ether address (Primary Ethernet MAC). It's easy to temporarily change the primary network MAC on a Unix / Linux system.
You only have to run the following command: $ sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx where xxxxxxxxxxxx corresponds to any arbitrary host ID. Now you can download a new demo license with this fictitious ID from Microchip. Install it, and your compiler will work for two more months in PRO mode.
I used the same microchip account several times without any issues. Beating the Devil at his own game, This works for the 18c, and the 30c and am checking it out for the xc32 simply make a basic virtual machine with xp and nothing else, make a copy of it to another directory for the reload, then set up the microchip stuff when the 60 day trial runs out, reload the virtual machine to another directory and reinstall Wala another 60 day trial, erase the old virtual file, and now to the 32 bit stuff, i will use another email addy and then change the mac address, it should work fine. I do tinker with Atmel stuff and will likely embrace it more. But PIC is, despite the spawn of. who manage the company, easy kit and well designed. There may be a ray of hope in sdcc which is promising more comprehensive coverage.
Of course what we really need is a wealthy VC (who wasn't around when his parents got married) and would help pay for ARM core licenses to build proper 32-bit MIPS MCUs from the FSF-ground up. I'm looking ints Atmel as an alternative. The nice thing is that the ARM cores are licensable and it's really pennies to a wealthy ex-Chief Architect of some now-marginalised over-capitalised under-ip-resourced pirate of other people's ideas. Surely an obscenely wealthy human being would take up the chance to allow the IOT to be truly participated in by the very people it will ultimately milk for profit? Or has farming become a thing of the past.
Hope you could get it working then! I mailed you a third method of getting this going, if you didn't feel up to either. For the legality as long as you only mess with the GCC part, it should be in the green by the power of GPL (if anyone says otherwise, we can still knock on FSF's door for some help, likely there are a 'few' people not quite pleased with how someone is abusing their work. GPL.IS.
a license, giving us a product not for money, but for the requirement of contribution, so essentially Microchip here simply decided to not 'pay' for a service they 'purchased'). Why Microchip is doing this? Likely they save a few cents on parts by this, which makes their IC's a bit more appealing for large firms ordering those by the hundred thousands (where the gain on IC purchases offset the cost of the compiler). Atmel on the other hand gives away their compilers for free, likely spreading the development costs over their part prices, which is better for the hobbyist and small firms working with batches of a few hundreds or thousands.
Microchip certainly abuses GCC by this practice, but for other products (such as XC8 or XC16), I would say, vote by foot, don't whine. Buy an Arduino for your hobbyist gear;). Thanks for this article. I'm a hobbyist, I can't afford (nor would pay if I could I suspect) the PRO license since this amounts to extortion when applied to a GPL product. They currently allow a 60-day PRO evaluation and the host id appears to be the MAC address of the primary ethernet card. (I don't know what it would be if there isn't a network card installed).
That might be a starting point to get a fair go. I've tried to get around licensing it by using a mips-none-elf-gcc cross-compiler as a post-build step to replace the previously generated.o files that I want to properly optimised.
Microchip Xc8/xc16/xc32 破解
The problem is that the object file output doesn't link (File format error) with xc32-ld or xc32-gcc. I don't see how unlocking something that is meant to be freely available is in any way a crime. Only attempting to profit from it by reselling it perhaps. Microchip surely do very well from fab sales, I fail to see why they won't make the PRO compiler free.
Also I've used the MPLABX IDE for a few months and I'm not impressed. (PICKit3 has many problems not least inherent flakiness) The whole thing is overcomplicated and it runs under Java so a huge VM (5.2GB right now) is created to run code that would compile to - at most - a few tens of megs of native code. Command-line tools as an option? I hope the fight continues.Kilo.: I didn't try, and no-one reported back experiences on those.
It might work. Note that however that doing this with those compilers is.illegal.! I am keeping this post since in the case of GCC, Microchip even if by the legal of GPL is doing something acceptable, it doesn't follow the ethic behind the license, it's intentions. They are violating on this term (even though as far as the legalese goes, they don't), and this post contains nothing illegal by itself or any promotion of any illegal activity, just something permitted by GPL itself.
If they were following GPL's intentions, this whole post would be moot. Until then it hopefully can serve as a tool to make you receive your rights GCC's license should be providing the first place.
So the spirit is on, we keep merrily 'optimizing' (our codes and costs), no matter what Microchip is up to! The standpoint of your employer is understandable, such a movement I talked about is only viable initiated from independent sources. The PIC32 maybe has just too small user base, probably mostly lacking hobbyists. Maybe partly especially for Microchip's decision: Around AVR the same time there is a thriving community, just look at the Arduino, but it's not hard to pick up a dozen of others either.
They offer their compilers for free (both for 8 bits and 32 bits), which might have been a deciding factor. My employer will likely use about 10K chips which is small business for Microchip but still get us their ear. I raised the issue of selling GPL code with them and was offered a significant discount on a license purchase. The idea of releasing uncrippled version is tempting but my employer still needs the goodwill of Microchip so a bit worried about upsetting them and the potential effect on my employment status. It may be better done by a hobbyist than an employee.
As for your second suggestion, the same idea had occurred to me so I was already playing with such ideas. I can report that patching the sha-256 strings in cc1.exe and cc1plus.exe allows the George hack to work again.Ukoda.: I don't think so.
As you can read here (and as you experienced), even compiling this is not something trivial. People having interest in the 32 bit PIC should pick this project up, since gcc is GPL'ed, it is completely legal to do so.
One knowing how to work with gcc's source could follow Microchip's changes in a free variant (using some diff tool this alone is not hard), and keep up updating compiled binaries. This certainly won't be me, though, I am happy to be out of this mess.
I guess, likewise, my co-workers are also happy that it is done for good. It was just some USB crap to be done somehow at last after a gigantic screw-up with some disaster called Vinculum, and no-one even cared to look at PIC32 ever since.An alternate way to deal with this.
may be if you find the hash value gcc compares to in it's (I mean gcc's) binary, and using a hex editor, simply change it to the dummy's hash. You can check in the source code of gcc whether the hash value itself is guarded in any manner. Of course tampering with the binary could give many other opportunities to by-pass the license check, but this should be the simplest to accomplish. From the reading of XC16 source and running of xclm, I understand that XC License Manager is not a part of XC compilers source but proprietary, Microchip copyright. In the case of XC16, the search for `xclm` path is coded in the source of the compiler (nothing related to MPLAB). The compiler, xc16 binary, will execute, for example on Windows, `xclm.exe -fcfc swxc16 1.21 `.
The exit status, echo%errorlevel%, is an integer that gives the license validity: 0 for no or free license, 1 for standard, 2 for pro.Nicolas.: this is probably just like what.George. suggested, the problem is that if you use Microchip's IDE, the GCC package will look for.xclm. in a path under Microchip's 'domain'. If I don't mis-understand you don't even need to do anything fancy, just take a look at.George.' s solution below. The problem with that is that by replacing.xclm. in a full-fledged IDE indtallation, you might violate Microchip's license covering this non-GPL portion.
If you use the compiler stand-alone, you can do anything including what.George. did, Microchip has no base for complaining then. An other way to defeat this might be finding out how GCC actually looks for the.xclm.
executable. There might be a way to fool the compiler installed within the IDE (without recompiling) to look elsewhere, and then you would be able to stun it with a dummy.xclm. legally, happily using the IDE and having it optimizing the same time.
Eh, and I guess I misunderstood a bit after all. You seeked out for 'cracking' the license check based on the assumption you will find it's code within the GPL'ed GCC source. This is not the case as you can see above, and pretty clear in.George.' s solution.
Nice to hear my post was of use! A little additional on licensing: Although below I found it nifty how.George. worked around the problem, it might not be the best thing to do if you want to stay in the clear, I mean legally. That.xclm. binary may be covered by Microchip's own proprietary license (did not check), so it might be a violation even to replace it inside the Microchip provided tree. Of course there are workarounds (like if you only have gcc, and interpreting it's source you set up a suitable dummy.xclm.
on your own: of course then you won't have the IDE), but where it matters you should probably carefully check the legal state of your hack. Hello, Thank you so much for writing this. It gave me some OOmph to go and roll my own. I followed everything but the configure flags that I found on MCHP's forums. I was going to try 1.31 but I ended up with 1.21 as it supports my needs. I'm compiling this for armv7l not x86 and ran into the same make errors you did(but cc1 & xgcc were built). As for the licence I found./pic32/mchp.c in gcc and it handily has a define to skip checking in the function '`pic32getlicense`' this also just returns 2 when defined (well adds it to a variable).
I've checked the code running on hardware.thumbs up. To note: I built this on my nexus7 and gcc only took 10 mins! Bloody thing untars files faster than my pc too.
I can now compile xc32 stuff on the move with android. Maybe a first? One of many never documented.sigh. is it time to start blogging?! Now to write a bootloader application for android native.
Thanks again. I re-downloaded that beast of XC32 source to check it out somewhat: it seems like it might work there too. The license check part seems to just call.xclm. on some path, and use it's return value. The constant for the PRO license (`MCHPXCLMVALIDPROLICENSE`) is actually 2 there too, so by this this stub copied at the appropriate place should do it. At least unless something else checks if it is a valid.xclm.
executable. I did not try it (didn't want to install that mess of IDE here at home on my Linux rig just to check). Maybe someone else actually (I mean with XC32) having this problem will check this, at least it is a lot simpler than trying to compile that beast if it works! Eh, proves I will just never be a hacker - think out of the box?! This is already a bit old, you should probably work it through yourself on the current version using this as a guide. In such a large source file stuff might have changed since, and I neither have that compiler any more (it was done for a colleague at work). Just do what I did: first use grep to find it, then you will likely see what to do inside.
It is not an #ifdef (at least my solution wasn't based on it), it is a variable indicating the license version, which gets #define'd constants for it's value. I just fished out the #define for the PRO version, and on every assignment to this variable, replaced the constant, and ho, no more license checking crap! It is an another story to wade through compiling it.
(patching up that source is just at most thirty minutes, compiling that beast is what will likely take your days). Title:. Created: 12th May 2010. Tags:,.
This large digital image was drawn for more than two months until it was completed (Or better to say I thought there is no much to do with it any more). It is one of my better pieces although it suffers some coloring problems. The theme would be an abandoned city on Earth, with cheetaans wandering around seeking for the sunshine. This is a part of the 'original' cheetaan story, that is the story of the first interstellar war between human and cheetaan.