source: mainline/meson.build@ cad7b7e

topic/simplify-dev-export
Last change on this file since cad7b7e was da13982, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 20 months ago

Read symbol table from ELF sections

Instead of the currently broken data generated using genmap.py,
read the ELF symbol table for stack traces and symbol names.
In addition to that, prepare ground for accessing DWARF debug
sections.

Because neither .symtab, nor .debug_* sections are
normally part of the program image, these have to be provided
externally. Instead of the previous way of relinking kernel
to bake in the symbol data, we now only link kernel once
and the extra debug data is loaded as part of the initrd image.

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[c21d4d6]1#
2# Copyright (c) 2019 Jiří Zárevúcky
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# - Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# - Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# - The name of the author may not be used to endorse or promote products
15# derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28
[5fd05862]29# TODO: Use vcs_tag() to generate version string
30# TODO: jobfile
[4b65f9a]31# TODO: lto in uspace
[5fd05862]32# TODO: fix clang build
33
34project(
35 'HelenOS',
36 [ 'c', 'cpp' ],
[923bb331]37 default_options : ['buildtype=plain', 'c_std=gnu11', 'cpp_std=c++17', 'warning_level=2', 'werror=false', 'b_staticpic=false', 'prefix=/' ],
[c63c2bb]38 meson_version: '>=0.55.0',
[5fd05862]39)
40
[56440a5]41debug_options = false
42debug_shell_scripts = false
43
[200b2113]44subdir('meson/part/tools')
45subdir('meson/part/read_config')
46subdir('meson/part/compiler_args')
47subdir('meson/part/initrd_manifest')
48subdir('meson' / 'arch' / UARCH)
[63660a3]49
50## The at-sign
51#
52# The `atsign` variable holds the ASCII character representing the at-sign
53# ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
54# don't use '@' for starting a comment, `atsign` is merely '@'. However, on
55# those that do use it for starting a comment (e.g. arm32), `atsign` must be
56# defined as the percentile-sign ('%') in the architecture-dependent files.
57#
[200b2113]58if not is_variable('atsign')
59 atsign = '@'
60endif
[63660a3]61
62## Some architectures need a particular string at the beginning of assembly files.
[200b2113]63if not is_variable('uspace_as_prolog')
64 uspace_as_prolog = ''
65endif
[63660a3]66
[200b2113]67# The following variables are filled in by code in the kernel and uspace subdirs.
[63660a3]68
[200b2113]69# References to the actual binary artefacts that will be part of initrd image.
70rd_init_binaries = []
71# Installed files.
[740e952]72install_files = []
73install_deps = []
[200b2113]74# Install script for headers.
75# TODO: Make a list of directories and turn into script later.
76uspace_lib_install_script_text = []
[740e952]77
[2fff3c4]78subdir('kernel')
[5fd05862]79subdir('uspace')
80
[200b2113]81subdir('meson/part/exports')
82subdir('meson/part/initrd')
[28fcaee]83
84subdir('boot')
85
[200b2113]86# Copy the final image to the build root,
87# and write its name to a text file `image_path`.
88
[d3357e9]89if is_variable('POST_INPUT')
90 image = custom_target(POST_OUTPUT,
91 output: POST_OUTPUT,
92 input: POST_INPUT,
93 command: [ cp, '@INPUT@', '@OUTPUT@' ],
94 )
95
96 custom_target('image_path',
97 output: 'image_path',
98 input: image,
99 command: [ 'echo', '@INPUT@' ],
100 capture: true,
101 )
102else
103 custom_target('image_path',
104 output: 'image_path',
105 command: [ 'echo' ],
106 capture: true,
107 )
108endif
[18b1643]109
[200b2113]110subdir('meson/part/extra_targets')
Note: See TracBrowser for help on using the repository browser.