espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.35k stars 1.57k forks source link

wolfssl 链接失败 (GIT8266O-626) #1049

Open imhmao opened 3 years ago

imhmao commented 3 years ago

msys32 + xtensa-lx106-elf 8.4.0 wolfssl examples\wolfssl_client 编译通不过

d:/msys32/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld.exe: D:/msys32/home/esp/ESP8266_RTOS_SDK/components/esp-wolfssl/wolfssl/lib\libwolfssl.a(integer.o).literal.mp_read_radix+0x0): undefined reference to `__ctype_ptr__'
d:/msys32/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld.exe: D:/msys32/home/esp/ESP8266_RTOS_SDK/components/esp-wolfssl/wolfssl/lib\libwolfssl.a(internal.o).literal.MatchDomainName+0x0): undefined reference to `__ctype_ptr__'
collect2.exe: error: ld returned 1 exit status
make: *** [D:\msys32\home\esp\ESP8266_RTOS_SDK/make/project.mk:5
mmorawiec commented 3 years ago

I got the same linker errors. It seems that the wolfssl was built using old toolchain 4.8.5, but should be rebuilt with new toolchain 8.4.0. The old toolchain contains the missing symbol:

$ xtensa-lx106-elf-nm -C --defined-only -g xtensa-lx106-elf-4.8.5/xtensa-lx106-elf/lib/libc.a | grep __ctype_ptr__ || echo not found
00000000 D __ctype_ptr__

but new one does not:

$ xtensa-lx106-elf-nm -C --defined-only -g xtensa-lx106-elf/xtensa-lx106-elf/lib/libc.a | grep __ctype_ptr__ || echo not found
not found

Could you please take a look at it and check if wolfssl binary rebuilt with new toolchain is required? I guess new binary can only be provided by espressif. I also tried to take library from esp-wolfssl repo which seems to be newer, but the integer.o fails as well.

hellozed commented 3 years ago

Same problem happens on Mac system.

Could anyone from Expressif help to commit a bug fix for this

KonssnoK commented 3 years ago

I solved by implementing my own CTYPE, which wolfSSL allows you to do:

in user_settings.h

#define CTYPE_USER #define XTOLOWER toLower #define XTOUPPER toUpper

zzzzccccbbbb commented 2 years ago

hi,friend,i try your idea,but the question is also exist.