0

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?

  • It sounds like the 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 the hla program in any way? (If it's a script, can you add flags to the ld call?) – saiarcot895 Jul 4 '16 at 15:50
0

A google for 64 bit hla finds for example this forum article which says you can pass an option to the loader to do a 32 bit version with:

hla -lmelf_i386 -v helloWorld

There's more discussion in this blog. You may need to install a 32 package like glibc.i686.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.