J'étais en train de compiler le {{X0 }} compiler avec glibc-2.31 en suivant cet article avec make && make install lorsque je suis tombé sur les messages d'erreur suivants:

In file included from ../../../../libsanitizer/sanitizer_common/sanitizer
_platform_limits_posix.cc:193:
../../../../libsanitizer/sanitizer_common/sanitizer_internal_defs.h:339:7
2: error: narrowing conversion of '-1' from 'int' to 'long unsigned int'
[-Wnarrowing]
  339 | IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
      |                                                       ^

../../../../libsanitizer/sanitizer_common/sanitizer_internal_defs.h:333:3
0: note: in expansion of macro 'IMPL_COMPILER_ASSERT'
  333 | #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
      |                              ^~~~~~~~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix
.h:1511:3: note: in expansion of macro 'COMPILER_CHECK'
 1511 |   COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) =
= \
      |   ^~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix
.cc:1161:1: note: in expansion of macro 'CHECK_SIZE_AND_OFFSET'
 1161 | CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
      | ^~~~~~~~~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_internal_defs.h:339:7
0: warning: size of array 'assertion_failed__1161' is not an integral con
stant-expression [-Wpedantic]
  339 | r IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
      |                                          ~~~~~~~~~~~~~^~

../../../../libsanitizer/sanitizer_common/sanitizer_internal_defs.h:333:3
0: note: in expansion of macro 'IMPL_COMPILER_ASSERT'
  333 | #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
      |                              ^~~~~~~~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix
.h:1511:3: note: in expansion of macro 'COMPILER_CHECK'
 1511 |   COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) =
= \
      |   ^~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix
.cc:1161:1: note: in expansion of macro 'CHECK_SIZE_AND_OFFSET'
 1161 | CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
      | ^~~~~~~~~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_internal_defs.h:339:7
0: error: size '-1' of array 'assertion_failed__1161' is negative
  339 | r IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
      |                                          ~~~~~~~~~~~~~^~

../../../../libsanitizer/sanitizer_common/sanitizer_internal_defs.h:333:3
0: note: in expansion of macro 'IMPL_COMPILER_ASSERT'
  333 | #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
      |                              ^~~~~~~~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix
.h:1511:3: note: in expansion of macro 'COMPILER_CHECK'
 1511 |   COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) =
= \
      |   ^~~~~~~~~~~~~~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix
.cc:1161:1: note: in expansion of macro 'CHECK_SIZE_AND_OFFSET'
 1161 | CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
      | ^~~~~~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:663: sanitizer_platform_limits_posix.lo] Error 1
make[4]: Leaving directory '/home/sayakbrm/sbos/sources/gcc-9.2.0/gcc-bui
ld/x86_64-unknown-linux-gnu/libsanitizer/sanitizer_common'
make[3]: *** [Makefile:527: all-recursive] Error 1
make[3]: Leaving directory '/home/sayakbrm/sbos/sources/gcc-9.2.0/gcc-bui
ld/x86_64-unknown-linux-gnu/libsanitizer'
make[2]: *** [Makefile:414: all] Error 2
make[2]: Leaving directory '/home/sayakbrm/sbos/sources/gcc-9.2.0/gcc-bui
ld/x86_64-unknown-linux-gnu/libsanitizer'
make[1]: *** [Makefile:12361: all-target-libsanitizer] Error 2
make[1]: Leaving directory '/home/sayakbrm/sbos/sources/gcc-9.2.0/gcc-bui
ld'
make: *** [Makefile:962: all] Error 2

J'ai déjà réussi à compiler les étapes 1 gcc et glibc, et cette erreur ne se produit que lors de la construction de la passe finale de gcc.

1
sbrm1 16 août 2020 à 16:00

2 réponses

Meilleure réponse

L'erreur ci-dessus se produit en raison d'un problème introduit en utilisant Glibc-2.31.

Le problème peut être résolu avec la commande suivante:

sed -e '1161 s|^|//|' \
    -i libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc

La source

3
sbrm1 16 août 2020 à 16:25

Le libsanitizer de GCC doit être porté sur cette modification de la glibc:

Cela s'est produit dans GCC PR 92154: la nouvelle glibc rompt l'amorçage des bras en raison de libsanitizer , qui est inclus dans GCC 9.3, mais pas dans GCC 9.2.

1
Florian Weimer 18 août 2020 à 10:35