Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Complier related question.

Status
Not open for further replies.

Raady Here

Full Member level 5
Joined
Jun 8, 2013
Messages
242
Helped
26
Reputation
52
Reaction score
26
Trophy points
28
Location
India
Activity points
1,571
Hi,

while selecting Microchip Toolsuit
I have three options to choose from pic30-gcc.exe(C complier), pic30-ld.exe(object linker), pic-ar.exe(archiver)

Normally we select gcc, instead I selected pic-ar.exe and my program didn't build up and was prone to many errors.

My question is can we built any program using the other two(object linker or archiver) alone, if so what kind of application they are used in?

Regards,
Raady.
 

Usually compilation is done by stages like pre processing compiling linking and exporting as a executable file.
I thing each exe file will have their own input files and they will by called one by one automatically. for example if you have object (.o) file as input then you can start from linker stage.

GCC includes a preprocessor called CPP (C Preprocessor). #define and #include are by far the most common preprocessor commands The compilation process is broken down into many smaller stages. One of these stages is confusingly called compilation. Compilation is the process of converting source code to object code. If you invoke GCC with ``-c'' it will When programs become large it can take time to compile them, by splitting a program into smaller files you can re-compile only the files that you have changed. First you must tell gcc to only compile the source

https://www.nongnu.org/c-prog-book/online/x972.html
 

If GCC compiler is the one which will be able to create the object files from source files, then how can the hex file be created without selecting the remaining two selected object linker and archiver?
 

for example purpose i compiled a code with XC16 compiler the executing lines in the left side denotes the executable files and their input files they are automatically done according to their tool suite.

Code:
----------------------------------------------------------------------
Debug build of project `C:\microchip_solutions_v2013-06-15\USB\Host - Mass Storage - Simple Demo\Firmware\USB Host - MSD - Simple Demo - XC16.mcp' started.
Language tool versions: xc16-as.exe v1.21, xc16-gcc.exe v1.21, xc16-ld.exe v1.21, xc16-ar.exe v1.21
Preprocessor symbol `__DEBUG' is defined.
Wed Oct 01 14:04:58 2014
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-gcc.exe" -omf=coff -mcpu=24FJ256GB110 -x c -c "main.c" -o".\Objects\XC16\main.o" -I"." -I"..\..\..\Microchip\Include" -D__DEBUG -g -Wall -O1 -fno-ivopts
Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-gcc.exe" -omf=coff -mcpu=24FJ256GB110 -x c -c "usb_config.c" -o".\Objects\XC16\usb_config.o" -I"." -I"..\..\..\Microchip\Include" -D__DEBUG -g -Wall -O1 -fno-ivopts
Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-gcc.exe" -omf=coff -mcpu=24FJ256GB110 -x c -c "..\..\..\Microchip\USB\MSD Host Driver\usb_host_msd.c" -o".\Objects\XC16\usb_host_msd.o" -I"." -I"..\..\..\Microchip\Include" -D__DEBUG -g -Wall -O1 -fno-ivopts
Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-gcc.exe" -omf=coff -mcpu=24FJ256GB110 -x c -c "..\..\..\Microchip\USB\MSD Host Driver\usb_host_msd_scsi.c" -o".\Objects\XC16\usb_host_msd_scsi.o" -I"." -I"..\..\..\Microchip\Include" -D__DEBUG -g -Wall -O1 -fno-ivopts
Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-gcc.exe" -omf=coff -mcpu=24FJ256GB110 -x c -c "..\..\..\Microchip\USB\usb_host.c" -o".\Objects\XC16\usb_host.o" -I"." -I"..\..\..\Microchip\Include" -D__DEBUG -g -Wall -O1 -fno-ivopts
Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-gcc.exe" -omf=coff -mcpu=24FJ256GB110 -x c -c "..\..\..\Microchip\MDD File System\FSIO.c" -o".\Objects\XC16\FSIO.o" -I"." -I"..\..\..\Microchip\Include" -D__DEBUG -g -Wall -O1 -fno-ivopts
Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-gcc.exe" -omf=coff -mcpu=24FJ256GB110 "Objects\XC16\main.o" "Objects\XC16\usb_config.o" "Objects\XC16\usb_host_msd.o" "Objects\XC16\usb_host_msd_scsi.o" "Objects\XC16\usb_host.o" "Objects\XC16\FSIO.o" -o"USB Host - MSD - Simple Demo - XC16.cof" -Wl,-Tp24FJ256GB110.gld,--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--heap=1000,-Map="USB Host - MSD - Simple Demo - XC16.map",--report-mem


Program Memory  [Origin = 0x200, Length = 0x2a9f6]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200               0x540           0x7e0  (2016)
.const                       0x740                0x30            0x48  (72)
.text                        0x770              0x735e          0xad0d  (44301)
.dinit                      0x7ace                0x82            0xc3  (195)
.text                       0x7b50                0x64            0x96  (150)

                     Total program memory used (bytes):         0xb68e  (46734) 17%


Data Memory  [Origin = 0x800, Length = 0x4000]

section                    address      alignment gaps    total length  (dec)
-------                    -------      --------------    -------------------
.nbss                        0x800                   0           0x206  (518)
.bss                         0xa06                   0             0x2  (2)
_02EBA7E0542bbcca            0xa08                   0           0x200  (512)
_02EBA900542bbcca            0xc08                   0           0x200  (512)
.nbss                        0xe08                   0           0x168  (360)
.ndata                       0xf70                   0            0x12  (18)
_02E3DD20542bbcc4            0xf82                   0            0x3a  (58)
.nbss                        0xfbc                   0            0x28  (40)
.nbss                        0xfe4                   0             0x8  (8)
.ndata                       0xfec                   0             0x8  (8)
_02E5D000542bbcc7           0x1000                   0            0x10  (16)
.ndata                      0x1010                   0            0x24  (36)
.bss                        0x1034                   0            0x10  (16)
.heap                       0x1044                   0           0x3e8  (1000)

                        Total data memory used (bytes):          0xc20  (3104) 18%


Dynamic Memory Usage

region                     address                      maximum length  (dec)
------                     -------                      ---------------------
heap                        0x1044                               0x3e8  (1000)
stack                       0x142c                              0x33d4  (13268)

                        Maximum dynamic memory (bytes):         0x37bc  (14268)

Executing: "C:\Program Files\Microchip\xc16\v1.21\bin\xc16-bin2hex.exe" "C:\microchip_solutions_v2013-06-15\USB\Host - Mass Storage - Simple Demo\Firmware\USB Host - MSD - Simple Demo - XC16.cof" -omf=coff
Loaded C:\microchip_solutions_v2013-06-15\USB\Host - Mass Storage - Simple Demo\Firmware\USB Host - MSD - Simple Demo - XC16.cof.
----------------------------------------------------------------------
Debug build of project `C:\microchip_solutions_v2013-06-15\USB\Host - Mass Storage - Simple Demo\Firmware\USB Host - MSD - Simple Demo - XC16.mcp' succeeded.
Language tool versions: xc16-as.exe v1.21, xc16-gcc.exe v1.21, xc16-ld.exe v1.21, xc16-ar.exe v1.21
Preprocessor symbol `__DEBUG' is defined.
Wed Oct 01 14:05:38 2014
----------------------------------------------------------------------
BUILD SUCCEEDED
for first six calls input is 6 c files in the project it will be done if you have any changes in the corresponding C file
the seventh call is done by object files and the last one is done with xc16-bin2hex.exe

Like wise if you have object files and know all the parameters for linker and archeiver you can also try may be go through the compiler manuals.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top