1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

x64 machine code generation (ELF)

This commit is contained in:
Alexander Medvednikov
2019-11-19 09:53:52 +03:00
parent ab91733a28
commit 9712213f50
13 changed files with 564 additions and 15 deletions

25
vlib/compiler/gen_x64.v Normal file
View File

@@ -0,0 +1,25 @@
module compiler
import filepath
//import compiler.x64
pub fn (v mut V) compile_x64() {
$if !linux {
println('v -x64 can only generate Linux binaries for now')
println('You are not on a Linux system, so you will not ' +
'be able to run the resulting executable')
}
v.files << v.v_files_from_dir(filepath.join(v.pref.vlib_path, 'builtin', 'bare'))
v.files << v.dir
v.x64.generate_elf_header()
for f in v.files {
v.parse(f, .decl)
}
for f in v.files {
v.parse(f, .main)
}
v.x64.generate_elf_footer()
}