-
Notifications
You must be signed in to change notification settings - Fork 20
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
Compiling TeensyDebug with -Os not possible #10
Comments
Those are strange errors. What version of Arduino and Teensyduino are you using? Did you download TeensyDebug from here or are you using the one that comes with Teensyduino? How exactly are you compiling this? |
I also find it strange.
I noticed the same warning ( Best Regards |
I just committed a change that may fix this. It was caused by using different optimization levels between the function definitions and saving function pointers. If you have time, please update and try this. |
I took the latest master.zip and still have the same result:
I noticed there are still some optimization pragmas in the code: #pragma GCC push_options
#pragma GCC optimize ("O0") Maybe there is a way to skip them all or to guard both files with the pragma. What do you think? |
You have to "pull" from github to get the changes. master.zip hasn't been
updated.
…On Tue, Jan 4, 2022 at 3:05 PM danie1kr ***@***.***> wrote:
I took the latest master.zip and still have the same result:
Using library TeensyDebug version 0.0.1 in folder "file:///C:/Users/daniel/Documents/Arduino/libraries/TeensyDebug"
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -Og -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=155 -DARDUINO=108016 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_DUAL_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Users\daniel\AppData\Local\Temp\VMBuilds\winston-teensy\teensy41\Debug/pch" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" -I"c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\itelwv1j.wbw\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Users\daniel\Documents\Arduino\libraries\WebSockets2_Generic\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\NativeEthernet\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FNET\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat\src" -Os -I"D:\proj\dev\uc\winston\winston\winston-teensy" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\libwinston" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\winston" -I"D:\proj\dev\uc\winston\winston\winston-teensy" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\libwinston" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\winston" -DVM_DEBUG_BREAKPAUSE -DVM_DBT=VM_DBT_GENERIC_OBJECT -DVM_DEBUGGER_SOFT_TRANSPORT_WRITER=Serial -DVM_DEBUGGER_SOFT_TRANSPORT=Serial -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=100 -DVM_DEBUG -DVM_DEBUG_ENABLE=1 -DVM_DBT_GENERIC_OBJECT=21 -DVM_DBT_NO_SERIAL=20 -DVM_DBT_MS430_SERIAL_=19 -DVM_DBT_SERIALUSB=18 -DVM_DBT_USBAPI=17 -DVM_DBT_NET_UDP=16 -DVM_DBT_HARDWARESERIAL3=15 -DVM_DBT_HARDWARESERIAL2=14 -DVM_DBT_HARDWARESERIAL1=13 -DVM_DBT_CDCSerialClass=12 -DVM_DBT_COSA=11 -DVM_DBT_Uart=10 -DVM_DBT_NET_CONSOLE=9 -DVM_DBT_TTYUART=8 -DVM_DBT_USBSERIAL=7 -DVM_DBT_USART=6 -DVM_DBT_UART=5 -DVM_DBT_TEENSY=4 -DVM_DBT_USB=3 -DVM_DBT_FASTSERIAL=2 -DVM_DBT_SOFTWARESERIAL=1 -DVM_DBT_HARDWARESERIAL=0 -DTL_NAMESPACE=std -DWINSTON_PLATFORM_TEENSY -DTCB_SPAN_NAMESPACE_NAME=std -I"C:\Users\daniel\Documents\Arduino\libraries\TeensyDebug\src" "C:\Users\daniel\Documents\Arduino\libraries\TeensyDebug\src\gdbstub.cpp" -o "C:\Users\daniel\AppData\Local\Temp\VMBuilds\winston-teensy\teensy41\Debug\TeensyDebug\gdbstub.cpp.o"
gdbstub.cpp: In function void gdb_init(Stream*)
gdbstub.cpp: 1186:36: warning: invalid conversion from 'void (*)()' to 'void (*)()' [-fpermissive]
debug.setCallback(process_onbreak)
gdbstub.cpp:19: In file included from
TeensyDebug.h:139: note initializing argument 1 of void Debug setCallback(void (*)())
void setCallback(void (*c)())
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -Og -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=155 -DARDUINO=108016 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_DUAL_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Users\daniel\AppData\Local\Temp\VMBuilds\winston-teensy\teensy41\Debug/pch" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" -I"c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\itelwv1j.wbw\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Users\daniel\Documents\Arduino\libraries\WebSockets2_Generic\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\NativeEthernet\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FNET\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat\src" -Os -I"D:\proj\dev\uc\winston\winston\winston-teensy" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\libwinston" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\winston" -I"D:\proj\dev\uc\winston\winston\winston-teensy" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\libwinston" -I"D:\proj\dev\uc\winston\winston\winston-teensy\..\winston" -DVM_DEBUG_BREAKPAUSE -DVM_DBT=VM_DBT_GENERIC_OBJECT -DVM_DEBUGGER_SOFT_TRANSPORT_WRITER=Serial -DVM_DEBUGGER_SOFT_TRANSPORT=Serial -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=100 -DVM_DEBUG -DVM_DEBUG_ENABLE=1 -DVM_DBT_GENERIC_OBJECT=21 -DVM_DBT_NO_SERIAL=20 -DVM_DBT_MS430_SERIAL_=19 -DVM_DBT_SERIALUSB=18 -DVM_DBT_USBAPI=17 -DVM_DBT_NET_UDP=16 -DVM_DBT_HARDWARESERIAL3=15 -DVM_DBT_HARDWARESERIAL2=14 -DVM_DBT_HARDWARESERIAL1=13 -DVM_DBT_CDCSerialClass=12 -DVM_DBT_COSA=11 -DVM_DBT_Uart=10 -DVM_DBT_NET_CONSOLE=9 -DVM_DBT_TTYUART=8 -DVM_DBT_USBSERIAL=7 -DVM_DBT_USART=6 -DVM_DBT_UART=5 -DVM_DBT_TEENSY=4 -DVM_DBT_USB=3 -DVM_DBT_FASTSERIAL=2 -DVM_DBT_SOFTWARESERIAL=1 -DVM_DBT_HARDWARESERIAL=0 -DTL_NAMESPACE=std -DWINSTON_PLATFORM_TEENSY -DTCB_SPAN_NAMESPACE_NAME=std -I"C:\Users\daniel\Documents\Arduino\libraries\TeensyDebug\src" "C:\Users\daniel\Documents\Arduino\libraries\TeensyDebug\src\TeensyDebug.cpp" -o "C:\Users\daniel\AppData\Local\Temp\VMBuilds\winston-teensy\teensy41\Debug\TeensyDebug\TeensyDebug.cpp.o"
TeensyDebug.cpp: In function void debug_init()
TeensyDebug.cpp: 1198:38: warning: invalid conversion from 'void (*)()' to 'void (*)()' [-fpermissive]
original_svc_isr = _VectorsRam[11]
TeensyDebug.cpp: 1200:19: warning: invalid conversion from 'void (*)()' to 'void (*)()' [-fpermissive]
_VectorsRam[11] = svcall_isr
Error compiling libraries
TeensyDebug.cpp: 1203:56: warning: invalid conversion from 'void (*)()' to 'void (*)()' [-fpermissive]
Debug build failed for project 'winston-teensy'
original_software_isr = _VectorsRam[IRQ_SOFTWARE + 16]
TeensyDebug.cpp: 1205:34: warning: invalid conversion from 'void (*)()' to 'void (*)()' [-fpermissive]
_VectorsRam[IRQ_SOFTWARE + 16] = debug_call_isr
TeensyDebug.cpp: At global scope
TeensyDebug.cpp: 1273:6: error: prototype for 'void Debug::setCallback(void (*)())' does not match any in class 'Debug
void Debug*: setCallback(void (*c)()) { callback = c; }
TeensyDebug.cpp:38: In file included from
TeensyDebug.h: 139:8: error: candidate is: void Debug::setCallback(void (*)())
void setCallback(void (*c)())
I noticed there are still some optimization pragmas in the code:
#pragma GCC push_options
#pragma GCC optimize ("O0")
Maybe there is a way to skip them all or to guard both files with the
pragma. What do you think?
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRWXIUBDH5LL6ADWRDSM7TUUNHGZANCNFSM5KZL2HBQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Good morning, I downloaded the code and it had your latest commits in place. |
Hi,
I wanted to minimize the footprint of all code including TeensyDebug with the -Os option.
This results in the following error messages:
The compiler command lines were:
Adding
to both files resolved the issue for me.
Maybe, you can look into this.
Best Regards
Daniel
The text was updated successfully, but these errors were encountered: