]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[linux] Use host glibc system call wrappers
authorMichael Brown <mcb30@ipxe.org>
Sun, 28 Feb 2021 13:45:58 +0000 (13:45 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sun, 28 Feb 2021 23:28:23 +0000 (23:28 +0000)
commitf309d7a7b78eec10621bc71f9401d5b9257f9f39
tree118bfa718065739e8f21e776b515c6457a68d221
parent040cdd0c658a49694b17a1c0b5439d0bd7805242
[linux] Use host glibc system call wrappers

When building as a Linux userspace application, iPXE currently
implements its own system calls to the host kernel rather than relying
on the host's C library.  The output binary is statically linked and
has no external dependencies.

This matches the general philosophy of other platforms on which iPXE
runs, since there are no external libraries available on either BIOS
or UEFI bare metal.  However, it would be useful for the Linux
userspace application to be able to link against host libraries such
as libslirp.

Modify the build process to perform a two-stage link: first picking
out the requested objects in the usual way from blib.a but with
relocations left present, then linking again with a helper object to
create a standard hosted application.  The helper object provides the
standard main() entry point and wrappers for the Linux system calls
required by the iPXE Linux drivers and interface code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
29 files changed:
.github/workflows/build.yml
src/Makefile.linux [new file with mode: 0644]
src/arch/i386/Makefile.linux
src/arch/i386/core/linux/linux_syscall.S [deleted file]
src/arch/i386/core/linux/linuxprefix.S [deleted file]
src/arch/i386/include/bits/linux_api.h [deleted file]
src/arch/x86/Makefile.linux
src/arch/x86/core/linux/linux_api.c [deleted file]
src/arch/x86/core/linux/linux_strerror.c [deleted file]
src/arch/x86/include/bits/linux_api_platform.h [deleted file]
src/arch/x86_64/Makefile.linux
src/arch/x86_64/core/linux/linux_syscall.S [deleted file]
src/arch/x86_64/core/linux/linuxprefix.S [deleted file]
src/arch/x86_64/include/bits/linux_api.h [deleted file]
src/drivers/linux/af_packet.c
src/drivers/linux/tap.c
src/hci/linux_args.c
src/include/ipxe/linux_api.h [new file with mode: 0644]
src/include/linux_api.h [deleted file]
src/interface/linux/linux_api.c [new file with mode: 0644]
src/interface/linux/linux_console.c
src/interface/linux/linux_entropy.c
src/interface/linux/linux_nap.c
src/interface/linux/linux_pci.c
src/interface/linux/linux_smbios.c
src/interface/linux/linux_time.c
src/interface/linux/linux_timer.c
src/interface/linux/linux_umalloc.c
src/interface/linux/linuxprefix.c [moved from src/include/hci/linux_args.h with 58% similarity]