flat assembler
Message board for the users of flat assembler.

Index > Linux > building fasm from the sources on linux

Author
Thread Post new topic Reply to topic
daggs



Joined: 02 Feb 2022
Posts: 5
daggs
Greetings,

is there a tutorial on how to build fasm from the sources provided in github_

Thanks
Post 02 Feb 2022, 08:06
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18471
Location: In your JS exploiting you and your system
revolution
You need fasm to assemble fasm. Yes, really, that is kind of tautological, but fasm is written in assembly for fasm to assemble.

So I suggest that the easiest way is to downlod the zip from here: http://flatassembler.net/download.php

Then extract, and the executable file is already there.
Post 02 Feb 2022, 08:10
View user's profile Send private message Visit poster's website Reply with quote
daggs



Joined: 02 Feb 2022
Posts: 5
daggs
thanks,

what is the license of fasm?
Post 02 Feb 2022, 08:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18471
Location: In your JS exploiting you and your system
revolution
The license is in the file "VERSION.INC".
version.inc wrote:
; flat assembler version 1.73
; Copyright (c) 1999-2019, Tomasz Grysztar.
; All rights reserved.
;
; This programs is free for commercial and non-commercial use as long as
; the following conditions are adhered to.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are
; met:
;
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; The licence and distribution terms for any publically available
; version or derivative of this code cannot be changed. i.e. this code
; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence).
Post 02 Feb 2022, 09:14
View user's profile Send private message Visit poster's website Reply with quote
sylware



Joined: 23 Oct 2020
Posts: 114
Location: Marseille/France
sylware
It is all about "bootstrap". Bootstrapping a desktop or server OS (open source), should be only done with a shmol set of shmol programs and reaching a "full" desktop/server OS should be done in shmol number of steps.
This is not possible anymore: you need 7483274932847329 huge programs, and 473892473294 steps to reach a "full" desktop/server OS. This is seriously toxic and broken (mainly because of toxic, corporate grade, GNU software steering started 10 years ago).

fasmg provides elf64 and coff bootstraping assembler (aka itself). Here, at least, things are tried the right sane way.
Post 02 Feb 2022, 12:10
View user's profile Send private message Reply with quote
daggs



Joined: 02 Feb 2022
Posts: 5
daggs
sylware wrote:
It is all about "bootstrap". Bootstrapping a desktop or server OS (open source), should be only done with a shmol set of shmol programs and reaching a "full" desktop/server OS should be done in shmol number of steps.
This is not possible anymore: you need 7483274932847329 huge programs, and 473892473294 steps to reach a "full" desktop/server OS. This is seriously toxic and broken (mainly because of toxic, corporate grade, GNU software steering started 10 years ago).

fasmg provides elf64 and coff bootstraping assembler (aka itself). Here, at least, things are tried the right sane way.

my intention was to build only fasm, not an entire os
Post 03 Feb 2022, 06:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18471
Location: In your JS exploiting you and your system
revolution
I think it is the same for GCC. You can't compile GCC from the source without having GCC already compiled and running.

I know of one way to avoid the self dependency. That would be to create a listing with the instructions and resultant hex codes for each line. Then use a hex editor to manually create the first binary. xxd can do hex-to-binary, perhaps piped through sed or awk to remove the comments before parsing.
Post 03 Feb 2022, 07:37
View user's profile Send private message Visit poster's website Reply with quote
FlierMate



Joined: 21 Jan 2021
Posts: 213
FlierMate
I saw this in High-Level Language on this forum:
DSblizzard wrote:

Drive compiles itself (3300 lines total) in 3.26 seconds and produces 124 kloc of assembly output. (Previous numbers were for version with debugging turned on). Drive is written in itself, first version was interpreted (source in Python).


It is an interesting point (self-compilation). What did he exactly mean? "Drive compiles itself......Drive [language] is written in itself, first version was interpreted (source in Python)"
Post 03 Feb 2022, 08:02
View user's profile Send private message Visit poster's website Reply with quote
daggs



Joined: 02 Feb 2022
Posts: 5
daggs
revolution wrote:
I think it is the same for GCC. You can't compile GCC from the source without having GCC already compiled and running.

I know of one way to avoid the self dependency. That would be to create a listing with the instructions and resultant hex codes for each line. Then use a hex editor to manually create the first binary. xxd can do hex-to-binary, perhaps piped through sed or awk to remove the comments before parsing.

you are correct, however, I need it in 3 different oses and it does;'t exists in alpine linux
Post 03 Feb 2022, 09:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18471
Location: In your JS exploiting you and your system
revolution
You can use fasm in any one of your OSes to compile versions for all the others. Then transfer the binary file to the target OS

You can also use fasm in Windows to compile binary outputs for Linux, or Unix, or whatever.
Post 03 Feb 2022, 09:45
View user's profile Send private message Visit poster's website Reply with quote
daggs



Joined: 02 Feb 2022
Posts: 5
daggs
revolution wrote:
You can use fasm in any one of your OSes to compile versions for all the others. Then transfer the binary file to the target OS

You can also use fasm in Windows to compile binary outputs for Linux, or Unix, or whatever.

that isn't the issue.
as I use linux, I prefer to use the distro's repos
fasm exists in ubuntu's repos, however I cannot seem to find in rh and alpne's repos.
that requires me to have a binary in the source repos. that is not advised.
Post 03 Feb 2022, 11:15
View user's profile Send private message Reply with quote
sylware



Joined: 23 Oct 2020
Posts: 114
Location: Marseille/France
sylware
@revolution you are more than right: when I was refering to huge mistakes made by the GNU steering committee, the first huge one was to make gcc a c++ only software. Before, gcc was written using simple and lean C89. This has a very bad smell of conspiracy: this was the time when a good pedophile friend/intermediary of bill G. was financing GNU at the MIT... (that trash/monster of epstein).

If you want to sabotage open source software, make it c++ with an insane SDK using tons of complex deps and code generators.
Post 03 Feb 2022, 11:19
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18471
Location: In your JS exploiting you and your system
revolution
daggs wrote:
fasm exists in ubuntu's repos, however I cannot seem to find in rh and alpne's repos.
that requires me to have a binary in the source repos. that is not advised.
fasm doesn't fit very well with the C-based GNU/Linux distribution system. There is a lot of pushback with regard to anything dealing with assembly code. "It isn't portable" is a common refrain I hear.

How does Unbuntu deal with fasm? It can easily distribute the sources, but then no one could make a binary. So it would have to distribute the binary also, or what?
Post 03 Feb 2022, 11:54
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 834
Location: Jakarta, Indonesia
TmX
daggs wrote:

fasm exists in ubuntu's repos, however I cannot seem to find in rh and alpne's repos.
that requires me to have a binary in the source repos. that is not advised.


To build FASM from source, you have to use the official FASM binary (or the one provided by your distro package manager).
In the same way, to be able to compile C/C++ codes, you first have to install gcc/clang. Then you can build gcc/clang on your own.

Is there something wrong with that?
Post 04 Feb 2022, 11:32
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.