From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13430 Path: news.gmane.org!.POSTED!not-for-mail From: argante Newsgroups: gmane.linux.lib.musl.general Subject: using musl-cross-make to build host gcc Date: Sun, 11 Nov 2018 11:11:44 +0000 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1541934602 736 195.159.176.226 (11 Nov 2018 11:10:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Nov 2018 11:10:02 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-13446-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 11 12:09:58 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gLncr-0008WS-NP for gllmg-musl@m.gmane.org; Sun, 11 Nov 2018 12:09:58 +0100 Original-Received: (qmail 17492 invoked by uid 550); 11 Nov 2018 11:12:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 17454 invoked from network); 11 Nov 2018 11:12:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=proton; t=1541934707; bh=d2ULe3LURp0lY5NSInQ2SQM/YHpsF23e/99kf6WUXMs=; h=Date:To:From:Reply-To:Subject:Feedback-ID:From; b=aPQQWfYlIEtQKK3XfYxJZlS4AGr+CoZHda8QaULFQ2d7jH261H3weBvqCrG0GiN7X pBvXcwgdCqLRMVld9Yg7G0e4cX8IpN/tt1bJPVh2tsJmddlPtipknxtE6AjIwUdVyI CPS6b/mx8HrjDxF/7qt+85RPwH7gr2T0Gte9WMytNwls+E6eIm3EMiz7bjUEbjnZFm H3D9EE5ebcU1J07VYborj3RbT5pIRpU9IEy7aQ0wutMzl6HQ5aIjIoIc7xtBHpwmr8 C11ljt0Waazw577LTht7d9Kh2S1By0/naNYNWV2hfltqHp5eTHQtzIiwcWZx2qtAkp IEX0wO4DpgdfA== Feedback-ID: sj1YN_iN560_iv4ir5EpCpCFj2RELVzNnBQpDIwMoUMNXowIBSidTdxSWFyLT3J_uOeJsE1taahISy929bGTAA==:Ext:ProtonMail Xref: news.gmane.org gmane.linux.lib.musl.general:13430 Archived-At: Hi, I would like to compile gcc for my host using musl-cross-make. I copied sta= tically linked tools (cp, mv, sed etc. + musl, zlib) to the new dir (system= layout) and, of course musl-cross. Then chroot to dir and built necessary = libraries (gmp, mpc, mpfr). I installed new libraries in /usr/local/{includ= e,lib} and also copied them (.so and headers) in to cross/x86_64-linux-musl= /{include,lib}. Then I built binutils, which I also installed in /usr/local= . I used all musl-cross-make patches for gcc. The compilation went without an= y problems. I installed gcc in /usr/local and removed the cross gcc. After all I could compile binutils and libraries using the new compiler. Un= fortunately, the compilation of gcc itself ends with a strange error. checking how to run the C preprocessor... x86_64-linux-musl-gcc -E checking for inline... inline checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no checking size of void *... 0 checking size of short... 0 checking size of int... 0 checking size of long... 0 checking for long long... yes checking size of long long... configure: error: in `/tmp/ports/gcc/work/gcc= -7.3.0/host-x86_64-linux-musl/gcc': configure: error: cannot compute sizeof (long long) See `config.log' for more details. make[2]: *** [configure-stage1-gcc] Error 77 make[2]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0' make: *** [all] Error 2 cannot compute sizeof (long long)??? # cat test.c #include #include int main() { =09printf("sizeof(char):=09=09%d\n", sizeof(char)); =09printf("sizeof(short):=09=09%d\n", sizeof(short)); =09printf("sizeof(int):=09=09%d\n", sizeof(int)); =09printf("sizeof(long long):=09%d\n", sizeof(long long)); =09printf("sizeof(int64_t):=09=09%d\n", sizeof(int64_t)); =09printf("sizeof(void *):=09=09%d\n", sizeof(void *)); =09return 0; } # ./a.out sizeof(char):=09=091 sizeof(short):=09=092 sizeof(int):=09=094 sizeof(long long):=098 sizeof(int64_t):=09=098 sizeof(void *):=09=098 And my steps: =09patch 0001-ssp_nonshared.diff =09patch 0002-posix_memalign.diff =09patch 0003-cilkrts.diff =09patch 0004-libatomic-test-fix.diff =09patch 0005-libgomp-test-fix.diff =09patch 0006-libitm-test-fix.diff =09patch 0007-libvtv-test-fix.diff =09patch 0008-Revert-PR-driver-81523-Make-static-override-pie.diff =09patch 0009-Revert-RS6000-linux-startfile-endfile.diff =09patch 0010-static-pie-support.diff =09patch 0011-j2.diff =09patch 0012-s390x-muslldso.diff =09patch 0013-microblaze-pr65649.diff =09patch 0014-ldbl128-config.diff =09patch 0015-m68k.diff =09patch 0016-invalid_tls_model.diff =09for i in getcwd strtoul clock strncasecmp fnmatch waitpid basename \ =09=09strchr snprintf rindex index memcpy mempcpy strcasecmp strsignal \ =09=09vsprintf strndup bcmp tmpnam bzero stpncpy memchr insque ffs \ =09=09vfork memmove stpcpy bsearch copysign strtod vsnprintf strncmp \ =09=09strtol bcopy rename strstr strerror putenv strdup memset memcmp \ =09=09vprintf calloc gettimeofday atexit getpagesize strverscmp random \ =09=09setenv strrchr asprintf msdos vasprintf vfprintf getopt getopt1; do =09=09rm -f libiberty/${i}.c =09=09touch libiberty/${i}.c =09done =09# Prevent libffi from being installed =09sed -i -e 's/\(install.*:\) install-.*recursive/\1/' "${S}"/libffi/Makef= ile.in =09sed -i -e 's/\(install-data-am:\).*/\1/' "${S}"/libffi/include/Makefile.= in =09config_arch_flags=3D =09config_arch_target_cflags=3D =09config_arch_target_ldflags=3D =09export libat_cv_have_ifunc=3Dno =09./configure \ =09=09CFLAGS=3D"-g0 -Os" \ =09=09CXXFLAGS=3D"-g0 -Os" \ =09=09LDFLAGS=3D"-s" \ =09=09--enable-languages=3Dc,c++ \ =09=09--disable-nls \ =09=09--disable-multilib \ =09=09--disable-werror \ =09=09--prefix=3D/usr/local \ =09=09--enable-tls \ =09=09--disable-libmudflap \ =09=09--disable-libsanitizer \ =09=09--disable-gnu-indirect-function \ =09=09--disable-libmpx \ =09=09--enable-deterministic-archives \ =09=09--enable-libstdcxx-time \ =09=09--host=3Dx86_64-linux-musl \ =09=09--build=3Dx86_64-linux-musl \ =09=09--disable-libgomp \ =09=09--enable-bootstrap and make... Any idea about what I'm doing wrong? Best regards