PaulFreund / ESP32_Dlang_Template

Template project to run D code on ESP32
7 stars 0 forks source link

Does it compiles for ESP8266? #1

Open devbis opened 4 years ago

devbis commented 4 years ago

I modified Makefile and component.mk to run xtensa-lx106 binaries with -mcpu=esp8266 to compile binaries for the esp8266 processor. Unfortunately, it shows dangerous relocation: l32r error when compile. Common FreeRTOS-based code I can compile without any problem.

$ make
Toolchain path: /opt/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc
Toolchain version: crosstool-ng-1.22.0-100-ge567ec7
Compiler version: 5.2.0
Python requirements from /opt/ESP8266_RTOS_SDK/requirements.txt are satisfied.
App "ESP_IDF_Template" version: ea88a66-dirty
AR build/dcode/libdcode.a
Generating esp8266.project.ld
LD build/ESP_IDF_Template.elf
/Users/belokobylskiy/projects/esp/dlang/ESP32_Dlang_Template/build/dcode/dcodelib.a(dcode.o): In function `dlang_main':
dcode.d:(.text.dlang_main[dlang_main]+0x11): dangerous relocation: l32r: misaligned literal target: .literal
dcode.d:(.text.dlang_main[dlang_main]+0x16): dangerous relocation: l32r: misaligned literal target: (.literal+0x4)
collect2: error: ld returned 1 exit status
make: *** [/Users/belokobylskiy/projects/esp/dlang/ESP32_Dlang_Template/build/ESP_IDF_Template.elf] Error 1
MBP-Ivan-105:ESP32_Dlang_Template belokobylskiy$
PaulFreund commented 4 years ago

Hi,

I'm not so much familiar with the ESP8266 but maybe this page https://stackoverflow.com/questions/19532826/what-does-a-dangerous-relocation-error-mean can help a little bit. The first answer contains a few interresting suggestions.