RTEMS has FreeBSD style structures: Sockaddr and Sockaddr_In should have the 8bit Len and Family variable instead of 16 family in gcc/ada/socthi.ads. Bug prevents at least binding local address to socket, connecting tcp socket or sending udp data. diff g-socthi.ads g-socthi-rtems.ads 145c145,146 < Sa_Family : C.unsigned_short; --- > Sa_Len : C.unsigned_char; > Sa_Family : C.unsigned_char; 156c157,158 < Sin_Family : C.unsigned_short := Constants.AF_INET; --- > Sin_Len : C.unsigned_char := 0; > Sin_Family : C.unsigned_char := Constants.AF_INET; diff g-socthi.adb g-socthi-rtems.adb 451c451 < Sin.Sin_Family := C.unsigned_short (Family); --- > Sin.Sin_Family := C.unsigned_char (Family);
This does not impact the SVN trunk. This requires adding g-socthi-rtems.ads and corresponding Makefile.in change. I will prepare and test a complete patch. We wondered if this is broken for FreeBSD as well. We use the FreeBSD TCP/IP stack in RTEMS and it should be broken the same way. Can someone confirm that?
Created attachment 16626 [details] adds RTEMS specific g-socthi* Fixes issue. Not needed on head.
Please commit to 4.3 branch. Not needed on trunk since it uses a different implementation of these files. 2008-11-05 Joel Sherrill <joel.sherrill@oarcorp.com> * g-socthi-rtems.ad[sb]: New files. * Makefile.in: Add RTEMS specific files.
Was the patch posted on gcc-patches@ at some point?
(In reply to comment #4) > Was the patch posted on gcc-patches@ at some point? > It has been over a year and I honestly don't know. I will repost on general principal.
Obsolete.