Page 1 of 1

Feature Request #305 - Add Assembly Compile Options

Posted: Mon Aug 12, 2013 6:33 am
by Verax
I'm starting this thread to hopefully encourage a discussion about Feature Request #305 - Adding Assembly Compile Options to the build settings.

In the comments for this feature request, Eran has made good argument for why this feature has not yet been implemented. I agree with this premise, but I also believe that there is a good case for it, and I'll attempt to articulate that here.

The rise of embedded computers. The desktop is playing less of a role than it did 10 years ago. I don't think the desktop is dead, or even dying, but I think many of the things we used to use desktops for are now being done on embedded computers. Case in point: notice the rise in popularity of devices like Arduino, BeagleBone, Raspberry Pi, and now Intel's Minnow. I know these run Linux and are not "Bare Metal", but those who wish to build devices like these (Like me) must do "Bare Metal" programming. There isn't a great open source IDE for this Bare Metal programming. CodeLite and Code::Blocks are really the best, and I prefer CodeLite (Hail! to the developers). I understand that CodeLite may not have been intended for embedded development, but CodeLite is actually a pretty darn good tool for this kind of programming.

I acknowledge that it is not necessary to use assembly to program embedded devices, but many libraries written by the ARM, STM, TI, and other MCU manufacturers release assembly files that are necessary to boot and initialize the MCU. Also, ARM has also made special instructions for the processors (e.g. SIMD instructions) that can only be used from assembly. Granted, these features are usable from inline assembly also, but sometimes it's more elegant to use an assembly file, and assembly files sometime contain syntax that can't be done in inline assembly (at least that I'm aware of).

I think there are likely other programming disciplines that may use assembly as well, and I hope others can point them out.

In CodeLite's "Syntax Highlight and Fonts" options, there is a category for "Assembly" but there is no toolchain integration for assembly files, which seems inconsistent IMO. Futhermore, the assembler is part of the GCC toolchain, and often part of other toolchains as well. It would be nice to have CodeLite make the integration with this part of the toolchain more intuitive and "natural".

If I had the skills, I'd submit a patch myself, but I don't :cry: I hope others will contribute their thoughts and the developers will give this feature their thoughtful consideration.

Thanks.

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Mon Aug 12, 2013 9:01 am
by eranif
Verax wrote:If I had the skills, I'd submit a patch myself, but I don't :cry: I hope others will contribute their thoughts and the developers will give this feature their thoughtful consideration.
You can help by providing instructions (detailed ones) of what is missing.
For me sentences like "there is no toolchain integration for assembly files" is vague, I would like to get a detailed list of what is missing.
For example:
- Do we require a specific assembler compiler entry (as.exe?) in the toolchain tab?
- Do we need a specific compilation line (settings -> build settings -> compilers ->gnu g++ -> File Types)

If you could answer these questions and provide some more info, we could start adding support, but I need some guidance to make it happen

Eran

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Mon Aug 12, 2013 12:16 pm
by Verax
You can help by providing instructions (detailed ones) of what is missing.
I'll be happy to do whatever I can to help

Here's how I think it should be done:
1) Add a new textbox to the "Settings"->"Build Settings"->"Compilers" tab titled "Assembler Name:" and place it between "C Compiler Name:" and "Linker Name:". The text box should default to the following values for each of the default compilers:
  • VC++: "" --I think this should be "masm", but I'd just leave it blank for now. Perhaps someone more familiar with VC++ can submit a suggestion
    corba: ""
    gnu g++: "as"
    gnu gcc: "as"
2) Add a new entry in the "Settings"->"Build Settings"->"Compilers"-->{Compiler Name}->"File Types" as follows:
  • gnu g++:
    gnu gcc:
    • Extension: "s"
      Kind: "source"
      Compilation Line: $(AS) $(SourceSwitch) "$(FileFullPath)" $(ASFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) -I $(IncludePath)
    VC++:
    • Just leave it the way it is. Perhaps someone more familiar with VC++ can provide a command line format.
    corba:
    • Just leave it the way it is
3) In Project Properties -->"Common Settings"->"Compiler", add a "Assembler Options:" text box between "C Compiler Options:" and "Include Paths:" I'm assuming these would map to the $(SourceSwitch) in the "File Types"->"Compilation Line", but I'm not sure how these macros are organized. Default it's value to "" (blank).

I hope that is enough information to at least elicit more details. Let me know if I can provide any more information.

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Mon Aug 12, 2013 2:31 pm
by eranif
Thank you, this should be more than enough to get me started

Eran

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Tue Aug 20, 2013 10:07 pm
by eranif
I have added assembler support in codelite - when you have the time, please test it
Eran

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Sat Aug 24, 2013 1:11 pm
by Verax
I finally figured out how to get CodeLite to build. For me, I had to rename some *.dlls to *.a. If you know how I can fix this please let me know.

I can see the new features on all of the relevant screens. Looks good, thanks.

However, upon compiling my project, it appears it is looking for "as" when my compiler settings say "arm-none-eabi-as ...". Here's the relevant output from the build.

Code: Select all

as "C:/Users/Mike/Desktop/MyProject/libstm32periph/src/CMSIS/startup_stm32f4xx.S"  -o ./Debug/CMSIS_startup_stm32f4xx.o -I-I. -I. -Iinclude/CMSIS -Iinclude/STM32F4xx_StdPeriph_Driver
'as' is not recognized as an internal or external command,
operable program or batch file.
Here are screenshots of my settings.
CompilerSettings.png
FileTypes.png
ProjectCompilerSettings.png
Let me know if/when there's a fix and I'll be happy to test again.

Mike

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Sat Aug 24, 2013 1:17 pm
by Verax
I double-checked my compiler selection. It look right to me.
CompilerSelection.png

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Sat Aug 24, 2013 4:54 pm
by eranif
Thanks for reporting this - fixed in git head
Eran

Re: Feature Request #305 - Add Assembly Compile Options

Posted: Sun Aug 25, 2013 4:19 am
by Verax
Works great! Thank you.