-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable libstdc++ #144
Enable libstdc++ #144
Conversation
…ith crosstool-ng.xtensa-1.22.x. Added romized version of libstdc++
…GI STL tests port added
@@ -7,7 +7,7 @@ | |||
url = https://github.com/tommie/lx106-hal | |||
[submodule "esptool"] | |||
path = esptool | |||
url = https://github.com/pfalcon/esptool | |||
url = https://github.com/themadinventor/esptool.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't plan to switch to upstream repo. See espressif/esptool#89 (comment) why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i see the reason. Does this mean that your esptool fork stays where it is not pulling changes from the origin? What about quite useful ones like cooking OTA images?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course no, I pull changes in (from time to time, especially after prodding), maintain my own changes on top from time to time, and hope to never need to revert anything (but still reserve a room for). I just pulled bunch of changes, would like to test them first before pulling the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Looking forward to other comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "--version=2" changes are needed. Without them there is no way to create a >512KB image (like the one sgi tests produce). Of course we could create a linker script which would create canonical 0x00000/0x40000 image of 1MB+ size but using OTA images and 1/2/4MB linker scripts already provided by Espressif seems to be a better solution, doesn't it?
-mlongcalls was missing from the libstdc++ build, newlib has always been built with that flag.
IIRC there were only link failures. |
@@ -164,7 +163,7 @@ _libhal: | |||
|
|||
libnlport: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libnlport.a | |||
|
|||
$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libnlport.a: $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc | |||
$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libnlport.a: $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc sdk sdk_patch toolchain standalone | |||
make -C esp_newlib_port -f ../Makefile _libnlport | |||
cp -f esp_newlib_port/libnlport.a $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libnlport.a | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch should probably be folded into the "Build procedure for libnlport.a. esp_newlib_port switched to lx106 branch".
Guys, please let me know if there are more comments to come. If not i'll prepare another pull request taking into account the hints you've already made. |
What about 1000-mforce-l32.patch? Do we still need it in GCC 4.8.5? |
It adds a switch to compiler that forces it to read 8- and 16-bit wide data with aligned 32-bit wide loads. May be used to access char/short data in FLASH/IRAM without source code changes. See SuperHouse/esp-open-rtos#11 I don't have other review comments, and those that I made are of course just suggestions based on personal maintenance habits. |
Sorry, one more note: libnl is a well-known name for netlink library, you should probably choose a different name for newlib glue. |
ok, let me rename it to libnewlibport, no better naming i can suggest ) |
Closing this one down since I raised a refined pull request #146 |
What was the goal?
The goal was letting developers use libstdc++ in esp-open-sdk environment
What had to be done?
The configuration of crosstool-NG (for the revision esp-open-sdk pulled in) was incorrect to some extent. Particularly newlib was built without -mlongcalls and with internal memory management routines, libstdc++ was built without -fno-exceptions and -fno-rtti. This caused STL-based code fail to compile and link. These issues had to be fixed prior to compiling any STL code.
What has been done?
In order to make STL code compilable and executable on esp8266 a handful of things were done. Many of them have their on value even boyond STL context. They are:
Doubts
There is a patch called 1000-mforce-l32.patch which initially was applied to GCC 4.8.2. I reaimed it to GCC 4.8.5 which is built by the new version of crosstool-NG, but since i don't know why this patch was initially applied to 4.8.2 i doubt if it's necessary for 4.8.5.