This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH ARM] Fix armv8-m multilib build failure with stdint.h
- From: "Andre Vieira (lists)" <Andre dot SimoesDiasVieira at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Date: Fri, 22 Jun 2018 14:56:52 +0100
- Subject: Re: [PATCH ARM] Fix armv8-m multilib build failure with stdint.h
- References: <BED9AC40-6428-4357-8288-5A399A27F2F6@adacore.com> <5AFAC001.50400@foss.arm.com> <4FE3298B-00EF-4A53-8CA4-EE996B8F714A@adacore.com> <5AFD3D71.3000809@foss.arm.com>
On 17/05/18 09:29, Kyrill Tkachov wrote:
>
> On 16/05/18 10:22, Jérôme Lambourg wrote:
>> Hello Kyrill,
>>
>>> Thanks for the patch! To validate it your changes you can also look
>>> at the disassembly
>>> of the cmse.c binary in the build tree. If the binary changes with
>>> your patch then that
>>> would indicate some trouble.
>> Good idea. So I just did that and the assembly of both objects are
>> identical
>> (before and after the patch).
>>
>>> There are places in arm_cmse.h that use intptr_t. You should replace
>>> those as well.
>>> Look for the cmse_nsfptr_create and cmse_is_nsfptr macros...
>> Indeed, good catch. I did not see those as this part is not included
>> in the armv8-m.
>>
>> Below the updated patch and modified changelog.
>
> Thanks this looks good with one nit below.
>
>> 2018-05-16 Jerome Lambourg <lambourg@adacore.com>
>> gcc/
>> * config/arm/arm_cmse.h (cmse_nsfptr_create, cmse_is_nsfptr): Remove
>> #include <stdint.h>. Replace intptr_t with __INTPTR_TYPE__.
>>
>> libgcc/
>> * config/arm/cmse.c (cmse_check_address_range): Replace
>> UINTPTR_MAX with __UINTPTR_MAX__ and uintptr_t with __UINTPTR_TYPE__.
>>
>
> @@ -51,7 +51,8 @@
>
> /* Execute the right variant of the TT instructions. */
> pe = pb + size - 1;
> - const int singleCheck = (((uintptr_t) pb ^ (uintptr_t) pe) < 32);
> + const int singleCheck =
> + (((__UINTPTR_TYPE__) pb ^ (__UINTPTR_TYPE__) pe) < 32);
>
> The "=" should go on the next line together with the initialisation.
>
> Ok for trunk with that fixed.
> Thanks,
> Kyrill
Hi,
Is it OK to backport this to gcc-7?
Applies cleanly and I ran the cmse tests.
Cheers,
Andre