flat assembler
Message board for the users of flat assembler.
Index
> Linux > How to get the fasm listing program to build pure 64 Linux? |
Author |
|
LocoDelAssembly 13 Jun 2011, 17:53
I guess you are building with gcc? Try using "gcc -m32...". Perhaps it will fail as well, in that case you may need to install the i386 dev libc package of your distro (in Debian and Ubuntu it is this one), and if it still fails then yes please, paste the error here.
|
|||
13 Jun 2011, 17:53 |
|
mindcooler 13 Jun 2011, 21:49
You can't compile 32-bit code for 64-bit or vice versa directly. Either use multilib or write it for both architectures.
|
|||
13 Jun 2011, 21:49 |
|
JoeCoder1 14 Jun 2011, 07:08
Uh guys, I am asking about the *listing tool* not my own code. Does anybody know how to get it to build on pure 64 Linux? Thanks.
|
|||
14 Jun 2011, 07:08 |
|
mindcooler 14 Jun 2011, 12:41
There is a FASM listing program? And it exists in both a 32-bit and a 64-bit version?
|
|||
14 Jun 2011, 12:41 |
|
LocoDelAssembly 14 Jun 2011, 15:28
Quote:
Alternatively you could do the "-static" thing from a 32-bit box or from a non-pure 64-bit distro and then copy the executable to your pure 64-bit box (but again, it must at least being capable of running 32-bit programs). |
|||
14 Jun 2011, 15:28 |
|
TmX 14 Jun 2011, 16:34
mindcooler wrote: There is a FASM listing program? And it exists in both a 32-bit and a 64-bit version? If you're using Linux, check TOOLS\LIBC. AFAIK it's a 32-bit asm, and not 64-bit. |
|||
14 Jun 2011, 16:34 |
|
JoeCoder1 15 Jun 2011, 10:54
LocoDelAssembly wrote:
Sorry man I have no idea what you are talking about. I didn't use gcc to build it on my 32 bit linux, I just used fasm. I don't understand what I should do to make it work with fasm on my 64 bit linux because other programs I write work fine in fasm on the 64 bit system. I don't think 32 bit code will run on my pure 64 bit linux. |
|||
15 Jun 2011, 10:54 |
|
JoeCoder1 15 Jun 2011, 10:56
TmX wrote:
I guess you are right so we are back to my original question. How do we get this to work on 64 bit. and you must be aware, if i knew anything about fasm or assembly on x86 i wouldn't be asking this question so if somebody can't tell me how to fix it, i will not understand what you are suggesting. |
|||
15 Jun 2011, 10:56 |
|
JoeCoder1 15 Jun 2011, 10:57
mindcooler wrote: There is a FASM listing program? And it exists in both a 32-bit and a 64-bit version? Apparently it only exists in a 32 bit version but I don't know what has to be done to make it work in 64 bit which is why I asked in this thread. If you look in the tools/libc directory of your fasm install on linux you will see the listing tool. |
|||
15 Jun 2011, 10:57 |
|
LocoDelAssembly 15 Jun 2011, 18:31
JoeCoder1, did you successfully compile the tools in a 32-bit box? Please show how you did it.
This is how I just got it made in Ubuntu: Code: loco@ubuntu:~/fasm$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 10.04.2 LTS Release: 10.04 Codename: lucid loco@ubuntu:~/fasm$ uname -a Linux ubuntu 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux loco@ubuntu:~/fasm$ sudo apt-get install libc6-dev-i386 Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: gcc-4.4-multilib gcc-multilib lib32gcc1 lib32gomp1 libc6-i386 Suggested packages: lib32mudflap0 The following NEW packages will be installed: gcc-4.4-multilib gcc-multilib lib32gcc1 lib32gomp1 libc6-dev-i386 libc6-i386 0 upgraded, 6 newly installed, 0 to remove and 56 not upgraded. Need to get 7,674kB of archives. After this operation, 18.8MB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://archive.ubuntu.com/ubuntu/ lucid-updates/main libc6-i386 2.11.1-0ubuntu7.8 [3,710kB] Get:2 http://archive.ubuntu.com/ubuntu/ lucid-updates/main libc6-dev-i386 2.11.1-0ubuntu7.8 [1,553kB] Get:3 http://archive.ubuntu.com/ubuntu/ lucid/main lib32gcc1 1:4.4.3-4ubuntu5 [55.3kB] Get:4 http://archive.ubuntu.com/ubuntu/ lucid/main lib32gomp1 4.4.3-4ubuntu5 [24.9kB] Get:5 http://archive.ubuntu.com/ubuntu/ lucid/main gcc-4.4-multilib 4.4.3-4ubuntu5 [2,329kB] Get:6 http://archive.ubuntu.com/ubuntu/ lucid/main gcc-multilib 4:4.4.3-1ubuntu1 [862B] Fetched 7,674kB in 32s (234kB/s) Selecting previously deselected package libc6-i386. (Reading database ... 145594 files and directories currently installed.) Unpacking libc6-i386 (from .../libc6-i386_2.11.1-0ubuntu7.8_amd64.deb) ... Selecting previously deselected package libc6-dev-i386. Unpacking libc6-dev-i386 (from .../libc6-dev-i386_2.11.1-0ubuntu7.8_amd64.deb) ... Selecting previously deselected package lib32gcc1. Unpacking lib32gcc1 (from .../lib32gcc1_1%3a4.4.3-4ubuntu5_amd64.deb) ... Selecting previously deselected package lib32gomp1. Unpacking lib32gomp1 (from .../lib32gomp1_4.4.3-4ubuntu5_amd64.deb) ... Selecting previously deselected package gcc-4.4-multilib. Unpacking gcc-4.4-multilib (from .../gcc-4.4-multilib_4.4.3-4ubuntu5_amd64.deb) ... Selecting previously deselected package gcc-multilib. Unpacking gcc-multilib (from .../gcc-multilib_4%3a4.4.3-1ubuntu1_amd64.deb) ... Setting up libc6-i386 (2.11.1-0ubuntu7.8) ... Setting up libc6-dev-i386 (2.11.1-0ubuntu7.8) ... Setting up lib32gcc1 (1:4.4.3-4ubuntu5) ... Setting up lib32gomp1 (4.4.3-4ubuntu5) ... Setting up gcc-4.4-multilib (4.4.3-4ubuntu5) ... Setting up gcc-multilib (4:4.4.3-1ubuntu1) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place loco@ubuntu:~/fasm$ ./fasm tools/libc/prepsrc.asm flat assembler version 1.69.31 (16384 kilobytes memory) 4 passes, 2229 bytes. loco@ubuntu:~/fasm$ gcc -m32 tools/libc/prepsrc.o -o tools/libc/prepsrc loco@ubuntu:~/fasm$ gcc -m32 -static tools/libc/prepsrc.o -o tools/libc/prepsrc-static loco@ubuntu:~/fasm$ ls -l tools/libc/prepsrc* -rwxr-xr-x 1 loco loco 7620 2011-06-15 15:25 tools/libc/prepsrc -rw-rw-r-- 1 loco loco 1405 2011-02-07 07:39 tools/libc/prepsrc.asm -rw-r--r-- 1 loco loco 2229 2011-06-15 15:21 tools/libc/prepsrc.o -rwxr-xr-x 1 loco loco 604717 2011-06-15 15:23 tools/libc/prepsrc-static loco@ubuntu:~/fasm$ tools/libc/prepsrc preprocessed source dumper for flat assembler usage: prepsrc <input> <output> loco@ubuntu:~/fasm$ tools/libc/prepsrc-static preprocessed source dumper for flat assembler usage: prepsrc <input> <output> |
|||
15 Jun 2011, 18:31 |
|
JoeCoder1 16 Jun 2011, 09:38
LocoDelAssembly wrote: JoeCoder1, did you successfully compile the tools in a 32-bit box? Please show how you did it. Yes on 32 bit system I just did fasm listing.asm and then gcc -o listing listing.o and it works good. But on 64 bit system fasm generates a 32 bit object module because of the ELF header in the listing.asm file. If I change that to ELF64 I break the code and get this: fasm@slack64:~/tmp/asm/tools/libc$ fasm listing.asm flat assembler version 1.69.31 (16384 kilobytes memory) listing.asm [22]: ccall exit,2 ccall.inc [4] ccall [1]: push ebp error: illegal instruction. Question is how I can link 32 bit object on 64 bit system or what I should change in the listing.asm program to make it work on elf64 format. Thanks. |
|||
16 Jun 2011, 09:38 |
|
LocoDelAssembly 16 Jun 2011, 17:07
Just impossible, the program is not portable to 64-bit, your system must run the tool as 32-bit mode unconditionally. If you want to keep your system pure, then, just compile it on a 32-bit box using the "-static" specifier and then copy the 32-bit binary to your 64-bit system.
If you want to link right from the 64-bit system (but always generating a 32-bit executable and linking 32-bit objects), then my console dump above is the answer (but of course it is no longer a "pure 64-bit environment") |
|||
16 Jun 2011, 17:07 |
|
JoeCoder1 16 Jun 2011, 17:20
Thanks Loco, I will try the first suggestion and tell you if it works or not.
|
|||
16 Jun 2011, 17:20 |
|
JoeCoder1 16 Jun 2011, 17:25
Hey Loco, muchas gracias...it works! So simple, great solution
OMG 598K statically linked! libc is huge! Go assembly, go fasm! |
|||
16 Jun 2011, 17:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.