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

Can't link my code, file not found when using absolute path #984

Closed
jankap opened this issue Jun 14, 2023 · 3 comments
Closed

Can't link my code, file not found when using absolute path #984

jankap opened this issue Jun 14, 2023 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@jankap
Copy link

jankap commented Jun 14, 2023

Describe the bug
The linking step fails due to absolute paths in armclang call:

./ArmCompilerforEmbedded6.20.1/bin/armclang -E --target=arm-arm-none-eabi -mcpu=Cortex-M3 -mfpu=none -xc -include /workspaces/prj/RTE/Device/STM32F103TB/regions_STM32F103TB.h /home/dev/cmsis-toolbox-linux-amd64/etc/ac6_linker_script.sct -o /workspaces/build/tmp/debug/ac6_linker_script.sct.pp 

Results in

:1:10: fatal error: '/workspaces/prj/RTE/Device/STM32F103TB/regions_STM32F103TB.h' file not found
#include "/workspaces/prj/RTE/Device/STM32F103TB/regions_STM32F103TB.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

It works well with cding into the path:

cd /workspaces/prj &&
./ArmCompilerforEmbedded6.20.1/bin/armclang -E --target=arm-arm-none-eabi -mcpu=Cortex-M3 -mfpu=none -xc -include prj/RTE/Device/STM32F103TB/regions_STM32F103TB.h /home/dev/cmsis-toolbox-linux-amd64/etc/ac6_linker_script.sct -o /workspaces/build/tmp/debug/ac6_linker_script.sct.pp 

The ac6_linker_script.sct.pp file is created sucessfully.

Environment (please complete the following information):

  • CMSIS-Toolbox
  • v1.7.0
  • OS: Ubuntu 22.04

Additional context
Same behavior with AC6@8.20.1

In AC6.6.18.0.cmake, this line configures the call: set(CPP_ARGS_LD_SCRIPT "${CPP_FLAGS} ${CPP_DEFINES} -include \"${LD_REGIONS}\" \"${LD_SCRIPT}\" -o \"${LD_SCRIPT_PP}\"") but I don't understand where ${LD_SCRIPT} comes from and why it's a full path.

Is this an issue with CMSIS-toolbox or AC6?
Any help is appreciated, I'm stuck in the middle of a migration which takes way too long already.

Thanks.

@jankap jankap added the bug Something isn't working label Jun 14, 2023
@brondani
Copy link
Collaborator

Hi @jankap, first of all I would recommend to use the latest cmsis-toolbox 2.0.0-dev1.

Anyway I tried with the cmsis-toolbox 1.7.0 and AC6 6.20.1 in Linux and in Windows and it works with absolute paths in both cases. You can inspect the generated CMakeLists.txt where you should always find absolute paths.

Something that I have observed in your comment is that you do a cd /workspaces/prj and then the preprocessor includes a relative file -include prj/RTE/... that would result in /workspaces/prj/prj/RTE/... - note the double prj, it does not match the absolute path mentioned in the first call.

Would you be able to provide the full project in order to reproduce the issue you are facing? Thanks!

@ReinhardKeil ReinhardKeil added the question Further information is requested label Jun 28, 2023
@ReinhardKeil
Copy link
Collaborator

We cannot duplicate this issue. Please help us to understand the problem otherwise we will close it.

@jankap
Copy link
Author

jankap commented Jun 28, 2023 via email

@jkrech jkrech closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants