Sysprogs forums › Forums › VisualGDB › Support for .S files
- This topic has 4 replies, 2 voices, and was last updated 4 days, 20 hours ago by support.
-
AuthorPosts
-
November 28, 2024 at 01:35 #36175ArekParticipant
As for Today, in the project window I can add assembly source code and compile, however:
- there are no specific setting I can apply to assembler (there are only general & c/c++)
- no defined symbol is propagated to assembler
Can handling of the assembly source code be added? With ability to:
- suppressing warnings,
- contoling debug level,
- controlling preprocessor symbols (-D but also -x assembler-with-cpp),
- adding assembler specific include paths,
- adding other flags, like -mtune, -march etc
November 28, 2024 at 08:03 #36177supportKeymasterHi,
This should work just fine as long as the assembly files are preprocessed. If you are not sure, let us know your project type (MSBuild/CMake) and the compiler you are using, and we can suggest where to look for it.
November 28, 2024 at 23:56 #36180ArekParticipantHi,
Environment? CMake/Ninja/arm-eabi/OpenOCD/ST-Link/STM32H5xx
I have several .S files added to the project. However when I look into the properties of one of them, there is no possibility to set “Compile as” to -x assembler-with-cpp. I mean the combo box edit field stays empty.
After a bit of playing, compilation stops:
arm-none-eabi-g++.exe: warning: "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"-x assembler-with-cpp\\\\\\\\\\\\\\\" -x\\\\\\\" assembler-with-cpp\\\" -x\" assembler" -x: linker input file unused because linking not done
arm-none-eabi-g++.exe: error: "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"-x assembler-with-cpp\\\\\\\\\\\\\\\" -x\\\\\\\" assembler-with-cpp\\\" -x\" assembler" -x: linker input file not found: Invalid argument
arm-none-eabi-g++.exe: warning: assembler-with-cpp: linker input file unused because linking not done
arm-none-eabi-g++.exe: error: assembler-with-cpp: linker input file not found: No such file or directory
November 29, 2024 at 00:26 #36182ArekParticipantFor troubleshooting purposes, this is what was added to CMakeLists.txt:
set_source_files_properties(src/bsp/peripherals.S PROPERTIES
COMPILE_FLAGS "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"-x assembler-with-cpp\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" -x\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" assembler-with-cpp\\\\\\\\\\\\\\\" -x\\\\\\\" assembler\\\" -x\" assembler-with-cpp")
November 29, 2024 at 07:27 #36185supportKeymasterCMake uses its own logic for deciding how to build each individual file, however most of it is configurable. Specifically, you can pass assembly-specific CFLAGS by using the $<COMPILE_LANGUAGE:ASM> expression in bsp_compile_flags. You can find some more examples of it in the %VISUALGDB_DIR%\cmake\embedded\bsp.cmake file.
If you cannot get anything working with CMake, you can try using MSBuild. There VisualGDB is in direct control of each compiler invocation, so you can clearly specify which tool to use in each specific case, and what arguments to pass. That said, MSBuild projects rely on a lot of legacy parts from Visual Studio itself, and are somewhat less streamlined than advanced CMake projects.
-
AuthorPosts
- You must be logged in to reply to this topic.