From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5471E1A1E1B for ; Sun, 28 Aug 2016 23:45:13 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP; 28 Aug 2016 23:45:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,595,1464678000"; d="scan'208,217";a="2152156" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 28 Aug 2016 23:45:12 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 28 Aug 2016 23:45:12 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 28 Aug 2016 23:45:11 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.116]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.115]) with mapi id 14.03.0301.000; Mon, 29 Aug 2016 14:45:10 +0800 From: "Shi, Steven" To: 'Bruce Cran' , 'Michael Zimmermann' CC: 'edk2-devel-01' , "Lu, Hongjiu" Thread-Topic: [edk2] OVMF not booting when built with GCC5 toolset? Thread-Index: AQHR+WvODs8RqM0r3kuTqSLEDfrlf6BOal2AgAAAVQCAAR8LwIAASzIAgAADKYCABLdmQIABpqswgAAurRCACSj28A== Date: Mon, 29 Aug 2016 06:45:09 +0000 Message-ID: <06C8AB66E78EE34A949939824ABE2B3139178CF3@SHSMSX104.ccr.corp.intel.com> References: <8761c472-61cb-1968-ff1b-3bf1f04a67ad@cran.org.uk> <06C8AB66E78EE34A949939824ABE2B310338EB78@shsmsx102.ccr.corp.intel.com> <89202624-4ad5-9ff6-af36-49388985a8c5@cran.org.uk> <13f9450a-ac68-dca0-148e-ad9baf8380b6@cran.org.uk> <06C8AB66E78EE34A949939824ABE2B310339057F@shsmsx102.ccr.corp.intel.com> <06C8AB66E78EE34A949939824ABE2B310339351E@shsmsx102.ccr.corp.intel.com> In-Reply-To: <06C8AB66E78EE34A949939824ABE2B310339351E@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTE4NjA3Y2UtYTNhMy00ODk1LThkODEtODMxMWViNzYyZjQ2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ikw0azZjb1BaNDB2bHBuN2xpMGFcL1Z2QlpOejh3a0RTeVp1STI5ZnpVXC9zMD0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: OVMF not booting when built with GCC5 toolset? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 06:45:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Cran, This issue is just fixed in GCC main trunk. I tried below latest GCC trunk = version and it can pass build the edk2 with GCC5 toolset. FYI. $ gcc --version gcc (GCC) 7.0.0 20160828 (experimental) Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 From: Shi, Steven Sent: Tuesday, August 23, 2016 6:49 PM To: 'Bruce Cran' ; 'Michael Zimmermann' Cc: 'edk2-devel-01' ; Lu, Hongjiu Subject: RE: [edk2] OVMF not booting when built with GCC5 toolset? It's confirmed it is a GCC6 regression bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D70955 Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 From: Shi, Steven Sent: Tuesday, August 23, 2016 4:10 PM To: 'Bruce Cran' >; 'Michael Zi= mmermann' > Cc: 'edk2-devel-01' > Subject: RE: [edk2] OVMF not booting when built with GCC5 toolset? Hi Cran, This issue might be a GCC6 LTO regression bug, and I've filed a bug to GCC = community as below. Please don't use the GCC6 with edk2 GCC5 toolchain for = now, the GCC5 (gcc-5) should works. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D77341 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50818 GCC6.10 lto fails to support below MS ABI buildin of va list, but GCC5 work= s. This is a regression bug for GCC6. I suspect current GCC trunk also has = this regression bug. __builtin_ms_va_list ap; __builtin_ms_va_start (ap, n); __builtin_ms_va_end (ap); Below is my testcase: $cat test2.c #include int __attribute__((ms_abi)) foo (int n, ...) { __builtin_ms_va_list ap; int sum =3D 0; __builtin_ms_va_start (ap, n); while (n--) { sum +=3D __builtin_va_arg (ap, int); printf("sum =3D %d\n", sum); } __builtin_ms_va_end (ap); return sum; } int main () { int res =3D foo (10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); if (res !=3D 55) __builtin_abort (); return 0; } $ gcc --version gcc (GCC) 6.1.0 $ gcc -flto -Os test2.c $ ./a.out Segmentation fault (core dumped) $ gcc-5 -flto -Os test2.c $ ./a.out sum =3D 1 sum =3D 3 sum =3D 6 sum =3D 10 sum =3D 15 sum =3D 21 sum =3D 28 sum =3D 36 sum =3D 45 sum =3D 55 Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522