AnsweredAssumed Answered

Integrating Diab Compiler with S32DS

Question asked by Jyothsna Rajan on Sep 16, 2019
Latest reply on Sep 23, 2019 by Jyothsna Rajan

Hi,

I want to modify the S32DS environment to use Diab compiler instead of  (default) GNU compiler. I have made all the changes to environment variables and am able to invoke the Diab compiler but am facing several issues as below:

 

1. I used the MPC5745R_Flash.dld file that is supplied by NXP for use with Diab, Following this note in the dld file

        "/* Linker symbols can be modified by using -MD as parameter
         * when linker is called. This requires the preprocessor
         * to be enabled for linker scripts - "-Xpreprocess-lecl" parameter
         * must be added to the linker command line
         */

I added the flag -Xpreprocess-lecl to the linker command line as below, but I still get the error below

 

Invoking: Diab C Linker
dcc -Wl, -Xpreprocess-lecl -Wm ../Project_settings/Linker_Files/MPC5745R_Flash.dld -Xdialect-c99 -tPPCE200Z425N3VEF:simple -m31 > link.map d -o MPC5745R_DiabCompilerTest.ELF 

.....    

-lc -ld
dld: parse error in ../Project_settings/Linker_Files/MPC5745R_Flash.dld line 35:
dld: error: #
C:\WindRiver\utilities\x86-win32\bin\make.exe: *** [MPC5745R_DiabCompilerTest.ELF] Error 1

 

Per note in the dld file,  using flag -Xpreprocess-lecl should preprocess the macros and hence "#" should not be an error.

 

 

2. Linker error:

dld: Redeclaration of _start
Defined in C:\WINDRI~1\COMPIL~1\DIAB-5~1.0\PPCVLEE\crt0.o
and ./Project_Settings/Startup_Code/startup_MPC5745R.o
dld: error: -Xstop-on-redeclaration is on. Linking aborted

 

The startup_MPC5745R .s file is attached. When I remove the "_start: " in this file, the error goes away but then I am probably using the wrong entry point. 

 

Looking for an example that demonstrates how to successfully integrate Diab compiler with S32DS.

 

Thank you

 

Erich Styger

Stanislav Sliva

Alex Peck

Outcomes