build error: unrecognized option '-T'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

build error: unrecognized option '-T'

3,912 Views
momo12
Contributor III

Hi

I have put my S32K project under git. Each time I switch branches in GIT, I get this build error:

/../arm-none-eabi/bin/ld.exe: unrecognized option '-T'

In order to fix it, I have to a combination of these steps. After 10-20 trials of repeating the below steps in random order, the build error is gone. And I can build my branch again.

- clean up untracked files in git

- refresh project in eclipse

- build again and again

- clean project in eclipse

What is going on here? What would be the correct order?

9 Replies

3,022 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

the -T linker otion specifies linker script file. In the .args file (located in project's Debug folder) should be path to existing linker script - for example: 

-T "C:/NXP/S32DS_ARM_v2018.R1/S32DS/S32SDK_S32K14x_BETA_1.9.0/platform/devices/S32K144/linker/gcc/S32K144_64_flash.ld"

If the file doesn't exist - there is empty path after -T and linker can't continue. 

Jiri 

3,022 Views
tibor_bekesi
Contributor II

Hi Jiri,

Is this maybe a bug in S32 Design Studio for ARM?

I have the same issue using S32 SDK 3.0.1 and Design Studio for ARM 2018.R1 Build id: 180815:

S32DS_error.png

Furthermore the main issue is that you are not able to correct the empty -T parameter (-T "") value, because the given box is grayed out and is not editable. Or is there another location/option somewhere in Design Studio where you can specify the full path to the script file (S32K142_32_flash.ld)?

Best regards,

Tibor

3,022 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

you can specify linker path in linker general options: 

pastedImage_1.png

I tried to reproduce the issue, but no success. Is path to linker script specified in settings in your project? 

Jiri 

0 Kudos

3,022 Views
tibor_bekesi
Contributor II

Hi Jiri,

Thanks for your support and sorry for my late reply.

Yes, path to linker script file is specified as follows:

pastedImage_1.png

And here you are my Processor Expert options as well:

pastedImage_2.png

However I do NOT see S32K142_32_flash.ld linked resource under my Generated_Code folder:

pastedImage_5.png

Even if I modify the path to the linker script file, the -T option still remains empty double quotes (-T "").

Best regards,

Tibor

0 Kudos

3,022 Views
jiri_kral
NXP Employee
NXP Employee

Hi Tibor, 

normally is linker script located in Project_settings folder: 

pastedImage_1.png

Are you started your project from scratch or did you reuse some example project? 

Jiri

0 Kudos

3,022 Views
tibor_bekesi
Contributor II

Hi Jiri,

Yes, I know that in the example projects usually the linker scripts are located under Project_Settings folder.

However, in my case it should reside in Generated_Code folder if I understand correctly the Processor Expert configuration of my project (see screenshot in my previous comment).

In fact S32K1xx_flash.ld is missing under Generated_Code folder.

The project that I am working on (GEN_s32k142) was created earlier by one of my colleagues, I only took it over and checked it out from a Git repository.

The question is how to correct the empty value at the -T option now?

I already tried to add that missing linked resource to my project manually referencing to the following absolute path:

"C:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\platform\devices\S32K142\linker\gcc\S32K142_32_flash.ld" 

but it did not solve my problem and the -T option is still empty.

I would be curious how can I somehow force Design Studio to regenerate the missing linked resource (S32K1xx_flash.ld) ?

And after all how to achieve that the empty value of -T option gets corrected (either manually or automatically)?

Best regards,

Tibor

0 Kudos

3,022 Views
momo12
Contributor III

in my opinion this is a bug.

eclipse/design studio file ".cproject" gets corrupted some times

How to reproduce:

regenerate code again and again. This is a statistical bug.

Workaround: put every thing in git and commit ".cproject". regenerate code, incase you run into this bug, revert this file. Every thing should be fine.

0 Kudos

3,022 Views
momo12
Contributor III

Hi

Do I need to commit (in git) the args file as well?

Is there a gitignore file for s32 Design studio?

Does Design studio come wioth sopme sort of git integration ? So eclipse automatically knows what to add to git repository?

0 Kudos

3,022 Views
jiri_kral
NXP Employee
NXP Employee

The .args file is auto-generated and there is no reason to put it in git. In my opinion in your case was some issue with linker script - may be wrong path to script or the .ld file was not checked out properly from git. 

About eclipse git plugin - I'm not much familiar with it. But it is standard eclipse plugin and you can find more info in eclipse forum. S32DS is released without GIT plugin.  You need to install it manually. 

Jiri

0 Kudos