From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from a1i524.smtp2go.com (a1i524.smtp2go.com [43.228.186.12]) by sourceware.org (Postfix) with ESMTPS id DA99A3858D28 for ; Tue, 11 Jan 2022 02:49:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA99A3858D28 Received: from [10.139.162.187] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.2:ECDHE_RSA_SECP256R1__AES_256_GCM:256) (Exim 4.94.2-S2G) (envelope-from ) id 1n77ED-SH4ejv-R0; Tue, 11 Jan 2022 02:49:42 +0000 Received: from [104.47.5.50] (helo=EUR02-HE1-obe.outbound.protection.outlook.com) by smtpcorp.com with esmtps (TLS1.2:ECDHE_RSA_SECP384R1__AES_256_GCM:256) (Exim 4.94.2-S2G) (envelope-from ) id 1n77EC-4XaAk6-EQ; Tue, 11 Jan 2022 02:49:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mZwV237C6CletZry8cXQN6Xsw4VJ8Sorgk0KzLNb7JqzAsgUXaw+wco/qHwGViTMNq4XFs8XPVnMFciI8+gYsKTEP1E292kbOj4CWcjDXVmHf+uXZw84xvpAVpdJFSjqqgyQofq6Y5tX170+bhDL7LarBwozLyUgTTmGKGKNfIqDvVqLZcXVZgDgoP+yZpCMLjdBMVRYNzL8wPVYa3LuKuvMSObLPOIKsZMjBqsXdL2CbmsBuFSpmdoL/wbj5vxSjO4OarUTN6/4gtIror0PfixpdO03gOPyQ0Wn9YkANmRTB2az83dgps5Z5ntWU4wcVDUsD543cmYkDJnGekcpDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Kheia4VwWmpM6/o30pSGcFF2IhGRFtOOOm7IUw4738M=; b=Oka7y1BJc0ABPOh6vfdwgW92UsEu3KXe5dsvdaBYraovE9QzT85N78bIq4SFCU/aCPNuYhYIqtiO3PSXVshs6Bsi8/T6Bi/qH9lzcjoolcQlV9pxLUh9OAv4BHobFtgTkmypXWmhbbd/CwAVKxCvfF3YIB45QtMPPh8HkXKilWAiPwM0fg+wpkkS2PWWuVI6v0ptvkZKk/kvc1aZUcdhaa8c2/nGfO47vFNzLDh+fv+C9UhNjLgqszwUVz6lNnitQIWj1WHOQnM9ApxHLQpaiml0rZfQhTOJ9MhmG7ejepcXR2yGGh9AriwFeAHklRRbrcs6ir0oc7KjRYOH1zje0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=werfen.com; dmarc=pass action=none header.from=werfen.com; dkim=pass header.d=werfen.com; arc=none Received: from VI1PR0402MB3853.eurprd04.prod.outlook.com (2603:10a6:803:16::23) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Tue, 11 Jan 2022 02:49:36 +0000 Received: from VI1PR0402MB3853.eurprd04.prod.outlook.com ([fe80::6d80:f2d4:b4a7:cccb]) by VI1PR0402MB3853.eurprd04.prod.outlook.com ([fe80::6d80:f2d4:b4a7:cccb%7]) with mapi id 15.20.4867.012; Tue, 11 Jan 2022 02:49:34 +0000 From: Thomas Sobczynski To: Xi Ruoyao , "gcc-help@gcc.gnu.org" Subject: Re: [EXTERNAL] Re: Compiling GCC 11 for Windows targeting ARM on Linux Thread-Topic: [EXTERNAL] Re: Compiling GCC 11 for Windows targeting ARM on Linux Thread-Index: AQHYBjfXdKUeXAhEXUSx+OzPOU3pVqxcfw4AgACP+e4= Date: Tue, 11 Jan 2022 02:49:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: ebd2d7c0-7083-50fe-33c4-313e923a3b78 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e38c657b-f170-4ccd-deb3-08d9d4ad0037 x-ms-traffictypediagnostic: VE1PR04MB7294:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sBk67dqTYPO/zyOFyTtSCpk3c2DFAkZYhnXRYNI1aC/jvsoijQt4QAqmor+2ABm4m5J/JEBxiLMCtDFfBXAHNwUmuoUqZf7YLB5bV0K1e0jYpMrsJ1CPgE/9pCQvNZihWE+QWZvW/oAmJ5Nef2w3/geF2NOJ1PcoI36O9KPrX7h5qplHu6DLrVt0qViGZOA9I/2U0uOZqSr8WfDwt41Fh4TSr1KLn5+lGUdQJCreI/tSyCvC49/14vixiFdt667JcZVTAdPksYJGc8RMnJl1J/N/nOHPUvrNmcesNDyQhTCBGymEcc6F1hmwK8FbQZMZruVvJcfEbX3MutYb6qVAcMUO1X+qpnS2u3EETlZ8JQTmHpkkpl8ZjHrhs9567t5wkBiXQJcejyjSUVSr1vhJ+g4oJ9N8r1tfTMb3kylLSfO1KptmR1kIQXvjEc1j0TnNzJrTydNwtpGvg0C2EM5UamzdWjvDEZgScsmkbZIAkT55Aa+Rs42XijIgyWhkR4SnIZ8WiDTEAo4rmDzczPH1njGfrJ5oUy9i+uiQzdEym5v8NcZghIt4bU8JtQXoYCsdqQm0ZtFfoTQM0mfK3ytso4kDY/rOmlev2dVV4SFszqMIi6Nqb02skqRXcnuXtyuVQb/uzd0dj96ajKdSfEdO2cntnTl5lOZhFZyCpIEV1+BBsmYvTYjIUrFDk/1vqKuhjlIiQuLw2Cqi65ZoA+P75ENC+ELWwCJCw9qfq8pbML8= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3853.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(508600001)(38070700005)(83380400001)(38100700002)(52536014)(5660300002)(71200400001)(26005)(9686003)(186003)(19627405001)(55016003)(33656002)(7696005)(316002)(6506007)(8676002)(8936002)(2906002)(86362001)(66946007)(91956017)(122000001)(66476007)(64756008)(66446008)(66556008)(76116006)(110136005)(460985005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?4CSKZ3Oi9n00hVrJrH2a1L7fdzWWdBvQCRoC4/0oP7LZtN6Nsxd7W3ieA7?= =?iso-8859-1?Q?YPtDMB7TLHc15Cb359rORzSwodHS2zPkFGaYP/fEl+5yCAbeJk70y5AEAJ?= =?iso-8859-1?Q?gWFE/VZEZ6FWVdMq9C/NFoq/CYIXrpaTAzS7kDhTceqVAoeaS/lMWEkzmr?= =?iso-8859-1?Q?FVZvQ+tZe/09e7IfACroc+zOLWSbsjuPKSXBqsopttcsTLWLPjaRJe5eKX?= =?iso-8859-1?Q?vxAyJ1YemATJWm1uIxa8bs7CPG6Yel7YNDhhm4nH0R2AlcZQSsw7dTWikQ?= =?iso-8859-1?Q?poC+Tiadcb6EaV14Xeyd/pfIo44XCA/22F/6BcOr4SMvbGS9/OOj1VroRK?= =?iso-8859-1?Q?J6x4CHqP4y72JgFAJkT69uEfetuRn26PzHenB4uJlg3U2zVmzMV6Hmo+JR?= =?iso-8859-1?Q?fq5USZsj7HYkUVUhVVavIj9ugH7Gvl6GiTP8k85thy1LaXgHS38jf6ubMV?= =?iso-8859-1?Q?npeWwqIfXMzPppzvZj45fy3P8N67G3v9oesk3i0PV54PcPy6+Qgatxfbla?= =?iso-8859-1?Q?mFitRfLt5qbNCufooTSUNByo05w+uLDXa5ktxFC9Ebicfpcves+raBfoOo?= =?iso-8859-1?Q?VzkgMQr9H9ZVNbBn64uG+lljvhvhcz3GqH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8859-1?Q?ZT2O3KDdyaFGmjoywd88NzFzM4m/aKuFX35zq5SLyTLJ5vz0YsxslltIQ4?= =?iso-8859-1?Q?YNt+kzw5FN7LIqniifcE6kx+VMXJ3rvZB6iaZbOfWfYwcHRC7ioB5LM3lW?= =?iso-8859-1?Q?p9rrGpH0l7krBI0Sjk4+3SQSioo2CW0mYWATMKFkMtsTISxA++eKoHLg?= =?iso-8859-1?Q?=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: werfen.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3853.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e38c657b-f170-4ccd-deb3-08d9d4ad0037 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2022 02:49:34.4603 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6f1611d6-8df7-4fdd-a3ab-ebb1fc59a4ce X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6nvVlK4oGj32cNN7GjDdWYLpJkiuhwxS35chRFRUBH/5qhe/aqzCwKqYtDd08UlosWg/PDFTMV1tKqLa0VOeDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 X-Smtpcorp-Track: 1n77EC4bajk6EQ.3EUG3x-rKIQp6 Feedback-ID: 255983m:255983aIo1Znw:255983sA8c1pRRoC X-Report-Abuse: Please forward a copy of this message, including all headers, to X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2022 02:49:50 -0000 You need to install arm-none-eabi-gcc on Linux, because otherwise you won't be able to build libgcc for arm-none-eabi (note that "arm-none- eabi-gcc.exe", which is just compiled, can't run on Linux). You may use "make all-gcc" and "make install-gcc" to skip libgcc, but a GCC build without libgcc is almost completely useless (such a build is only useful if you'll build libgcc manually later, or you are debugging GCC itself). -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University Thank you, Xi, for pointing out the need for the native cross toolchain as = well as clarifying the linker flags. I installed the native Linux toolchain= for bare-metal ARM, removed my config file edits, and tried again to build= for a Windows host targeting ARM. I am seeing a new error, but it seems to occur further in the build process= , so I feel like I'm a step closer. More context around the error is pasted= below. checking whether the arm-none-eabi-gcc linker (/usr/lib/gcc/arm-none-ea= bi/9.2.1/../../../arm-none-eabi/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... no checking how to hardcode library paths into programs... immediate checking for shl_load... configure: error: Link tests are not allowed after= GCC_NO_EXECUTABLES. make[1]: *** [Makefile:13331: configure-target-libstdc++-v3] Error 1 I tried explicitly adding "--disable-shared" to the "configure" script para= meters, so I'm confused about why I'm seeing "... supports shared libraries= ... yes". Looking at the configure script inside gcc/libstdc++-v3, it seems to test w= hether "gcc_no_link" is set to "yes" to trigger the error. I looked at how = that variable is set, and found this: cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { printf ("hello world\n"); ; return 0; } _ACEOF # FIXME: Cleanup? if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=3D$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 test $ac_status =3D 0; }; then : gcc_no_link=3Dno else gcc_no_link=3Dyes fi if test x$gcc_no_link =3D xyes; then # Setting cross_compile will disable run tests; it will # also disable AC_CHECK_FILE but that's generally # correct if we can't link. cross_compiling=3Dyes EXEEXT=3D else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF To my untrained eye, it looks like this is trying to link a simple "hello w= orld" executable (ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $L= DFLAGS conftest.$ac_ext $LIBS >&5') and if that fails, it sets this "gcc_no= _link" flag to turn off further attempts to link executables? I'm really not sure what the bigger picture is here on this build error, bu= t I am guessing that bare metal ARM doesn't support shared libraries and so= mehow I have convinced the GCC build to try working with shared libraries a= nyway? Here is the tail of the build output: make[2]: Leaving directory '/home/tsobczynski/Compiler/build/arm-none-eabi/= libgcc' Checking multilib configuration for libstdc++-v3... Configuring in arm-none-eabi/libstdc++-v3 configure: loading cache ./config.cache checking build system type... x86_64-pc-linux-gnu checking host system type... arm-none-eabi checking target system type... arm-none-eabi checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-none-eabi-strip... /usr/lib/gcc/arm-none-eabi/9.2.1/../../= ../arm-none-eabi/bin/strip checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for arm-none-eabi-gcc... arm-none-eabi-gcc checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether arm-none-eabi-gcc accepts -g... yes checking for arm-none-eabi-gcc option to accept ISO C89... none needed checking whether arm-none-eabi-gcc understands -c and -o together... ye= s checking whether we are using the GNU C++ compiler... yes checking whether arm-none-eabi-c++ accepts -g... yes checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... unknown checking for _LARGE_FILES value needed for large files... unknown checking how to run the C preprocessor... arm-none-eabi-gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking whether ln -s works... yes checking for arm-none-eabi-as... /usr/lib/gcc/arm-none-eabi/9.2.1/../../../= arm-none-eabi/bin/as checking for arm-none-eabi-ar... /usr/lib/gcc/arm-none-eabi/9.2.1/../../../= arm-none-eabi/bin/ar checking for arm-none-eabi-ranlib... /usr/lib/gcc/arm-none-eabi/9.2.1/../..= /../arm-none-eabi/bin/ranlib checking whether to enable maintainer-specific portions of Makefiles... no configure: CPU config directory is cpu/arm configure: OS config directory is os/generic checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for fgrep... /usr/bin/grep -F checking for ld used by arm-none-eabi-gcc ... /usr/lib/gcc/arm-none-eabi= /9.2.1/../../../arm-none-eabi/bin/ld checking if the linker (/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-= eabi/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/lib/gcc/arm-non= e-eabi/9.2.1/../../../arm-none-eabi/bin/nm checking the name lister (/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-non= e-eabi/bin/nm) interface... BSD nm checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+=3D"... yes checking for /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld= option to reload object files... -r checking for arm-none-eabi-objdump... /usr/lib/gcc/arm-none-eabi/9.2.1/../.= ./../arm-none-eabi/bin/objdump checking how to recognize dependent libraries... unknown checking for arm-none-eabi-ar... (cached) /usr/lib/gcc/arm-none-eabi/9.2.1/= ../../../arm-none-eabi/bin/ar checking for arm-none-eabi-strip... (cached) /usr/lib/gcc/arm-none-eabi/9.2= .1/../../../arm-none-eabi/bin/strip checking for arm-none-eabi-ranlib... (cached) /usr/lib/gcc/arm-none-eabi/9.= 2.1/../../../arm-none-eabi/bin/ranlib checking command to parse /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-non= e-eabi/bin/nm output from arm-none-eabi-gcc object... failed checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... no checking for objdir... .libs checking if arm-none-eabi-gcc supports -fno-rtti -fno-exceptions... no checking for arm-none-eabi-gcc option to produce PIC... -fPIC -DPIC checking if arm-none-eabi-gcc PIC flag -fPIC -DPIC works... yes checking if arm-none-eabi-gcc static flag -static works... no checking if arm-none-eabi-gcc supports -c -o file.o... yes checking if arm-none-eabi-gcc supports -c -o file.o... (cached) yes checking whether the arm-none-eabi-gcc linker (/usr/lib/gcc/arm-none-ea= bi/9.2.1/../../../arm-none-eabi/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... no checking how to hardcode library paths into programs... immediate checking for shl_load... configure: error: Link tests are not allowed after= GCC_NO_EXECUTABLES. make[1]: *** [Makefile:13331: configure-target-libstdc++-v3] Error 1 make[1]: Leaving directory '/home/tsobczynski/Compiler/build' Thanks, Tom