Linker Error: No linker script

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

Linker Error: No linker script

3,798 Views
curtis_hendrix
Contributor I

I have a project that I've imported, and I can build from the command line using our own build script (posted below), but I cannot build from within MCUXpresso.  The error I get is:

Internal: No linker script for vendor=NXP proc=cortex-m0plus nature=0, project=<project name>

The build script is

SET TOOLCHAIN_PATH=C:\nxp\MCUXpressoIDE_10.3.1_2233\ide\tools\bin
SET IDE=C:\nxp\MCUXpressoIDE_10.3.1_2233\ide\mcuxpressoidec.exe

"%IDE%" -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data "c:\workspace" -import %~dp0Working\<project folder>

"%IDE%" -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data "c:\workspace" -cleanBuild <project folder>/Debug

0 Kudos
14 Replies

3,634 Views
soledad
NXP Employee
NXP Employee

Hi, 

Do you still need help? Is it possible to share the files to reproduce the issue? 

Regards 

Soledad

0 Kudos

3,634 Views
curtis_hendrix
Contributor I

Any help on this would be appreciated.

0 Kudos

3,634 Views
BlackNight
NXP Employee
NXP Employee

Does it work if you do it in 'interactive' mode (with the IDE GUI)?

And it would be helpful if you could share the files to reproduce this.

Erich

0 Kudos

3,499 Views
cjwood
Contributor I

I see a similar problem, and the problem doesn't exist when doing it from an interactive account.

I see that when triggered from the command line, by our build system, under a non-interactive account, the workspace is created and projects are imported, the build is kicked off and makefiles are auto-generated, and at the end the build fails during linker stage with: 

../arm-none-eabi/bin/ld.exe: cannot open linker script file *projectname*_Debug.ld: No such file or directory

Another observation: The project references are also ignored - only the named project is built. This also works when run from an interactive account.

0 Kudos

3,487 Views
converse
Senior Contributor V

What is your command line?

0 Kudos

3,475 Views
cjwood
Contributor I

 

It is written in powershell:

$WorkspaceDir = "$PSScriptRoot\..\..\Workspaces\BuildScriptWS"
$ProjectsDir = "$PSScriptRoot\..\..\Projects"
$MCUInstallBaseDir = "C:\nxp\MCUXpressoIDE_11.3.1_5262"

echo "Creating workspace at $WorkspaceDir"
cmd /c "$MCUInstallBaseDir\ide\mcuxpressoidec.exe -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ""$WorkspaceDir"" -import ""$ProjectsDir\MyProj"" -import ""$ProjectsDir\MyProj_Library"" -import ""$ProjectsDir\MyProj_Bootloader"" -import ""$ProjectsDir\MyProj_bsp"" 2>&1"
if ($LASTEXITCODE -ne 0) { $(throw "Failed to create workspace" ) }

echo "Building $BuildConfiguration Application"
cmd /c "$MCUInstallBaseDir\ide\mcuxpressoidec.exe -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ""$WorkspaceDir"" -build MyProj/$BuildConfiguration 2>&1"
if ($LASTEXITCODE -ne 0) { $(throw "Failed to build Application" ) }

 

0 Kudos

3,466 Views
converse
Senior Contributor V

What is BuildConfiguration?

have you tries -cleanBuild (instead of -build)?

0 Kudos

3,452 Views
cjwood
Contributor I

My Apologies, $BuildConfiguration = "Debug"

I have now also tried with -cleanBuild. I have also written the equivalent in a batch script and I see the same result.

0 Kudos

3,443 Views
converse
Senior Contributor V

Can you share the output from the command? At least the linker command and the error messages. Also look to see if a linker script has been generated (anywhere?). I know this works for me, but I am not on the latest and greatest version of MCUXpresso.

0 Kudos

3,429 Views
cjwood
Contributor I

The command and output are shown here. When run off the back of a TFS build agent I can see that the makefiles are generated but the linker script is not. When I run the same script locally I see the makefiles and linker scripts are generated as expected.

arm-none-eabi-c++ -nostdlib -Xlinker -Map="MyProj.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -Xlinker --sort-section=alignment -Xlinker --cref -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -T MyProj_Debug.ld -o "MyProj.axf" ./xip/evkmimxrt1170_flexspi_nor_config.o ./xip/fsl_flexspi_nor_boot.o ./source/fpga.o ./source/main.o ./source/semihost_hardfault.o ./flexspi/flexspi_hyperbus_ops.o ./flexspi/flexspi_nor_flash_ops.o ./OpenRTOS/kernel_source/portable/MemMang/heap_2.o ./OpenRTOS/kernel_source/portable/GCC/ARM_CM4F/port.o ./OpenRTOS/kernel_source/croutine.o ./OpenRTOS/kernel_source/event_groups.o ./OpenRTOS/kernel_source/list.o ./OpenRTOS/kernel_source/queue.o ./OpenRTOS/kernel_source/stream_buffer.o ./OpenRTOS/kernel_source/tasks.o ./OpenRTOS/kernel_source/timers.o ./OpenRTOS/OpenRTOS_Trace/trcBase.o ./OpenRTOS/OpenRTOS_Trace/trcHardwarePort.o ./OpenRTOS/OpenRTOS_Trace/trcKernel.o ./OpenRTOS/OpenRTOS_Trace/trcKernelPort.o ./OpenRTOS/OpenRTOS_Trace/trcUser.o ./OpenRTOS/OpenRTOSAbstraction/CHookFunctions.o ./OpenRTOS/OpenRTOSAbstraction/CPPHookFunctions.o ./OpenRTOS/OpenRTOSAbstraction/VMutex.o ./OpenRTOS/OpenRTOSAbstraction/VRTOS.o ./OpenRTOS/OpenRTOSAbstraction/VSemaphore.o ./OpenRTOS/OpenRTOSAbstraction/VTask.o ./OpenRTOS/OpenRTOSAbstraction/VTick.o ./OpenRTOS/OpenRTOSAbstraction/vqueue.o ./HAL/FlashInterface.o ./HAL/HDLCHardware.o ./HAL/PowerSourceInterface.o ./HAL/Wdog.o ./HAL/WdogInterface.o ./HAL/codrv_can_flexcan.o ./HAL/codrv_canbittiming.o ./HAL/codrv_cpu.o ./HAL/codrv_error.o ./HAL/hal_exceptions.o ./HAL/hal_id.o ./HAL/hal_interrupts.o ./HAL/hal_led.o ./HAL/hal_timer.o ./HAL/hyperbus.o ./Builder/Coordinator.o ./Builder/ProdData.o -lMyProj_CANopen -lMyProj_bsp -lMyProj_Library
c:/nxp/mcuxpressoide_11.3.1_5262/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.3.0.202008311133/tools/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: cannot open linker script file MyProj_Debug.ld: No such file or directory
0 Kudos

3,419 Views
converse
Senior Contributor V

If this problem only happens with TFS, then I suggest you look there for the problem. Maybe permissions? Maybe firewall? I don't know, just throwing out ideas.

0 Kudos

3,411 Views
cjwood
Contributor I

I appreciate the help so far. Another route I want to try is running the TFS build agent in interactive mode (an interactive Windows user account) rather than as a service. I suspect this issue is caused by running via a service. However, this is difficult to set up with our IT infrastructure so will take some time to achieve.

0 Kudos

3,400 Views
converse
Senior Contributor V

If it helps, we use Jenkins (on Mac, Windows and Linux) and have no problems.

0 Kudos