User forums > Embedded development

Looking for example of "Post-build steps"

<< < (4/8) > >>

BlueHazzard:
Codeblocks is a IDE, not a compiler nor a compiler framework. The compiler shipped with the installer is only for convenient and it is only a mingw-tdm compiler for windows applications. But you can use Codeblocks with a dozens other compilers. If you want develop ARM code you need an arm compiler provided by your microprocessor manufacture. There are hundreds of different compilers for arm cores out there. Codeblocks can not provide executables for any of this. The same thing is with the linker script. The path you posted is the path to the template of the new project wizard. This is only provided for convenience. Every processor needs his own linker script and your manufacturer provides you with the appropriate linker script. You have to replace the linker script found in your project directory with the right linker script. The Codeblocks dev can not provide any support on this because the environment is simply to large (count alone the endless manufacturer like Atmel TI...).

Pavel_47:
I've tried your suggestion. It works ! Thanks.
Two errors disappeared, only one remains (probably I should try with another linker script, where Reset_Handler is defined):

-------------- Build: default in proj1 (compiler: GNU GCC Compiler for ARM)---------------

arm-none-eabi-g++.exe -L"C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1" -o default\proj1.elf default\src\main.o default\src\main1.o  -s -Wl,-Map,map.txt -mtune=arm7tdmi -T ld/gcc.ld 
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 00000000
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
Concerning linker script / compiler interdependence issue (i.e. my previous question), can you confirm that following statement is correct:
The linker scripts provided in "C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates\wizard\arm\files\{ARM_platform_name}\ld\" are compatible with at least one of the "hundreds of different compilers for arm cores" (or none at all and should be edited to use with a particular compiler).

Thanks

BlueHazzard:

--- Quote from: Pavel_47 on December 04, 2016, 12:36:31 pm ---The linker scripts provided in "C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates\wizard\arm\files\{ARM_platform_name}\ld\" are compatible with at least one of the "hundreds of different compilers for arm cores" (or none at all and should be edited to use with a particular compiler).

--- End quote ---
The linker script is mainly processor dependent, not compile/linker dependent (in the form that 90% of the arm compiler/linker out there are based on the gnu environment). Learn what the linker script do and you will answer this question by your own... The main purpose of the linker script is to tell the linker where the ram/ flash, interrupt handler are located in the processor, and this has nothing to do with the compiler but all with the processor....

Pavel_47:
Sure, linker script is related to mcu memory management.
But the set of execution startup routines (crt0.o) from a particular toolchain use symbol names proper to this particular toolchain that may (or may not) coincide with theirs counterparts from another toolchain. As these symbols are declared in linker script, there must an accord between a particular linker script and a particular toolchain. Isn't it ?

Pavel_47:
Finally it works.
Employing some tricks, I've get project built.
Probably the boot code (.elf file) is nonoperational, but at least project is built that allows to check the post-build concept.
Here is post-build command that generates disassembly file in the project target src sub-directory:



And here is build log:

-------------- Build: default in proj1 (compiler: GNU GCC Compiler for ARM)---------------

Target is up to date.
Running project post-build steps
cmd /C arm-none-eabi-objdump -d default\src\main.o > default\src\main_asm.txt
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))


One question remains: if there are multiple .o files in TARGET\src, how to modify the post-build command in order to take into account all .o files ?
Thanks.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version