From patchwork Mon Sep 30 06:45:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 1169141 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=public-files.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="KzCdfsJf"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46hXwQ05Ykz9sP7 for ; Mon, 30 Sep 2019 16:45:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A19EEC21E2B; Mon, 30 Sep 2019 06:45:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0FDFDC21CB6; Mon, 30 Sep 2019 06:45:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 06C68C21CB6; Mon, 30 Sep 2019 06:45:30 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lists.denx.de (Postfix) with ESMTPS id EC019C21C2F for ; Mon, 30 Sep 2019 06:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1569825929; bh=yb66tvsyDtzU2PMaMNlPVHZv4Zw72ko0mxaUOKBSI70=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=KzCdfsJfiPTorXjxhpKKSrb0lp/2pCxhOb2UgAGIGWxsxle6ljH8ovELzLeSYnW1k 0Z3AycOMb5AD1AJVOGamDt2l5F3/ez7bVrog8ZQTe+5pBpYy3gvPPal7GdHY5kI5V+ YoRNhM4ZaLiLMBqZECTYF9uRPdkNxA4sCIHNSsoY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [80.208.215.36] ([80.208.215.36]) by web-mail.gmx.net (3c-app-gmx-bap76.server.lan [172.19.172.64]) (via HTTP); Mon, 30 Sep 2019 08:45:28 +0200 MIME-Version: 1.0 Message-ID: From: "Frank Wunderlich" To: "Tom Rini" Date: Mon, 30 Sep 2019 08:45:28 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:xCGgOoKRPyNKb5sEwwUDr06ngICWbmUSZjx1Mb5M4ijiD053q8D/WyD3JyGCZ8L7JAEc/ uq83fJbq+H3WBXwn7K/RemuhLWXAFHJAG7geEv9eD9BiE6gfuI1FXmAyEpZnoepmu5yyhwDNMP6X XAaaB9qt2g1Su4GF4tlxZUy3OgeehtX1HCI3NUHR5pgKKXHgwar/nCR/cVtOqESEHFgTC8i/502u hjoA9jHIs4pKvlYbzxg5s8DHtX4FQrx4bb0eqKy1GDLSXA/V2trb2F9NyWbR4OAaMEtv7CY8VoK5 cY= X-UI-Out-Filterresults: notjunk:1; V03:K0:XrrepFzPn8k=:45wdsIMYuyxTuc3rVytYzx 5Sqss9KIL9EBTaeIs05UnGezNNh+QNPWez50blBaocgOzelMklWTjugXKoqNNOioJL2VMt1qb tyG5LL0G0+/Wbl9sHuaifT+UffWvm688InU9SVsVQwImNrnPj3MNqpW/zsTyK0uKmdsZ/TS7O +kxhjSAXqjaLbsmfvKpg1UrFZaBd/G1PqbPavDwTFxglHJwHinFWmXKJK1sTOuqMxwsCPNljj i5iadbV/Sq4Yy9thhV8u5jQlYCofh+n16rhC535QLf4oKenOCpCFaaWG58vHG37QZvv6ijJs/ UWpciK8YBIIvyvSbsbomUAqhUMz8/Kca0MpLbhMt5cvkKHU11t1+jqb2rtJ3zAQ4fWWzHsS39 T+ZwDK1f2B1/Gz1ZMbStHAfDRMC1UC0VTDDrLuLKecIgZYGp+fPww8sLqVXczRqz1Z8sv8sRt kPusigGlmpVFUAxr7hHjOYT60qejMoPuwBUDHOQvdGnRphztOM+VuDULMfvmaRgASiCbHSPNG wL8xZ+aMYF9lyXvb3rcw+s1KSCDFk/HdaB5U7udnu+kPTFoRc6mkZS6V536blWhAll96VNE9t RllkJeyX+zD1EXilzuDf7PzQFP24mhnjct5NcqopUMhuPzAbNzoqesIBssc16m5uOdV/ss8+t lbXRzTW7bamB6p6WAU0xHnfLsFfK2oUdDJdlasxSLeVc2sczuZGLn8fIu4w0uJY+0SCA= Cc: u-boot@lists.denx.de Subject: [U-Boot] uboot 2014-04 + gcc7+ = crash in net_set_ip_header (ping/tftp) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hi, i'm facing a problem in older uboot-code which may be fixed on newer, but i did not found the fixing commit yet. Maybe you can point me to it. I need to use older code in this case because driver for mt7622 and other is not yet available for upstream uboot. I have temporary changed optimization from -Os to -O1 which "fixes" the issue, currently i don't know why. Maybe you know more about it I have found this Thread and tried to fix it with the packed-variant, but same crash happens again http://u-boot.10912.n7.nabble.com/Data-Abort-with-gcc-7-1-td298217.html my code (without last commit): https://github.com/frank-w/u-boot/tree/bpi-r64 my try to fix: board is Bananapi R64 v0.1 (with rtl8367), code works with gcc4.8, 5.5, 6.3, but not with 7.3 and 8.3 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 */