Skip to content

Commit

Permalink
[WIP]: envconfig: Add support for secure operation system
Browse files Browse the repository at this point in the history
There are many secure operation systems likes optee from linaro,
trusty from Google, and many SoC vendor has its own proprietary
one.

They don't really share many APIs, we could build trusted
application with meson as long as you prepare a proper
staging sysroot and correct cross properties.
  • Loading branch information
hizukiayaka committed Oct 11, 2021
1 parent 88d9646 commit b999636
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/markdown/Reference-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ These are provided by the `.system()` method call.
| linux | |
| netbsd | |
| openbsd | |
| teeos | Any secure Operating System, likes optee, trusty |
| windows | Any version of Windows |
| sunos | illumos and Solaris |

Expand Down
6 changes: 6 additions & 0 deletions mesonbuild/envconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ def is_openbsd(self) -> bool:
"""
return self.system == 'openbsd'

def is_teeos(self) -> bool:
"""
Machine is a secure Operating System (optee/trusty)
"""
return self.system == 'teeos'

def is_dragonflybsd(self) -> bool:
"""Machine is DragonflyBSD?"""
return self.system == 'dragonfly'
Expand Down
3 changes: 2 additions & 1 deletion mesonbuild/linkers/linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,8 @@ def import_library_args(self, implibname: str) -> T.List[str]:
return self._apply_prefix('--out-implib=' + implibname)

def thread_flags(self, env: 'Environment') -> T.List[str]:
if env.machines[self.for_machine].is_haiku():
m = env.machines[self.for_machine]
if m.is_haiku() or m.is_teeos():
return []
return ['-pthread']

Expand Down
5 changes: 5 additions & 0 deletions mesonbuild/mesonlib/universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
'is_osx',
'is_qnx',
'is_sunos',
'is_teeos',
'is_windows',
'is_wsl',
'iter_regexin_iter',
Expand Down Expand Up @@ -634,6 +635,10 @@ def is_openbsd() -> bool:
return platform.system().lower() == 'openbsd'


def is_teeos() -> bool:
return platform.system().lower() == 'teeos'


def is_windows() -> bool:
platname = platform.system().lower()
return platname == 'windows'
Expand Down
1 change: 1 addition & 0 deletions test cases/common/132 get define/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ foreach lang : ['c', 'cpp']
elif host_system == 'sunos'
d = cc.get_define('__sun__')
assert(d == '1', '__sun__ value is @0@ instead of 1'.format(d))
elif host_system == 'teeos'
else
error('Please report a bug and help us improve support for this platform')
endif
Expand Down

0 comments on commit b999636

Please sign in to comment.