From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DB5B01A1DF6 for ; Tue, 23 Aug 2016 01:10:06 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 23 Aug 2016 01:10:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,565,1464678000"; d="scan'208,217";a="869773110" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 23 Aug 2016 01:10:08 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 23 Aug 2016 01:10:06 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 23 Aug 2016 01:10:05 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.116]) with mapi id 14.03.0248.002; Tue, 23 Aug 2016 16:10:05 +0800 From: "Shi, Steven" To: 'Bruce Cran' , 'Michael Zimmermann' CC: 'edk2-devel-01' Thread-Topic: [edk2] OVMF not booting when built with GCC5 toolset? Thread-Index: AQHR+WvODs8RqM0r3kuTqSLEDfrlf6BOal2AgAAAVQCAAR8LwIAASzIAgAADKYCABLdmQIABpqsw Date: Tue, 23 Aug 2016 08:10:04 +0000 Message-ID: <06C8AB66E78EE34A949939824ABE2B3103393385@shsmsx102.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> In-Reply-To: <06C8AB66E78EE34A949939824ABE2B310339057F@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: Tue, 23 Aug 2016 08:10:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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