Open mekb-turtle opened 2 years ago
Although lacc can understand some inline assembly, it is not a complete assembler, and compiling .s input files is not supported. You should rather use an actual assembler to compile those files.
usually the compiler driver automatically invokes the assembler when it detects an assembly file being passed to it. just like it calls the linker when the input is object files.
Does lacc have it's own linker or does it use the system one? I'm working on a distro which uses lacc and musl, lacc is the first thing that is compiled and it can link binaries somehow.
There is no linker, only a very crude implementation of a driver invoking the system linker (see src/backend/linker.c). I guess it is reasonable to assume that lacc would also know how to invoke the assembler, so I may implement something like that. Otherwise what I would prefer was to actually be able to assemble, so perhaps some time in the future it will work. I will keep this bug open as a reminder :=)
Is the system linker part of the kernel or part of something else? (side note: lacc doesn't have -dumpmachine
so it can't compile itself without manually specifying the machine name e.g x86_64-linux-musl
.)
When compiling https://musl.libc.org, I get the following:
I tried to compile a simple hello world from C to to assembly and then from assembly to a Linux binary,
lacc -S main.c -o main.s
,lacc main.s -o main
, but it shows this on the second command:I'm not sure if I should report it here or at musl
If you could implement compiling from assembly, that would be appreciated, thanks