Commit Graph

471 Commits

Author SHA1 Message Date
Nigel Croxon 5560e57038
Merge pull request #41 from NotsoanoNimus/NotsoanoNimus/feature/add-mp-support
Add MP Services Protocol Support
2024-08-09 09:05:47 -04:00
Zack Puhl 7b409340e4 Add MP Services Protocol Support 2024-08-08 08:31:26 -04:00
Nigel Croxon b4cde1c031
Merge pull request #40 from gmbr3/v4_0
FreeBSD update + CompareGuid ABI change
2024-08-05 06:56:40 -04:00
Callum Farmer 88f0e1cca8
Update old_ABI test for CompareGuid
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-08-04 19:23:50 +01:00
Callum Farmer b23462d47c
Add single option to revert to old ABI
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-08-04 19:13:32 +01:00
Callum Farmer 81321deb03
Move STATIC to efidef.h
* Allows use in legacy.h

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-08-03 16:21:38 +01:00
Callum Farmer c14705b746
Fix up for new CompareGuid
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-08-03 16:21:38 +01:00
Callum Farmer a093fe0378
Make CompareGuid match EDK2 ABI
* return BOOLEAN instead of INTN
* Use EFIAPI
* Opposite return codes

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-08-03 16:21:38 +01:00
Callum Farmer 13c46e46a6
Sync FreeBSD
* Always use objcopy -O (--target doesn't make sense)
  and isn't available on freebsd
* No efi-bsdrv target (but has efi-app)(bug in binutils??)
* Sync linker scripts (all features are supported)
* Use clang as HOSTCC (there is no default gcc)

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-08-03 16:21:00 +01:00
Callum Farmer 3398bf0dd9
Align REL(A) def with GLIBC
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-28 15:43:37 +01:00
Callum Farmer 939dffb06f
Allow forcefully ignoring glibc headers on Linux
* Sometimes it may not be available so allow use of the substitute version

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-28 15:43:32 +01:00
Nigel Croxon a5e8881923
Merge pull request #38 from gmbr3/v4_0
Add ix86 and ARM32 MacOS (embedded ELF) CI/CD
2024-07-18 06:57:21 -04:00
Callum Farmer 06320f8fb3
Don't edit the riscv subsystem if using objcopy
* Only needed in binary mode

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-16 14:49:52 +01:00
Callum Farmer e092a94869
Add non-objcopy IA32 crt0/lds
* Needed by embedded (MacOS) ELF toolchain

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-16 14:49:52 +01:00
Callum Farmer 644e03821e
Tune for new MacOS toolchains
* Doesn't seem to like nocombreloc
* i686 doesn't have the efi-app-ia32 target (bug in binutils??)
* Set float manually on ARM32 due to generic toolchain
* Ensure _DYNAMIC symbol exists

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-16 14:49:52 +01:00
Callum Farmer 8f5c321507
Better detect the correct MacOS toolchain
* We need ELF not Mach-O

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-16 14:49:52 +01:00
Callum Farmer 5d4ada9352
Add missing parts to elf.h
* Missing LGPL-2.1+ license
* Add missing REL definitions

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-16 14:49:36 +01:00
Callum Farmer d416122fd8
Add extra archs to MacOS CI/CD
* Add x86, ARM32
* RISC-V won't work until binutils remove the shared library embedded
  ELF blocker

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-16 14:49:20 +01:00
Nigel Croxon feddb5ad3c
Merge pull request #37 from gmbr3/v4_0
Add macOS support
2024-07-15 07:37:24 -04:00
Callum Farmer 16a913e01c
Disable norelro on macOS
The no platform GNU ELF linker rejects it

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-14 18:50:40 +01:00
Callum Farmer b6f99c7ac5
Add substitute elf.h for macOS
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-14 18:50:39 +01:00
Callum Farmer f19216bf87
Add macOS toolchain
Fixes ncroxon/gnu-efi#36

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-14 18:50:17 +01:00
Nigel Croxon 33727c2abe
Merge pull request #34 from gmbr3/riscv
Toolchain fixes + RISCV64 objcopy move + AARCH64 non-objcopy restore
2024-07-06 20:48:55 -04:00
Callum Farmer 2765122e67
X86_64: We use RELA not REL
Weird huh? GNU ld uses RELA but no addends, as soon as
you get an addend from LLD, this code breaks

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:02 +01:00
Callum Farmer 9c953ddf27
Make old ABI func static
Otherwise, LLVM will emit an extern symbol if -O0 is used
which will break the build

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:02 +01:00
Callum Farmer f77e4e8a8e
Force DWARF 4 on LLVM
Otherwise readelf just throws an absolute blowup :(

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:01 +01:00
Callum Farmer 0c0b91b9f9
PC file missing from clean
The pkgconfig file was not being removed
by clean, add the missing statement

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:01 +01:00
Callum Farmer 21f87c2b1e
Fixup riscv64 objcopy move
Detect new enough objcopy

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:01 +01:00
Callum Farmer 353984bb97
Move riscv64 default to objcopy
Fixes ncroxon/gnu-efi#11

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:01 +01:00
Callum Farmer 23715d6389
Restore non-objcopy ARM64 crt0/lds
* An up-to-date version of it anyways
* Useful for systems without objcopy 2.38+

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:01 +01:00
Callum Farmer 9fb0825a6b
Output ELF data file on Linux CI/CD
* Useful for checking moved/new ELF sections

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:44:00 +01:00
Callum Farmer 771b632092
Add Linux musl-libc toolchain
* Use gcc as compiler and bfd as linker
* Use musl toolchain prefixes
* musl doesn't have any Ubuntu cross toolchains
  so x86_64 only

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:43:42 +01:00
Callum Farmer 16c9eedafb
Add Linux LLVM toolchain
* Use clang as compiler and LLD as linker

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:29:04 +01:00
Callum Farmer d9b395ac03
Make CopyMemC call CopyMem
* The last part of this: I hope :)
* ISO C permits overwriting of Src even if it marks Src as CONST
* UEFI marks Src as NON CONST, so forward calls via this function
* Allows us to keep in-line with shim without causing Werror havoc with other downstreams

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:29:04 +01:00
Callum Farmer c03d395571
Disable uninitialized error on GCC
Gives error on 'Red' in bltgrid.c which is initialized
by the looks of it?

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-04 15:29:04 +01:00
Callum Farmer f8ebcfc077
Use char16_t literals
Add char16_t('u') literals
Remove wchar_t('L') literals

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-06-24 19:34:51 +01:00
Callum Farmer ce1ec9d27b
Make CHAR8 use unsigned char
* Means we don't have to switch the implementation of char to unsigned char
* Matches the underlying type of char8_t from C++20

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-06-24 19:34:51 +01:00
Callum Farmer edfda7c396
Make CHAR16 use uint16_t
musl-libc doesn't like fshort-wchar so remove wchar_t usage
Use uint16_t as char16_t can be up to 32bits
Fixes ncroxon/gnu-efi#16

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-06-24 19:34:18 +01:00
Nigel Croxon 9e479726ed
Merge pull request #33 from pbatard/msvc
Apply stdbool/stdint MSVC fixes
2024-06-04 08:45:42 -04:00
Pete Batard 96e3b8469c
Apply stdbool/stdint MSVC fixes
It seems that while Visual Studio can support the C23 standard, Microsoft didn't get the memo
about no longer requiring stdbool.h for true/false, so add an exception for that.

Also harmonize the inclusion of stdint.h for IA32 and IA64 so that, just like for other archs,
it is not limited to GNU-like compilers only.

Signed-off-by: Pete Batard <pete@akeo.ie>
2024-06-03 21:13:41 +01:00
Nigel Croxon 2a44cea3f3
Merge pull request #31 from pbatard/drv0
Fix driver EFI subsystem for VS and RISCV64 and add driver testing
2024-05-28 08:40:32 -04:00
Pete Batard 0248433f2c
Add driver testing to the test list
Signed-off-by: Pete Batard <pete@akeo.ie>
2024-05-24 10:29:50 +01:00
Pete Batard eeb0e6a830
Fix RISCV64 not setting the subsystem according to EFI_SUBSYSTEM
The RISCV64 toolchain does not support 16-bit variable relocation from assembly,
and even if it did support relocations, it would not properly set the subsystem
from --defsym. So we add an extra step on RISCV64, post objcopy, to set the field
manually (using dd and /bin/echo to output the relevant byte, as GNU Make's echo
does not support -ne).
Closes ncroxon/gnu-efi#27.

Signed-off-by: Pete Batard <pete@akeo.ie>
2024-05-24 10:29:49 +01:00
Pete Batard 5d0de491f1
Fix drv0 not being properly set to Boot Service Driver for Visual Studio
Signed-off-by: Pete Batard <pete@akeo.ie>
2024-05-24 10:29:35 +01:00
Nigel Croxon 4ecd540d46
Merge pull request #28 from pbatard/pbatard
Add RISCV64 testing support and default to clean compiler output
2024-05-21 13:29:24 -04:00
Nigel Croxon dee84a8948
Merge pull request #30 from pbatard/fixes
Fix double reference to route80h.efi in apps
2024-05-21 13:27:58 -04:00
Pete Batard 0cdd5584a0
Fix double reference to route80h.efi in apps
Commit 625bdb6368 reorganized the apps list but
also duplicated route80h.efi so remove the extra one, as having two instances
produces an error when running 'make install'.

Signed-off-by: Pete Batard <pete@akeo.ie>
2024-05-21 13:55:09 +01:00
Pete Batard b50b0a0a2c
Add RISCV64 testing support
Requires a recent QEMU (for the pflash0 options) and therefore Ubuntu 24.04.

Signed-off-by: Pete Batard <pete@akeo.ie>
2024-05-21 11:46:42 +01:00
Pete Batard 2d6d426b8c
Enable silent rules for compiler output
This is similar to using automake's silent rules and, just as with automake,
can be disabled by invoking 'make V=1'.

Signed-off-by: Pete Batard <pete@akeo.ie>
2024-05-21 11:45:20 +01:00
Nigel Croxon 7440e5ebb7
Merge pull request #26 from pbatard/Resolve-Conflicts
Add build time QEMU/UEFI tests
2024-05-20 09:24:38 -04:00