Page 1 of 1

“ unsupported for`ljmp' ” error while compiling

Posted: Sat Jul 30, 2011 11:18 am
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?

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

Posted: Sat Jul 30, 2011 3:01 pm
by Combuster
Use a 32-bit toolchain rather than a 64-bit one.

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

Posted: Sun Aug 07, 2011 7:46 am
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

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

Posted: Sun Aug 07, 2011 8:34 am
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.

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

Posted: Sun Aug 07, 2011 8:35 am
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.