Skip to content

Commit 7dd6671

Browse files
committed
mason: build kernel as executable [#146]
... instead of custom_target. This is very interesting, as it now uses clang -nostdlib for linking, which seems to work. This will probably simplify the cross-compilation, in case clang can find the proper cross ld.
1 parent 6c30dba commit 7dd6671

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

fdpp/kernel/meson.build

+5-11
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,15 @@ SRCS = [
6666

6767
nargs = ['-DXCPU=186', '-DWITHFAT32', '-DFDPP']
6868

69-
lib = static_library('dummy',
69+
executable(TARGET + '.elf',
7070
[SRCS, sfiles, plt_inc],
7171
include_directories: incdir2,
7272
nasm_args: nargs,
73-
build_by_default: false)
74-
nasm_ld = find_program(['i686-linux-gnu-ld', 'i386-elf-ld', 'x86_64-linux-gnu-ld', 'ld.bfd'])
75-
custom_target(TARGET + '.elf',
76-
output: [TARGET + '.elf', TARGET + '.map'],
77-
input: lib.extract_all_objects(recursive: true),
78-
command: [nasm_ld, '-melf_i386', '-static',
79-
'-Map=@OUTPUT1@', '-o', '@OUTPUT0@',
80-
'--emit-relocs', '-T' + kernel_ld, '@INPUT@'],
73+
link_args: ['-Wl,-melf_i386', '-Wl,-static',
74+
'-Wl,-Map=' + TARGET + '.map', '-nostdlib',
75+
'-Wl,--emit-relocs', '-Wl,-T' + kernel_ld],
8176
install: true,
8277
install_dir: get_option('datadir') / 'fdpp',
83-
install_mode: 'rw-r--r--',
84-
build_by_default: true)
78+
install_mode: 'rw-r--r--')
8579

8680
VERSION = meson.project_version()

0 commit comments

Comments
 (0)