flat assembler
Message board for the users of flat assembler.

Index > Linux > Linking fasm.o on x86-64 Multilib System

Author
Thread Post new topic Reply to topic
Pinczakko



Joined: 02 May 2004
Posts: 34
Location: Takabonerate National Park, Indonesia
Pinczakko
I found that the download-able fasm distribution for Linux is only in 32-bit ELF object code form. Therefore, I need to pass -m32 to GCC on my x86_64 multilib system to be able to compile it.



Quote:

me@mach:fasm $ gcc -v -m32 fasm.o -o fasm
Reading specs from /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/specs
Target: x86_64-slamd64-linux
Configured with: ../gcc-4.2.3/configure --prefix=/usr --libdir=/usr/lib64 --enable-shared --enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --disable-alsa --verbose --target=x86_64-slamd64-linux --host=x86_64-slamd64-linux
Thread model: posix
gcc version 4.2.3
/usr/libexec/gcc/x86_64-slamd64-linux/4.2.3/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o fasm /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../lib/crt1.o /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../lib/crti.o /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/32/crtbegin.o -L/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/32 -L/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../x86_64-slamd64-linux/lib/../lib -L/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3 -L/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../x86_64-slamd64-linux/lib -L/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../.. fasm.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/32/crtend.o /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../lib/crtn.o

_________________
Human knowledge belongs to the world
Post 21 Jan 2009, 22:37
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
I have just checked and the Linux version does come with an executable called "fasm" and also the fasm.o object. Note that the executable was compiled by fasm and uses SYSCALLs while the object file uses libc instead.

I don't know why the Unix/libc version is now part of the Linux package though, but I'm almost sure that the addition is recent.
Post 21 Jan 2009, 23:06
View user's profile Send private message Reply with quote
Pinczakko



Joined: 02 May 2004
Posts: 34
Location: Takabonerate National Park, Indonesia
Pinczakko
yes indeed Wink. I was just toying around with the object code when I found it cannot be compiled simply with:
Quote:

gcc -o fasm fasm.o
Post 22 Jan 2009, 00:24
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
Help!
My os current is CRUX64 >
gcc -m32 fasm.o -o fasm
...bla-blah
ld: ....lgcc not found, skip...
exit=1

What is the lgcc ? Where is I may found it?
Post 24 Jan 2009, 14:42
View user's profile Send private message ICQ Number Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 212
Location: Budapest, Hungary
Endre
Does your 64bit linux support 32bit executables (kernel config)?
Does your 64bit linux have 32bit libraries installed?
Post 25 Jan 2009, 11:33
View user's profile Send private message Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
It's would be better to have binary libs built-in to fasm distributive...
Very Happy

_________________
Memory=8388608
Post 27 Jan 2009, 11:18
View user's profile Send private message ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
But the Linux package already comes with an executable! If it doesn't work it is because of either you don't have execute permissions on the file or your distro is pure 64 bits.
Post 27 Jan 2009, 13:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.