Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/nonnative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,28 @@ jobs:
name: "Ubuntu nonnative"
fail_ci_if_error: false
verbose: true
cross-only-uefi-x64:
runs-on: ubuntu-latest
container: mesonbuild/eoan:latest
env:
MESON_CI_JOBNAME: ubuntu-${{ github.job }}

steps:
- run: |
apt-get -y purge clang gcc gdc
apt-get -y autoremove
python3 -m pip install coverage
- uses: actions/checkout@v4
- name: Run tests
run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./tools/run_with_cov.py ./run_tests.py $CI_ARGS --cross uefi-x64.json --cross-only'

- name: Aggregate coverage reports
run: ./ci/combine_cov.sh

- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "Ubuntu nonnative"
fail_ci_if_error: false
verbose: true
5 changes: 5 additions & 0 deletions cross/uefi-x64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"file": "uefi-x64.txt",
"tests": ["common"],
"env": {}
}
11 changes: 11 additions & 0 deletions cross/uefi-x64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[binaries]
c = ['clang', '-target', 'x86_64-uefi']
cpp = ['clang++', '-target', 'x86_64-uefi']
ar = 'llvm-ar'
strip = 'llvm-strip'

[host_machine]
system = 'uefi'
cpu = 'x86_64'
cpu_family = 'x86_64'
endian = 'little'
1 change: 1 addition & 0 deletions docs/markdown/Reference-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ These are provided by the `.system()` method call.
| openbsd | |
| windows | Native Windows (not Cygwin or MSYS2) |
| sunos | illumos and Solaris |
| uefi | |

Any string not listed above is not guaranteed to remain stable in
future releases.
Expand Down
4 changes: 4 additions & 0 deletions mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2366,6 +2366,10 @@ def determine_filenames(self):
suffix = 'so'
# Android doesn't support shared_library versioning
self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
elif self.environment.machines[self.for_machine].is_uefi():
prefix = 'lib'
suffix = 'lib'
self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
else:
prefix = 'lib'
suffix = 'so'
Expand Down
8 changes: 7 additions & 1 deletion mesonbuild/envconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,18 @@ def is_irix(self) -> bool:
"""Machine is IRIX?"""
return self.system.startswith('irix')

def is_uefi(self) -> bool:
"""Machine is UEFI?"""
return self.system == 'uefi'

# Various prefixes and suffixes for import libraries, shared libraries,
# static libraries, and executables.
# Versioning is added to these names in the backends as-needed.
def get_exe_suffix(self) -> str:
if self.is_windows() or self.is_cygwin():
return 'exe'
elif self.is_uefi():
return 'efi'
else:
return ''

Expand All @@ -382,7 +388,7 @@ def get_object_suffix(self) -> str:
return 'o'

def libdir_layout_is_win(self) -> bool:
return self.is_windows() or self.is_cygwin()
return self.is_windows() or self.is_cygwin() or self.is_uefi()

class BinaryTable:

Expand Down
3 changes: 3 additions & 0 deletions mesonbuild/utils/universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,9 @@ def is_qnx() -> bool:
def is_aix() -> bool:
return platform.system().lower() == 'aix'

def is_uefi() -> bool:
return platform.system().lower() == 'uefi'

@lru_cache(maxsize=None)
def darwin_get_object_archs(objpath: str) -> 'ImmutableListProtocol[str]':
'''
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 @@ -13,6 +13,7 @@ system_define_map = {
'openbsd' : ['__OpenBSD__', '1'],
'gnu' : ['__GNU__', '1'],
'sunos' : ['__sun__', '1'],
'uefi' : ['__uefi__', '1'],

# The __FreeBSD__ define will be equal to the major version of the release
# (ex, in FreeBSD 11.x, __FreeBSD__ == 11). To make the test robust when
Expand Down
Loading