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:
25
vlib/compiler/gen_x64.v
Normal file
25
vlib/compiler/gen_x64.v
Normal 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()
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user