Error: invalid instruction suffix for `push'

Programming, for all ages and all languages.
Post Reply
invalidinstruction
Posts: 1
Joined: Mon May 10, 2021 1:06 pm

Error: invalid instruction suffix for `push'

Post by invalidinstruction »

Hi. So I'm following the Bare Bones tutorial and when running $HOME/opt/cross/bin/i686-elf-gcc -c kernel.c -o kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
I get the error(s):

Code: Select all

/tmp/ccgonXZ0.s: Assembler messages:
/tmp/ccgonXZ0.s:7: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:19: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:58: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:61: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:69: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:82: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:91: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:93: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:95: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:108: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:109: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:111: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:118: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:121: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:122: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:130: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:132: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:133: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:134: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:177: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:178: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:179: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:180: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:187: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:189: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:190: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:191: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:242: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:243: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:244: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:245: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:256: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:258: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:259: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:260: Error: invalid instruction suffix for `push'
/tmp/ccgonXZ0.s:314: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:315: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:316: Error: invalid instruction suffix for `pop'
/tmp/ccgonXZ0.s:317: Error: invalid instruction suffix for `pop'
Octocontrabass
Member
Member
Posts: 5512
Joined: Mon Mar 25, 2013 7:01 pm

Re: Error: invalid instruction suffix for `push'

Post by Octocontrabass »

Your compiler is using the wrong assembler. You may have missed a step when you were setting up your toolchain.

If you add "-v" to your command line, you'll be able to see exactly which assembler is being used.
Post Reply