Le 02/11/2017 à 10:44, Didier Kryn a écrit : >     I report the successfull build of the cross-compiler > x86_64-musl-gcc-6.3.0 - understanding Ada - on x86_64 Debian Wheezy. > >     The toolchain for build was gcc-6.3.0 for Linux-Gnu provided by > Adacore.The build toolchain to build major version 6 must be at least > major version 5. > >     Of course, the language option must be > '--enable-languages=ada,c,c++' . > >     Three patches were necessary: >        gnat63-terminals.diff: removes a #include in a C > source file. >        gnat63-prj-attr.diff: corrects the layout of a record in an Ada > source file to prevent a warning concerning performance. >        gnat63-xr_tabls.diff: same as the previous.   In a glibc environment, x86_64-musl-gcc-6.3.0 builds without error with the three patches I have previously reported. To check there is no leak of the glibc native toolchain into the cross-compiler, I tried the build in a musl chroot (without any glibc headers or library), still with '--enable-languages=ada,c,c++'.     In a first attempt, the compilation fails with the following error: ---------------------------------------- In file included from ../../src_toolchain/gcc/ada/adaint.h:290:0,                  from ../../src_toolchain/gcc/ada/adadecode.c:45: /usr/pkg/gcc-6.3/lib/gcc/x86_64-pc-linux-musl/6.3.0/../../../../x86_64-pc-linux-musl/include/sched.h:76:7: error: attempt to use poisoned "calloc"  void *calloc(size_t, size_t);        ^ /usr/pkg/gcc-6.3/lib/gcc/x86_64-pc-linux-musl/6.3.0/../../../../x86_64-pc-linux-musl/include/sched.h:116:36: error: attempt to use poisoned "calloc"  #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n))) ----------------------------------------     The Ada language has "tasking" primitives, which are nowadays based on POSIX threads. For this, adaint.h and other files include which, unfortunately, contains a declaration of calloc() and references to it. This is unfortunate because calloc() is poisoned  by gcc, to avoid interferences with its own allocation functions, and Gnat does only need a small part of sched.h.     There must be a necessity, specific to musl, to make use of calloc() in sched.h, because glibc doesn't do so.     A workaround, provided by the patch gnat63-adaint.diff, is to replace #include with the few lines of this file actually needed in adaint.h. The patch contains also #define _SCHED_H, which is necessary to prevent the inclusion of sched.h by other files, directly or indirectly.     With this additional patch,  x86_64-musl-gcc-6.3.0 builds without error both in a glibc environement and in a musl environment.     Didier