Skip to content
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

Compiler warnings... #87

Open
dl1bz opened this issue Feb 26, 2019 · 9 comments
Open

Compiler warnings... #87

dl1bz opened this issue Feb 26, 2019 · 9 comments

Comments

@dl1bz
Copy link

dl1bz commented Feb 26, 2019

with "make bl" I get compiler warnings with the linker:
arm-none-eabi-g++ obj_f1/DMRDMOTX.o obj_f1/IOSTM.o obj_f1/DMRTX.o obj_f1/POCSAGTX.o obj_f1/SerialArduino.o obj_f1/MMDVM_HS.o obj_f1/SerialPort.o obj_f1/DStarRX.o obj_f1/IO.o obj_f1/YSFTX.o obj_f1/DStarTX.o obj_f1/DMRIdleRX.o obj_f1/P25TX.o obj_f1/NXDNRX.o obj_f1/CalDMR.o obj_f1/Utils.o obj_f1/BitRB.o obj_f1/SerialRB.o obj_f1/IOArduino.o obj_f1/YSFRX.o obj_f1/DMRDMORX.o obj_f1/DMRSlotRX.o obj_f1/DMRRX.o obj_f1/DMRSlotType.o obj_f1/ADF7021.o obj_f1/NXDNTX.o obj_f1/CalRSSI.o obj_f1/I2CHost.o obj_f1/SerialSTM.o obj_f1/P25RX.o obj_f1/CWIdTX.o obj_f1/stm32f10x_i2c.o obj_f1/stm32f10x_rcc.o obj_f1/stm32f10x_usart.o obj_f1/misc.o obj_f1/stm32f10x_iwdg.o obj_f1/stm32f10x_gpio.o obj_f1/stm32f10x_exti.o obj_f1/system_stm32f10x.o obj_f1/startup_stm32f10x.o obj_f1/usb_serial.o obj_f1/usb_mem.o obj_f1/usb_cdcacm.o obj_f1/usb_init.o obj_f1/usb.o obj_f1/usb_reg_map.o obj_f1/usb_core.o obj_f1/usb_regs.o -Os --specs=nano.specs --specs=nosys.specs -T bootloader.ld -mcpu=cortex-m3 -march=armv7-m -mthumb -Wall -Wextra -o bin/mmdvm_f1bl.elf
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7-m/libstdc++_nano.a(new_opv.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7-m/libstdc++_nano.a(new_op.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7-m/libstdc++_nano.a(new_handler.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
Linking complete!

I don't know it's important - otherwise you need to check your code :)

73 Heiko, DL1BZ

@phl0
Copy link
Contributor

phl0 commented Feb 26, 2019

Seen those warnings before but couldn't find a solution. So as long as its just warnings ... Ignored them.

@dl1bz
Copy link
Author

dl1bz commented Feb 26, 2019

I found the correct solution by myself :)
Look here: https://community.nxp.com/thread/389154

Important to know:
"There is a standard know 'issue' with interworking code compiled with different toolchains, which is a result of the ARM AEABI documentation allowing the size of wchar_t to be compiler defined. GCC uses a wchar_t size of 4, but some other toolchains use a size of 2."

"you can solve this problem by simply adding the linker flag "-no-wchar-size-warning" " :))

73 Heiko, DL1BZ

@phl0
Copy link
Contributor

phl0 commented Feb 26, 2019

I see. Then we maybe should add this to he Makefile :)

@dl1bz
Copy link
Author

dl1bz commented Feb 26, 2019

yes that should be clear the warnings. I will check it and recompile.

@phl0
Copy link
Contributor

phl0 commented Feb 26, 2019

Seems not so easy. That command line option is for ld. But in Makefile g++ is used for linking. And that doesn't know "--no-wchar-size-warning" ....

@juribeparada
Copy link
Owner

Interesting the "-no-wchar-size-warning"...are you testing on Raspbian?. At least using latest arm gcc tools on macOS (the system where I build all the official fw binaries), I haven't seen those warnings. I always thought this warning issue was an arm gcc version related.

@phl0
Copy link
Contributor

phl0 commented Feb 26, 2019

Tested on my Ubuntu 18.04 x86_64 box here. The option seems to be only option for ld not for g++ ...

@juribeparada
Copy link
Owner

Are you testing on the common LDFLAGS variable?

@phl0
Copy link
Contributor

phl0 commented Feb 26, 2019

jepp.

$ git diff Makefile
diff --git a/Makefile b/Makefile
index f33af1f..dde6a18 100644
--- a/Makefile
+++ b/Makefile
@@ -200,7 +200,7 @@ LDFLAGS_F7 =-T stm32f7xx_link.ld $(MCFLAGS_F7) $(INCLUDES_LIBS_F7)
 # Common flags
 CFLAGS=-Os -ffunction-sections -fdata-sections -nostdlib -DCUSTOM_NEW -DNO_EXCEPTIONS -Wno-unused-parameter -nostdlib
 CXXFLAGS=-Os -fno-exceptions -ffunction-sections -fdata-sections -nostdlib -fno-rtti -DCUSTOM_NEW -DNO_EXCEPTIONS -Wno-unused-parameter
-LDFLAGS=-Os --specs=nano.specs --specs=nosys.specs
+LDFLAGS=-Os --specs=nano.specs --specs=nosys.specs --no-wchar-size-warning
 
 # Build Rules
 .PHONY: all release_f1 release_f4 release_f7 hs bl nobl pi-f4 f446 f767 clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants