Forum > Embedded
Problem linking for Xtensa (ESP32)
electronickiwi:
I've been following the instructions at https://wiki.lazarus.freepascal.org/Xtensa, and getting stuck at compiling a test program.
I've got the following error message coming up when I try and do the cross-compile for xtensa-freertos. (I'm running on Windows)
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---helloworld.pp(8,17) Error: Can't call the linker, switching to external linkinghelloworld.pp(8,17) Error: Error while linkinghelloworld.pp(8,17) Fatal: There were 2 errors compiling module, stoppingFatal: Compilation aborted
I'm running the following command, adapted from the command in the wiki
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---C:\lazarus\fpc\fpc>compiler\ppcrossxtensa -Furtl\units\xtensa-freertos\ -Tfreertos -XPxtensa-esp32-elf- -O3 -Wpesp32 -FlC:\Users\Wes\esp\xtensa-esp32-elf-libs -FlC:\Users\Wes\.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf\xtensa-esp32-elf\lib\ helloworld
I can run the command
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---C:\lazarus\fpc\fpc>xtensa-esp32-elf-ld and I get
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---xtensa-esp32-elf-ld: no input files, which I think means that the appropriate binutils are on my path.
Any ideas?
Wes
TRon:
--- Quote ---helloworld.pp(8,17) Error: Can't call the linker, switching to external linking
--- End quote ---
That msg seems to suggest that you haven't setup your configuration for crosscompiling correctly
--- Quote ---helloworld.pp(8,17) Error: Error while linking
--- End quote ---
That msg seems to suggest that fpc is unable to locate your linker. That is also configuration related.
edit: So, were is your fpc.cfg ? ;D
Sorry, i overlooked the fact that you are invoking the crosscompiler directly :-[ (2x fpc in there )
By default there is a define named NEEDCROSSBINUTILS, which adds a prefix to the name of the binutil it wants to invoke:
<redundancy removed>
Does the name then still match ?
You can add the option -vt to your parameters for compilation (which results in more output from the compiler) in order to see what linker FPC is looking for and if FPC is able to find it. The -vt option actually outputs information on every file FPC attempts to locate.
Furthermore you can use the option -FD (inside your configuration file as well) to add the path to your binutils , which makes it redundant to add this path to your path environment variable.
ccrause:
--- Quote from: TRon on May 09, 2020, 07:23:20 am ---You can add the option -vt to your parameters for compilation (which results in more output from the compiler) in order to see what linker FPC is looking for and if FPC is able to find it. The -vt option actually outputs information on every file FPC attempts to locate.
--- End quote ---
+1. Difficult to troubleshoot if you don't know exactly what the compiler was looking for and where.
Since you didn't specify the binutils prefix, the compiler may have assumed a different prefix (such as xtensa-freertos-). You can also set the prefix to the binutils explicitly with the -XP option. You can also use -XP to specify the path+prefix, I guess on your installation it will be something along the lines of:
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ----XPC:\Users\Wes\.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf/bin/xtensa-esp32-elf-EDIT: probably qualifies for the WoMM certification :-[.
--- Quote ---Furthermore you can use the option -FD (inside your configuration file as well) to add the path to your binutils , which makes it redundant to add this path to your path environment variable.
--- End quote ---
This option sets the path to compiler utils, not binutils.
EDIT: As others pointed out this is incorrect!
marcov:
XP is only for the prefix. Paths to binutils should be set with -FD
PascalDragon:
--- Quote from: ccrause on May 09, 2020, 09:24:42 am ---
--- Quote from: TRon on May 09, 2020, 07:23:20 am ---You can add the option -vt to your parameters for compilation (which results in more output from the compiler) in order to see what linker FPC is looking for and if FPC is able to find it. The -vt option actually outputs information on every file FPC attempts to locate.
--- End quote ---
+1. Difficult to troubleshoot if you don't know exactly what the compiler was looking for and where.
Since you didn't specify the binutils prefix, the compiler may have assumed a different prefix (such as xtensa-freertos-). You can also set the prefix to the binutils explicitly with the -XP option. You can also use -XP to specify the path+prefix, I guess on your installation it will be something along the lines of:
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ----XPC:\Users\Wes\.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf/bin/xtensa-esp32-elf-
--- Quote ---Furthermore you can use the option -FD (inside your configuration file as well) to add the path to your binutils , which makes it redundant to add this path to your path environment variable.
--- End quote ---
This option sets the path to compiler utils, not binutils.
--- End quote ---
You're wrong. -FD is the path to the binutils, while -XP is only the filename's prefix.
Navigation
[0] Message Index
[#] Next page