On Tue, 11 Jan 2022 at 02:50, Thomas Sobczynski via Gcc-help <gcc-help@xxxxxxxxxxx> wrote: > > 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 <xry111@xxxxxxxxxxxxxxxx> > 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-eabi/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 parameters, so I'm confused about why I'm seeing "... supports shared libraries... yes". Because the checks for dlopen are done whether or not you are building .so files. Adding --with-newlib will fix that error. That's no longer necessary on the Git master branch, because I fixed it yesterday, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103866