Message ID | trinity-416d5e49-df05-4be7-940f-625eb4f9b23e-1569825928952@3c-app-gmx-bap76 |
---|---|
State | Not Applicable |
Delegated to: | Tom Rini |
Headers | show |
Series | [U-Boot] uboot 2014-04 + gcc7+ = crash in net_set_ip_header (ping/tftp) | expand |
Hi, it turns out that this optimization-option causes the crash: -fstore-merging so i use now "-Os -fno-store-merging" any idea why this flag causes the crash and how it can be fixed in code instead of compilerflag? regards Frank
diff --git a/Makefile b/Makefile index fa9cbd50df..6c62f921a9 100755 --- a/Makefile +++ b/Makefile @@ -546,7 +546,7 @@ else endif # $(dot-config) -KBUILD_CFLAGS += -Os #-fomit-frame-pointer +KBUILD_CFLAGS += -Os -mno-unaligned-access #-fomit-frame-pointer ifdef BUILD_TAG KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"' diff --git a/include/net.h b/include/net.h index 0802fad876..f16b44def6 100644 --- a/include/net.h +++ b/include/net.h @@ -273,7 +273,7 @@ struct ip_hdr { /* * Internet Protocol (IP) + UDP header. */ -struct ip_udp_hdr { +struct __attribute__((__packed__)) ip_udp_hdr { uchar ip_hl_v; /* header length and version */ uchar ip_tos; /* type of service */ ushort ip_len; /* total length */