Updated C30 build script for C30 v3.23b
by matt on Jul.08, 2010, under News
I have made a minor update to the C30 install script so that it can build/install C30 v3.23b. The only real change (apart from updating filenames) is a new unattended install script for the non-free part.
Instructions and download here: http://www.electricrock.co.nz/blog/microchip-c30/.
September 18th, 2010 on 8:46 am
Hi,
First of all, thanks alot for the tutorial on how compiling the c30 compiler for linux.
I tried this with the latest 3.24 of the source tree, there is another obstacle in gcc/config/pic30.c:2403, a if block of license specific stuff and also an include of pic30_lm.h, (license manager) which is not part of the source tree. commenting these out worked fine for me.
Another thing i ran into is a buffer overflow in binutils-ar only appeared on my 32 bit ubuntu on my laptop when compiling gcc:
/usr/local/pic/bin/pic30-coff-ar rc ./libgcc.a libgcc/./_muldi3.o libgcc/./_negdi2.o libgcc/./_lshrdi3.o libgcc/./_ashldi3.o libgcc/./_ashrdi3.o libgcc/./_cmpdi2.o libgcc/./_ucmpdi2.o libgcc/./_floatdidf.o libgcc/./_floatdisf.o libgcc/./_fixunsdfsi.o libgcc/./_fixunssfsi.o libgcc/./_fixunsdfdi.o libgcc/./_fixdfdi.o libgcc/./_fixunssfdi.o libgcc/./_fixsfdi.o libgcc/./_fixxfdi.o libgcc/./_fixunsxfdi.o libgcc/./_floatdixf.o libgcc/./_fixunsxfsi.o libgcc/./_fixtfdi.o libgcc/./_fixunstfdi.o libgcc/./_floatditf.o libgcc/./_clear_cache.o libgcc/./_enable_execute_stack.o libgcc/./_trampoline.o libgcc/./__main.o libgcc/./_absvsi2.o libgcc/./_absvdi2.o libgcc/./_addvsi3.o libgcc/./_addvdi3.o libgcc/./_subvsi3.o libgcc/./_subvdi3.o libgcc/./_mulvsi3.o libgcc/./_mulvdi3.o libgcc/./_negvsi2.o libgcc/./_negvdi2.o libgcc/./_ctors.o libgcc/./_ffssi2.o libgcc/./_ffsdi2.o libgcc/./_clz.o libgcc/./_clzsi2.o libgcc/./_clzdi2.o libgcc/./_ctzsi2.o libgcc/./_ctzdi2.o libgcc/./_popcount_tab.o libgcc/./_popcountsi2.o libgcc/./_popcountdi2.o libgcc/./_paritysi2.o libgcc/./_paritydi2.o libgcc/./_powisf2.o libgcc/./_powidf2.o libgcc/./_powixf2.o libgcc/./_powitf2.o libgcc/./_mulsc3.o libgcc/./_muldc3.o libgcc/./_mulxc3.o libgcc/./_multc3.o libgcc/./_divsc3.o libgcc/./_divdc3.o libgcc/./_divxc3.o libgcc/./_divtc3.o libgcc/./_eprintf.o libgcc/./__gcc_bcmp.o libgcc/./_divdi3.o libgcc/./_moddi3.o libgcc/./_udivdi3.o libgcc/./_umoddi3.o libgcc/./_udiv_w_sdiv.o libgcc/./_udivmoddi4.o libgcc/./unwind-dw2.o libgcc/./unwind-dw2-fde.o libgcc/./unwind-sjlj.o libgcc/./gthr-gnat.o libgcc/./unwind-c.o
*** buffer overflow detected ***: /usr/local/pic/bin/pic30-coff-ar terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0×50)[0x210390]
/lib/tls/i686/cmov/libc.so.6(+0xe12ca)[0x20f2ca]
/lib/tls/i686/cmov/libc.so.6(+0xe0a08)[0x20ea08]
/lib/tls/i686/cmov/libc.so.6(_IO_default_xsputn+0x9e)[0x197afe]
/lib/tls/i686/cmov/libc.so.6(_IO_padn+0xd8)[0x18b5f8]
/lib/tls/i686/cmov/libc.so.6(_IO_vfprintf+0x2aee)[0x16d6fe]
/lib/tls/i686/cmov/libc.so.6(__vsprintf_chk+0xad)[0x20eabd]
/lib/tls/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0x20e9fd]
/usr/local/pic/bin/pic30-coff-ar[0x8051255]
/usr/local/pic/bin/pic30-coff-ar[0x804f5d3]
/usr/local/pic/bin/pic30-coff-ar[0x8051c04]
/usr/local/pic/bin/pic30-coff-ar[0x8055088]
/usr/local/pic/bin/pic30-coff-ar[0x804beb3]
/usr/local/pic/bin/pic30-coff-ar[0x804cb48]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x144bd6]
/usr/local/pic/bin/pic30-coff-ar[0x8049681]
======= Memory map: ========
00110000-0012b000 r-xp 00000000 08:01 392483 /lib/ld-2.11.1.so
0012b000-0012c000 r–p 0001a000 08:01 392483 /lib/ld-2.11.1.so
0012c000-0012d000 rw-p 0001b000 08:01 392483 /lib/ld-2.11.1.so
0012d000-0012e000 r-xp 00000000 00:00 0 [vdso]
0012e000-00281000 r-xp 00000000 08:01 410330 /lib/tls/i686/cmov/libc-2.11.1.so
00281000-00282000 —p 00153000 08:01 410330 /lib/tls/i686/cmov/libc-2.11.1.so
00282000-00284000 r–p 00153000 08:01 410330 /lib/tls/i686/cmov/libc-2.11.1.so
00284000-00285000 rw-p 00155000 08:01 410330 /lib/tls/i686/cmov/libc-2.11.1.so
00285000-00288000 rw-p 00000000 00:00 0
00288000-002a5000 r-xp 00000000 08:01 393345 /lib/libgcc_s.so.1
002a5000-002a6000 r–p 0001c000 08:01 393345 /lib/libgcc_s.so.1
002a6000-002a7000 rw-p 0001d000 08:01 393345 /lib/libgcc_s.so.1
08048000-0807a000 r-xp 00000000 08:01 271075 /usr/local/pic/bin/pic30-coff-ar
0807a000-0807b000 r–p 00032000 08:01 271075 /usr/local/pic/bin/pic30-coff-ar
0807b000-0807c000 rw-p 00033000 08:01 271075 /usr/local/pic/bin/pic30-coff-ar
0807c000-08312000 rw-p 00000000 00:00 0 [heap]
b7fa9000-b7fe8000 r–p 00000000 08:01 883411 /usr/lib/locale/de_DE.utf8/LC_CTYPE
b7fe8000-b7fe9000 rw-p 00000000 00:00 0
b7fec000-b7ff6000 rw-p 00000000 00:00 0
b7ff6000-b7ffd000 r–s 00000000 08:01 851163 /usr/lib/gconv/gconv-modules.cache
b7ffd000-b7ffe000 r–p 00000000 08:01 883949 /usr/lib/locale/de_DE.utf8/LC_MESSAGES/SYS_LC_MESSAGES
b7ffe000-b8000000 rw-p 00000000 00:00 0
bffea000-c0000000 rw-p 00000000 00:00 0 [stack]
here is a backtrace:
(gdb) bt
#0 0x0015b905 in abort () from /lib/tls/i686/cmov/libc.so.6
#1 0x0018f49d in ?? () from /lib/tls/i686/cmov/libc.so.6
#2 0×00210390 in __fortify_fail () from /lib/tls/i686/cmov/libc.so.6
#3 0x0020f2ca in __chk_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x0020ea08 in ?? () from /lib/tls/i686/cmov/libc.so.6
#5 0x00197afe in _IO_default_xsputn () from /lib/tls/i686/cmov/libc.so.6
#6 0x0018b5f8 in _IO_padn () from /lib/tls/i686/cmov/libc.so.6
#7 0x0016d6fe in vfprintf () from /lib/tls/i686/cmov/libc.so.6
#8 0x0020eabd in __vsprintf_chk () from /lib/tls/i686/cmov/libc.so.6
#9 0x0020e9fd in __sprintf_chk () from /lib/tls/i686/cmov/libc.so.6
#10 0×08051255 in coff_write_armap ()
#11 0x0804f5d3 in _bfd_compute_and_write_armap ()
#12 0x08051c04 in _bfd_write_archive_contents ()
#13 0×08055088 in bfd_close ()
#14 0x0804beb3 in write_archive ()
#15 0x0804cb48 in main ()
Did you ever face this problem? Maybe you already got a solution for this?
Thanks alot,
Florian
September 18th, 2010 on 10:02 am
Hi Florian,
Thanks for the info. I will try to upload new patches for 3.24 this weekend.
Unfortunately, as I haven’t encountered the same problem with ar I don’t have much help to offer with that at the moment.
Cheers,
Matt
October 15th, 2010 on 6:03 pm
Hi,
I have tried a couple of routes for a C30 on my GNewSense, no success yet.
I have tried your script with C30 v3.23, but I can only get MPLABC30Combo_v3_24Lite.exe, not 3.23/3.23b. So I tried with MPLABC30Combo_v3_23.exe, modifying the script as needed. The script exits with
Note: wineprefixcreate is deprecated and shouldn’t be needed anymore.
WINEPREFIX creation and updates now happen automatically when needed.
fixme:wininet:InternetLockRequestFile STUB
fixme:system:SetProcessDPIAware stub!
fixme:dwmapi:DwmIsCompositionEnabled 0x32b984
fixme:file:MoveFileWithProgressW MOVEFILE_WRITE_THROUGH unimplemented
fixme:advapi:SetNamedSecurityInfoW L\C:\windows\system32\gecko\1.0.0\wine_gecko\components\xpti.dat\ 1 536870916 (nil) (nil) 0x1d0f04 (nil)
fixme:iphlpapi:NotifyAddrChange (Handle 0xa9fe928, overlapped 0xa9fe930): stub
fixme:file:MoveFileWithProgressW MOVEFILE_WRITE_THROUGH unimplemented
fixme:advapi:SetNamedSecurityInfoW L\C:\windows\system32\gecko\1.0.0\wine_gecko\components\compreg.dat\ 1 536870916 (nil) (nil) 0x217d0dc (nil)
wine: configuration in ‘/tmp/c30/non-free’ has been updated.
Generating unattended install file.
Running unattended install of /media/IomegaHDD/Tech/GNU/GCCForPIC/PIC24/ElectricRock-Oct2010/MPLABC30Combo_v3_23.exe
(this might seem to hang, but it just takes a little hwile.)
fixme:storage:StgCreateDocfile Storage share mode not implemented.
fixme:reg:GetNativeSystemInfo (0x32285c) using GetSystemInfo()
C30 Install in /tmp/c30/non-free/drive_c/C30 failed.
Sorry to trouble, what am I missing.
Thanks.
Anantha Krishnan
October 18th, 2010 on 9:32 am
Hi Anantha,
This problem is because I haven’t updated the unattended install script for MPLAB 3.24. What I suggest is you just manually install mplab using wine, then open up my install script in a text editor and you will be able to work out which directories to copy where (see lines 490-503). I will update the script at some point, but don’t have a lot of free time at the moment.
Cheers
April 13th, 2011 on 1:19 am
Hi v66r,
regarding the overflow issue: I have fixed it by compiling all of the pic30-* files using gcc-3.4, not 4.1. Now it seems to work!
Cheers