GreaseMonkey 7 Posted April 5, 2016 Share Posted April 5, 2016 There's a couple of custom OC architectures floating around that could benefit from this. Really, we need people to write software and we don't have in-mod C compilers yet. I'll give you my setup (with a few distro-specific things stripped out): ../binutils-2.25.1/configure --target=mipsel-none-elf --disable-multilib --disable-nls --enable-lto ../gcc-5.3.0/configure --target=mipsel-none-elf --disable-nls --enable-languages=c,c++ --enable-lto ../newlib-2.3.0.20160104/configure --target=mipsel-none-elf --enable-lto For ARM I use arm-none-eabi as my target, but arm-none-elf might work better.If you're on Windows, you'll probably want to use Cygwin to build this stuff. MSYS might also work if you prefer that. If you're on Linux or BSD, you shouldn't need anything fancy. Basically, you'll want binutils, gcc, and newlib. You build them all "out of tree". Step 1: Binutils Here's my setup. Version numbers and targets will likely be different, although number of make threads may be the same. mkdir xbinutils-mips cd xbinutils-mips ../binutils-2.25.1/configure --target=mipsel-none-elf --disable-multilib --disable-nls --enable-lto make -j8 sudo make install cd .. With a fairly beefy system it should build in under a minute.That's the easy bit. Step 2: GCC, part 1 You only want to build part of this. Look closely at the make commands. mkdir xgcc-mips cd xgcc-mips ../gcc-5.3.0/configure --target=mipsel-none-elf --disable-nls --enable-languages=c,c++ --enable-lto make -j8 all-gcc sudo make install-gcc cd .. If you got that working, good job. If not, please give me the info I need to know.Step 3: newlib This is a libc implementation designed for embedded software. The general idea is that you compile something, find out what syscalls are missing, then implement those syscalls. Enough about how to use it, let's actually build it. mkdir xnewlib-mips cd xnewlib-mips ../newlib-2.3.0.20160104/configure --target=mipsel-none-elf --enable-lto make -j8 sudo make install cd .. Step 4: GCC, part 2Oh, you thought you were done? WRONK. By the way, DO NOT RECONFIGURE YOUR COMPILER.. Just do this: cd xgcc-mips make -j8 sudo make install cd .. EDIT: If you have C++ enabled (as you would if you just use those config lines), libstdc++ whinges about it not being supported or something like that. Here's the fix:In gcc-*.*.*/libstdc++-v3/configure, find this line and comment it out like so: #as_fn_error "No support for this host/target combination." "$LINENO" 5 I found this at line 78194 (GCC 6.1.0), so please please please use your search function.Step 5: Compile things If you got through those 4 steps without any errors, find or make some stuff to compile and compile it. Whee! It depends on the architecture that you are using. Feel free to bug the maintainers of said architectures on how to write software for their things. Also, knowing how to write GNU linker scripts helps... at least some of the time: https://sourceware.org/binutils/docs/ld/index.html Have fun! Quote Link to post Share on other sites