Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-07 Thread Laszlo Ersek
On 12/04/15 20:20, Daryl McDaniel wrote: > On Friday, December 04, 2015, Laszlo Ersek wrote: >> Now, after reading the -fno-common documentation in the gcc manual, I'm >> actually *convinced* this is a gcc bug. The manual says on my RHEL-7.2 >> system (excerpt): >> >>-fno-common >>

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-06 Thread Ard Biesheuvel
On 6 December 2015 at 09:03, Jordan Justen wrote: > On 2015-12-05 22:26:53, Ard Biesheuvel wrote: >> On 6 December 2015 at 01:44, Jordan Justen wrote: >> > On 2015-12-04 11:21:18, Ard Biesheuvel wrote: [...] >> >> Is this a clean rebuild? >>

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-06 Thread Jordan Justen
On 2015-12-05 22:26:53, Ard Biesheuvel wrote: > On 6 December 2015 at 01:44, Jordan Justen wrote: > > On 2015-12-04 11:21:18, Ard Biesheuvel wrote: > >> On 4 December 2015 at 20:13, Jordan Justen > >> wrote: > >> > On 2015-12-04 08:43:29,

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-05 Thread Ard Biesheuvel
On 6 December 2015 at 01:44, Jordan Justen wrote: > On 2015-12-04 11:21:18, Ard Biesheuvel wrote: >> On 4 December 2015 at 20:13, Jordan Justen wrote: >> > On 2015-12-04 08:43:29, Ard Biesheuvel wrote: >> >> On 4 December 2015 at 17:27,

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-05 Thread Jordan Justen
On 2015-12-04 11:21:18, Ard Biesheuvel wrote: > On 4 December 2015 at 20:13, Jordan Justen wrote: > > On 2015-12-04 08:43:29, Ard Biesheuvel wrote: > >> On 4 December 2015 at 17:27, Laszlo Ersek wrote: > >> > On 12/04/15 17:23, Paolo Bonzini wrote: >

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Ard Biesheuvel
On 4 December 2015 at 10:17, Gao, Liming wrote: > Good fix. How do you find this issue? > I got build failures with RVCT when using the UEFI Secure Boot versions of VariableRuntimeDxe. Could you check how VS deals with this? I.e., if the two copies of

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Gao, Liming
Good fix. How do you find this issue? Reviewed-by: Liming Gao -Original Message- From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] Sent: Thursday, December 03, 2015 8:54 PM To: edk2-devel@lists.01.org; Justen, Jordan L; Gao, Liming; Zhu, Yonghong Cc: Ard

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Gao, Liming
Ard: I check VS build. Two copies of mVirtualAddressChangeEvent are mapped to the same memory location. For RuntimeDxe case, it doesn't cause any issue, because their notification function doesn't use Event. I agree this is a potential issue. But, VS and GCC compiler doesn't report

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Laszlo Ersek
On 12/03/15 13:54, Ard Biesheuvel wrote: > The default behavior of the GCC compiler is to emit uninitialized > globals into a COMMON section, where duplicate definitions are merged. > This may result in unexpected behavior, since global variables appearing > by the same name in different C files

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Laszlo Ersek
On 12/04/15 17:23, Paolo Bonzini wrote: > > > On 04/12/2015 11:39, Laszlo Ersek wrote: >> (4) Linking those two files into a complete program is a violation of >> "6.7 External definitions": >> >> [...] If an identifier declared with external linkage is used in an >> expression (other

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Ard Biesheuvel
On 4 December 2015 at 17:27, Laszlo Ersek wrote: > On 12/04/15 17:23, Paolo Bonzini wrote: >> >> >> On 04/12/2015 11:39, Laszlo Ersek wrote: >>> (4) Linking those two files into a complete program is a violation of >>> "6.7 External definitions": >>> >>> [...] If an

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Paolo Bonzini
On 04/12/2015 11:39, Laszlo Ersek wrote: > (4) Linking those two files into a complete program is a violation of > "6.7 External definitions": > > [...] If an identifier declared with external linkage is used in an > expression (other than as part of the operand of a *sizeof* >

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Ard Biesheuvel
On 4 December 2015 at 20:20, Daryl McDaniel wrote: [...] >> On 12/03/15 13:54, Ard Biesheuvel wrote: >>> The default behavior of the GCC compiler is to emit uninitialized >>> globals into a COMMON section, where duplicate definitions are merged. >>> This may result in

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Daryl McDaniel
On Friday, December 04, 2015, Laszlo Ersek wrote: > Now, after reading the -fno-common documentation in the gcc manual, I'm > actually *convinced* this is a gcc bug. The manual says on my RHEL-7.2 > system (excerpt): > >-fno-common >In C code, controls the placement of

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Jordan Justen
On 2015-12-04 08:43:29, Ard Biesheuvel wrote: > On 4 December 2015 at 17:27, Laszlo Ersek wrote: > > On 12/04/15 17:23, Paolo Bonzini wrote: > >> > >> > >> On 04/12/2015 11:39, Laszlo Ersek wrote: > >>> (4) Linking those two files into a complete program is a violation of > >>>

Re: [edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-04 Thread Ard Biesheuvel
On 4 December 2015 at 20:13, Jordan Justen wrote: > On 2015-12-04 08:43:29, Ard Biesheuvel wrote: >> On 4 December 2015 at 17:27, Laszlo Ersek wrote: >> > On 12/04/15 17:23, Paolo Bonzini wrote: >> >> >> >> >> >> On 04/12/2015 11:39, Laszlo Ersek

[edk2] [PATCH] BaseTools GCC: avoid the use of COMMON symbols

2015-12-03 Thread Ard Biesheuvel
The default behavior of the GCC compiler is to emit uninitialized globals into a COMMON section, where duplicate definitions are merged. This may result in unexpected behavior, since global variables appearing by the same name in different C files typically do not refer to the same conceptual data