Hello gcc-patch list,

While trying to build a x86_64-linux hosted cross arm bare metal compiler with
both --with-multilib-list=rmprofile and --without-headers, the libgcc build
fails while trying to build the armv8-m variant with the following message:

In file included from .../build/gcc/include/arm_cmse.h:38,
                 from .../gcc/libgcc/config/arm/cmse.c:27:
.../build/gcc/include/stdint.h:9:16: fatal error: stdint.h: No such file or 
directory
 # include_next <stdint.h>
                ^~~~~~~~~~

Attached is a patch that removes the dependency over stdint.h (to respect
--without-headers) and replaces uintptr_t and UINTPTR_MAX in cmse.c with their
equivalent gcc predefined macros, respectively __UINTPTR_TYPE__ and
__UINTPTR_MAX__.

For the record, I configured gcc (r260250) with the following command:
../gcc/configure  --enable-languages=c --with-gnu-as --with-gnu-ld \
  --with-multilib-list=rmprofile --disable-nls --without-libiconv-prefix \
  --enable-multilib --target=arm-eabi --without-headers

Unfortunately, I don't have an armv8-m testing environment, so could only check
that the libgcc now builds fine. But the patch is small and simple enough that
I'm confident the generated code is equivalent to the original intent.

2018-05-15  Jerome Lambourg  <lambo...@adacore.com>

        gcc/
        * config/arm/arm_cmse.h: Remove #include <stdint.h>

        libgcc/
        * config/arm/cmse.c (cmse_check_address_range): Replace
        UINTPTR_MAX with __UINTPTR_MAX__ and uintptr_t with __UINTPTR_TYPE__.

Attachment: gcc.patch
Description: Binary data

Reply via email to