os-tutorial icon indicating copy to clipboard operation
os-tutorial copied to clipboard

Building in linux - Target-Libgcc

Open lcnvdl opened this issue 6 years ago • 6 comments

Hello. I'm following the steps from: 11-kernel-crosscompiler

I've installed successfully binutils following your steps. But I'm having problems installing GCC:

In the step: make all-target-libgcc

I'm getting the next error: /tmp/ccP9qmbP.s:15: Error: invalid instruction suffix for push' /tmp/ccP9qmbP.s:45: Error: invalid instruction suffix for pop'

I was reading, and I found that is because of the instructions. I don't know how to force to 32 bits mode.

Details: make[2]: se sale del directorio '/tmp/src/gcc-build/i386-elf/libgcc' /tmp/src/gcc-build/./gcc/xgcc -B/tmp/src/gcc-build/./gcc/ -B/usr/local/i386elfgcc/i386-elf/bin/ -B/usr/local/i386elfgcc/i386-elf/lib/ -isystem /usr/local/i386elfgcc/i386-elf/include -isystem /usr/local/i386elfgcc/i386-elf/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fpic -I. -I. -I../.././gcc -I../../../gcc-8.1.0/libgcc -I../../../gcc-8.1.0/libgcc/. -I../../../gcc-8.1.0/libgcc/../gcc -I../../../gcc-8.1.0/libgcc/../include -DUSE_EMUTLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../gcc-8.1.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS /tmp/ccP9qmbP.s: Assembler messages: /tmp/ccP9qmbP.s:15: Error: invalid instruction suffix for push' /tmp/ccP9qmbP.s:45: Error: invalid instruction suffix for pop' Makefile:494: recipe for target '_muldi3.o' failed make[1]: *** [_muldi3.o] Error 1 make[1]: se sale del directorio '/tmp/src/gcc-build/i386-elf/libgcc' Makefile:11670: recipe for target 'all-target-libgcc' failed make: *** [all-target-libgcc] Error 2

lcnvdl avatar May 22 '18 22:05 lcnvdl

I had to sue i686-elf libraries instead and that worked for me without problems, so I would use that if not anyone actually have a solution for it so that you can use i386

ThatSimplex avatar May 23 '18 14:05 ThatSimplex

I suggest you to build gcc-5.2.0 that can be built without any interruptions

TravorLZH avatar Aug 20 '18 13:08 TravorLZH

@Futseh thats what i did

Menotdan avatar Nov 04 '18 11:11 Menotdan

@Futseh I wonder if its because we use a 64bit enviroment?

Menotdan avatar Nov 06 '18 11:11 Menotdan

I had problems with the whole thing and just installed everything via homebrew on my mac I then installed i386-elf-toolchain tap with homebrew like this: brew tap nativeos/i386-elf-toolchain brew install i386-elf-binutils i386-elf-gcc

Matthiasclee avatar Jun 17 '20 01:06 Matthiasclee

I had problems with the whole thing and just installed everything via homebrew on my mac I then installed i386-elf-toolchain tap with homebrew like this: brew tap nativeos/i386-elf-toolchain brew install i386-elf-binutils i386-elf-gcc

What you have installed from HomeBrew may not have the same configurations as that which this repo uses. I guess this tutorial could help you fix the problem.

TravorLZH avatar Jun 25 '20 02:06 TravorLZH