From: Alexander Graf Date: Sat, 23 Jun 2018 09:28:08 +0200 Subject: [U-Boot] [PATCH v8 14/30] efi: Don't build sandbox with __attribute__((ms_abi)) In-Reply-To: References: <20180618140835.195901-1-sjg@chromium.org> <20180618140835.195901-15-sjg@chromium.org> <3005026e-99f4-b41f-ba35-e79e5d731724@suse.de> <6522a5cd-9e93-08c7-f4d9-46b8b49c9549@suse.de> Message-ID: <8e8fa895-ec81-10fa-409d-fb7244f2faed@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 22.06.18 21:28, Simon Glass wrote: > Hi Alex, > > > On 22 June 2018 at 06:11, Alexander Graf wrote: >> On 06/21/2018 09:45 PM, Simon Glass wrote: >>> >>> Hi Alex, >>> >>> On 21 June 2018 at 03:59, Alexander Graf wrote: >>>> >>>> On 06/21/2018 04:02 AM, Simon Glass wrote: >>>>> >>>>> Hi Alex, >>>>> >>>>> On 20 June 2018 at 02:56, Alexander Graf wrote: >>>>>> >>>>>> On 06/20/2018 12:02 AM, Simon Glass wrote: >>>>>>> >>>>>>> Hi Alex, >>>>>>> >>>>>>> On 18 June 2018 at 08:46, Alexander Graf wrote: >>>>>>>> >>>>>>>> On 06/18/2018 04:08 PM, Simon Glass wrote: >>>>>>>>> >>>>>>>>> There appears to be a bug [1] in gcc when using varargs with this >>>>>>>>> attribute. Disable it for sandbox so that functions which use that >>>>>>>>> can >>>>>>>>> work correctly, such as install_multiple_protocol_interfaces(). >>>>>>>>> >>>>>>>>> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70955 >>>>>>>>> >>>>>>>>> Signed-off-by: Simon Glass >>>>>>>> >>>>>>>> >>>>>>>> See my patch instead please. >>>>>>> >>>>>>> OK I see it now. Do you know what gcc fixes this problem? >>>>>> >>>>>> >>>>>> The bug you found was really just a gcc bug that hit early gcc6 >>>>>> versions. >>>>>> I >>>>>> doubt you're running into it :). >>>>> >>>>> OK, so in fact gcc does not support varargs problems with the ms_abi? >>>> >>>> >>>> Gcc needs to know whether varargs are sysv varargs or ms varargs. And it >>>> differentiates between the two with different variable types for va_list. >>>> >>> Have you seen the builtin_va_list, etc. >> >> >> I think this sentence is missing content? > > I thought that builtin_va_list and friends would work regardless of > the calling standard being used. But it looks (from your patch) like > you have to explicitly use __builtin_ms_va_list. Is that right? I'm fairly sure builtin_va_list is just gcc's way of mapping the sysv va_list, but I'm not 100% sure. I can double check with our compiler people next week. Either way, I think this patch is good either way. For starters it's not gcc specific because it uses the normal va_args in the "normal" case. Also, it's not ambiguous. IMHO things are quite clear when reading the code if we explicitly differentiate between sysv and ms_abi va_args. Alex