GCC 16.2.0 when trying to compile the bare bones example throws asm errors

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Cyclic007
Posts: 1
Joined: Tue Sep 01, 2026 12:08 pm
Libera.chat IRC: Cyclic007
GitHub: https://github.com/Cyclic007

GCC 16.2.0 when trying to compile the bare bones example throws asm errors

Post by Cyclic007 »

I installed i686-gcc-16.2.0 and with the most recent binutils version and get thrown this when I try and compile kernel.c

Code: Select all

❯ i686-elf-gcc-16.2.0 -c kernel.c -o kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra -v
Using built-in specs.
COLLECT_GCC=i686-elf-gcc-16.2.0
Target: i686-elf
Configured with: ../gcc-16.2.0/configure --target=i686-elf --prefix=/home/cyclic/opt/cross --disable-nls --enable-languages=c,c++ --without-headers --enable-initfini-array --disable-hosted-libstdcxx
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 16.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-c' '-o' 'kernel.o' '-std=gnu99' '-ffreestanding' '-O2' '-Wall' '-Wextra' '-v' '-mtune=generic' '-march=pentiumpro'
 /home/cyclic/opt/cross/libexec/gcc/i686-elf/16.2.0/cc1 -quiet -v kernel.c -quiet -dumpbase kernel.c -dumpbase-ext .c -mtune=generic -march=pentiumpro -O2 -Wall -Wextra -std=gnu99 -version -ffreestanding -o /tmp/ccUfZV7o.s
GNU C99 (GCC) version 16.2.0 (i686-elf)
	compiled by GNU C version 16.2.1 20260810, GMP version 6.3.0, MPFR version 4.2.2, MPC version 1.4.1, isl version isl-0.28-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/cyclic/opt/cross/lib/gcc/i686-elf/16.2.0/../../../../i686-elf/sys-include"
ignoring nonexistent directory "/home/cyclic/opt/cross/lib/gcc/i686-elf/16.2.0/../../../../i686-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/cyclic/opt/cross/lib/gcc/i686-elf/16.2.0/include
 /home/cyclic/opt/cross/lib/gcc/i686-elf/16.2.0/include-fixed
End of search list.
Compiler executable checksum: 7d9a020785a2a4ef91602c756a4f7be4
COLLECT_GCC_OPTIONS='-c' '-o' 'kernel.o' '-std=gnu99' '-ffreestanding' '-O2' '-Wall' '-Wextra' '-v' '-mtune=generic' '-march=pentiumpro'
 as -o kernel.o /tmp/ccUfZV7o.s
/tmp/ccUfZV7o.s: Assembler messages:
/tmp/ccUfZV7o.s:7: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:19: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:51: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:54: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:62: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:74: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:83: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:86: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:87: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:99: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:100: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:102: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:111: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:112: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:113: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:121: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:177: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:242: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:244: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:246: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:247: Error: invalid instruction suffix for `push'
/tmp/ccUfZV7o.s:301: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:302: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:303: Error: invalid instruction suffix for `pop'
/tmp/ccUfZV7o.s:304: Error: invalid instruction suffix for `pop'
Octocontrabass
Member
Member
Posts: 6248
Joined: Mon Mar 25, 2013 7:01 pm

Re: GCC 16.2.0 when trying to compile the bare bones example throws asm errors

Post by Octocontrabass »

Cyclic007 wrote: Tue Sep 01, 2026 12:19 pm

Code: Select all

 as -o kernel.o /tmp/ccUfZV7o.s
It looks like your i686-elf-gcc can't find your i686-elf-binutils. Are you sure your i686-elf-binutils is installed correctly?
Post Reply