diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/qboot/meson.build | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/qboot/meson.build')
-rw-r--r-- | roms/qboot/meson.build | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/roms/qboot/meson.build b/roms/qboot/meson.build new file mode 100644 index 000000000..d060f756e --- /dev/null +++ b/roms/qboot/meson.build @@ -0,0 +1,53 @@ +project('qboot', 'c', meson_version: '>=0.49.0') + +cc = meson.get_compiler('c') +objcopy = find_program('objcopy') + +c_args = [ + '-m32', + '-march=i386', + '-mregparm=3', + '-fno-stack-protector', + '-fno-delete-null-pointer-checks', + '-ffreestanding', + '-mstringop-strategy=rep_byte', + '-minline-all-stringops', + '-fno-pic', +] + +link_args = ['-nostdlib', '-m32'] +link_args += cc.get_supported_link_arguments('-Wl,--build-id=none') +link_args += '-Wl,-T' + meson.current_source_dir() / 'flat.lds' +link_args += cc.get_supported_link_arguments(['-no-pie']) + +elf = executable( + 'bios.bin.elf', + files( + 'code16.c', + 'code32seg.c', + 'cstart.S', + 'entry.S', + 'fw_cfg.c', + 'hwsetup.c', + 'linuxboot.c', + 'main.c', + 'malloc.c', + 'mptable.c', + 'pci.c', + 'printf.c', + 'string.c', + 'smbios.c', + 'tables.c', + ), + c_args: c_args, + include_directories: include_directories('include'), + link_args: link_args, +) + +bin = custom_target( + 'bios.bin', + output: 'bios.bin', + input: elf, + command: [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'], + build_by_default: true, +) |