Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

: flags : Seems not be seen from parser. What should do? #797

Open
TKingu opened this issue Jul 28, 2023 · 5 comments
Open

: flags : Seems not be seen from parser. What should do? #797

TKingu opened this issue Jul 28, 2023 · 5 comments

Comments

@TKingu
Copy link

TKingu commented Jul 28, 2023

Hi all,

I'm using ceedling for a project using STM32.
I'm using this configuration (Ony show up the relevant part of project.yml):

:paths:
  :test:
    - +:test/**
    - -:test/support
  :source:
    - src/**
    

:flags:
  :test:
    :compile:
      :startup_stm32xxx:
          - -x assembler-with-cpp

I'd like to using : flags : in order to compiling the startup_stm32xxx.s file with the flag -x assembler-with-cpp.
The file is in the path:
src/Builder/Startup_GCC/startup_stm32xxx.s

But it seems it not works.
The compilation works fine, but the linker not found some symbol defined in the file.

Then I made a simple test: I modified a little bit the syntax of the :flag: with random character like this:

:flags:
  :testferger:
    :compile:
      :startup_stm32xxx:
          - -x assembler-with-cpp

And I was expected an error. This was just to verify that that part of code was correctly parsed, but nothing changed. The compilation proceeding well, and the linker fails.

So my question is: does the : flags : part works? Because it seems to be skipped. And what I should do?
Thanks to all!

@TKingu TKingu changed the title :flag: Seems not be seen from parser. What should do? : flags : Seems not be seen from parser. What should do? Jul 28, 2023
@Letme
Copy link

Letme commented Jul 28, 2023

For linker you have another section under flags, test

@TKingu
Copy link
Author

TKingu commented Jul 31, 2023

Hi @Letme, thank you for your reply.

For linker you have another section under flags, test

I also tried:

:flags: :test: :compile: :startup_stm32xxx: - -x assembler-with-cpp :link: :startup_stm32xxx: - -x assembler-with-cpp

but with the same result.

The error it arises is:

<path>../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 0000000008000000

where is my path /usr/lib/gcc .. etc.

It seems that it does not see the symbols declared in the startup.s file, with is inside the source directory, so it should be seen by Ceedling. And It should be compiled by the "-x assembler-with-cpp" flag, thanks to the "flags" section.

I know for sure that this source code with this flag works fine, since I'm able to compile it and flash onto the board, so the problem can't be in the source.

The other problem is, as I wrote in the first post:

Then I made a simple test: I modified a little bit the syntax of the :flag: with random character like this:

:flags:
  :testferger:
    :compile:
      :startup_stm32xxx:
          - -x assembler-with-cpp

And I was expected an error. This was just to verify that that part of code was correctly parsed, but nothing changed. The >compilation proceeding well, and the linker fails.

Which make me things that there is some issue here.

@Letme
Copy link

Letme commented Jul 31, 2023

Your error is linker based on the pasted output (the ld is linker). And it complains that there is no Reset_Hanlder passed, so rather check which sources are passed to the linking stage.

I do not know why linker would have filename as a flag. So have you tried:

:flags:
  :test:
    :link:
        - -x assembler-with-cpp

@TKingu
Copy link
Author

TKingu commented Aug 2, 2023

Hi @Letme,

Thank you for your message.

Your error is linker based on the pasted output (the ld is linker). And it complains that there is no Reset_Hanlder passed, so rather check which sources are passed to the linking stage.

I do not know why linker would have filename as a flag. So have you tried:

:flags:
  :test:
    :link:
        - -x assembler-with-cpp

Yes, I also tried to use the : flags : section for linker, but nothing change. In general, however, I think the problem is that this source is not seen by compiler.

I'm saiyng this because I have a CMakeList file in which are configurated all flag and setting in order to build the project, and the project works fine with it.

And in the CMakeList I have this:

set_source_files_properties(<path>/startup_stm32xxx.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")

So with the : flags : setting I'm triyng to replicate it.

Thanks

@Letme
Copy link

Letme commented Aug 2, 2023

Put verbosity[4] before the test in command line to get a bit more expanded view of your steps. It should help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants