After reading the "Art of Assembly Language", I obtained the High Level Assembly language from the website listed in the book. After editing my .bashrc file, I compiled my canonical "Hello world!" program using
hla helloworld.hla
This returned this error:
ld: i386 architecture of input file `helloworld.o' is incompatible with
i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(ex_hwExcept.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(ex_Raise.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(ex_buildexcepts.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(ex_InstallSignals.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(ex_abstract.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(ex_excepts.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(ex_dfltexcept.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(so_puts.o)'
is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(str_catu32.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(str_cath32.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(str_cat2.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(str_catd.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(str_cats.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(str_catu64size.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib
/hlalib.a(str_init.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(str_cpy.o)'
is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(linux_write.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(linux_sigaction.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(linux_exit.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_dToStr.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_u64tostr.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_underscores.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_h32ToStr.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(hexTbL.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(fio_puts.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(fio_putssize.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(fileio_write.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(hla_get_set_OutputUnderscores.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(stdoutvars.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_u64tobuf.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv__hexTobuf32Size.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_u64size.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_u32size.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv_h32Size.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv__hexTobuf32.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(hexDigitsData.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(fio__putpad.o)' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `/usr/hla/hlalib/hlalib.a(conv__unsTobuf64.o)' is incompatible with i386:x86-64 output
Error returned by ld = 256
I feel as if this is an error with compatibility, since am on Linux x64, whilst the book advertised HLA as x86 compatible. I looked at the flags for HLA and there are no parameters I can set in order to change this. What can I do?
hla
program is compiling for a different architecture than your native architecture. This makes sense, since assembly isn't entirely portable; you would need to make modifications to an x86 assembly file to get it to compile on x86-64. Can you modify thehla
program in any way? (If it's a script, can you add flags to theld
call?) – saiarcot895 Jul 4 '16 at 15:50