“ unsupported for`ljmp' ” error while compiling

Programming, for all ages and all languages.
Post Reply
1eftHer0
Posts: 2
Joined: Tue Jul 19, 2011 12:35 am

“ unsupported for`ljmp' ” error while compiling

Post by 1eftHer0 »

I'm using gmake to compile code, but I'm stuck on this error message:
http://ocw.mit.edu/courses/electrical-e ... handout.gz
(this code from MIT.OCW)

Code: Select all

+ as kern/entry.S
kern/entry.S: Assembler messages:
kern/entry.S:55: Error: unsupported for `ljmp'
gmake: * [obj/kern/entry.o] Error 1
How can I fix it?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: “ unsupported for`ljmp' ” error while compiling

Post by Combuster »

Use a 32-bit toolchain rather than a 64-bit one.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
1eftHer0
Posts: 2
Joined: Tue Jul 19, 2011 12:35 am

Re: “ unsupported for`ljmp' ” error while compiling

Post by 1eftHer0 »

ok Combuster, I'm try to change GNUmakefile add -m32 optional in gcc that's work. its compiling pass many file but stuck in this error message(stuck in boot folder).

Code: Select all

+ ld boot/boot
ld: i386 architecture of input file `obj/boot/boot.o' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `obj/boot/main.o' is incompatible with i386:x86-64 output
ld: obj/boot/boot.o: file class ELFCLASS32 incompatible with ELFCLASS64
ld: final link failed: File in wrong format
gmake: *** [obj/boot/boot] Error 1
User avatar
xenos
Member
Member
Posts: 1118
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: “ unsupported for`ljmp' ” error while compiling

Post by xenos »

Use a linker script with OUTPUT_FORMAT(elf32-i386) and OUTPUT_ARCH(i386) - or follow Combuster's advice and use a 32 bit toolchain instead of a 64 bit one.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: “ unsupported for`ljmp' ” error while compiling

Post by Creature »

Are you srue you added -m32 to the compiler AND made sure the linker is creating a 32-bit file as well? It seems as if the error is caused by GCC creating 32-bit object files and the LD trying to use them to create a 64-bit executable.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Post Reply