Git Product home page Git Product logo

gnu-efi's Introduction

The files in the "lib" and "inc" subdirectories are using the EFI Application 
Toolkit distributed by Intel at http://developer.intel.com/technology/efi

This code is covered by the following agreement:

Copyright (c) 1998-2000 Intel Corporation

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the
distribution.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION
ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT
TO CHANGE WITHOUT NOTICE.

gnu-efi's People

Contributors

gmbr3 avatar ncroxon avatar pbatard avatar vathpela avatar xypron avatar yetist avatar lcp avatar jiaqingz-intel avatar kagurazakakotori avatar alfonsosanchezbeato avatar ffontaine avatar fantasquex avatar hughsie avatar trofi avatar kallisti5 avatar lopsided98 avatar dwengen avatar mhaeuser avatar moodyhunter avatar soopproject avatar lbmeng avatar

Stargazers

emtee40 avatar Avery avatar  avatar impost0r avatar Pavlo Chmykh avatar aweNousaku avatar Aman avatar Duncan Ogilvie avatar  avatar Weizhao Ouyang avatar antx avatar Poseidon444 avatar Elaina avatar 5aaee9 avatar 祀画 avatar Alex Yang avatar  avatar Siddharth Praveen Bharadwaj avatar Zone.N avatar Tatyana BRuk avatar Spike_Projects avatar Larson T. avatar  avatar  avatar Alex Zolotko avatar  avatar Emirhan Uçan avatar  avatar Oliver avatar Michael Makaci avatar Leif Lindholm avatar Neal Gompa (ニール・ゴンパ) avatar  avatar

Watchers

Lucian avatar Neustradamus avatar  avatar  avatar  avatar

gnu-efi's Issues

MIPS64: Compilation error on Ubuntu 24.04

When compiling gnu-efi for mips64 on Ubuntu 24.04 (make ARCH=mips64 CROSS_COMPILE=mips64el-linux-gnuabi64-), the following error is produced when building the apps:

mips64el-linux-gnuabi64-ld -nostdlib  --warn-common --no-undefined --fatal-warnings --build-id=sha1 -z nocombreloc -z norelro -L/usr/src/gnu-efi//apps/../mips64el/lib -L/usr/src/gnu-efi//apps/../mips64el/gnuefi /usr/src/gnu-efi//apps/../mips64el/gnuefi/crt0-efi-mips64el.o -shared -Bsymbolic -L/usr/src/gnu-efi//apps/../mips64el/lib --defsym=EFI_SUBSYSTEM=0xa t.o -o t.so -T /usr/src/gnu-efi//apps/../gnuefi/elf_mips64el_efi.lds -lefi -lgnuefi /usr/lib/gcc-cross/mips64el-linux-gnuabi64/12/libgcc.a
mips64el-linux-gnuabi64-ld: /usr/src/gnu-efi//apps/../mips64el/gnuefi/crt0-efi-mips64el.o: in function `extra_header_fields':
(.text.head+0x9c): warning: internal error: unsupported relocation error
make[1]: *** [/usr/src/gnu-efi//apps/../Make.rules:52: t.so] Error 1
make[1]: Leaving directory '/usr/src/gnu-efi/mips64el/apps'
make: *** [Makefile:89: apps] Error 2

# mips64el-linux-gnuabi64-ld --version
GNU ld (GNU Binutils for Ubuntu) 2.42

This is likely to impact us with automated builds when GitHub Actions switches their ubuntu-latest builder from 22.04 to 24.04 (and this issue was actually discovered when I tested some builds with GitHub Actions on their ubuntu-24.04 builder).

gnu-efi-3.0.18 fails to link with lld as linker

downstream bug
build log

When trying to build using clang-18, and lld as linker, I get the below error.

clang -I/var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps -I/var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/../inc -I/var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/../inc/ia32 -I/var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/../inc/protocol -Wno-error=pragmas -mno-mmx -mno-sse -mno-avx -fPIE -m32 -g -O2 -Wall -Wextra -Wno-pointer-sign -funsigned-char -fshort-wchar -fno-strict-aliasing -ffreestanding -fno-stack-protector -fno-stack-check  -DCONFIG_ia32 -std=c11 -D__KERNEL__ -I/usr/src/sys/build/include -c /var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/t.c -o t.o
ld.lld -nostdlib --warn-common --no-undefined --fatal-warnings --build-id=sha1 -z nocombreloc -shared -Bsymbolic -L/var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/../ia32/lib -L/var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/../ia32/gnuefi /var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/../ia32/gnuefi/crt0-efi-ia32.o t.o -o t.so -lefi -lgnuefi /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/libclang_rt.builtins-i386.a -T /var/tmp/portage/sys-boot/gnu-efi-3.0.18/work/gnu-efi-3.0.18//apps/../gnuefi/elf_ia32_efi.lds
ld.lld: error: section: .dynamic is not contiguous with other relro sections```

Cant compile on m2 mac

Mac's are arm64, but there is no compilation target for that under lib/*. I tried changing to arm and aarch64 but that for good reason doesn't work.

Migration to GitHub is not complete

Dear gnu-efi team, @ncroxon,

Can you add a "move" box like https://sourceforge.net/projects/handbrake for example.

To disable/delete tabs, go here: https://sourceforge.net/projects/gnu-efi/
To add a new tab, go here: https://sourceforge.net/projects/gnu-efi/
To change informations, go here: https://sourceforge.net/p/gnu-efi/admin/overview
To export, go here: https://sourceforge.net/p/gnu-efi/admin/export

The new place can be added in:

Thanks in advance.

RISCV64 driver does not have the proper EFI subsystem set

Despite having an explicit --defsym=EFI_SUBSYSTEM=0xb in the linker command:

riscv64-linux-gnu-ld -nostdlib  --warn-common --no-undefined --fatal-warnings --build-id=sha1 -z nocombreloc -z norelro -L/home/runner/work/gnu-efi/gnu-efi//apps/../riscv64/lib -L/home/runner/work/gnu-efi/gnu-efi//apps/../riscv64/gnuefi /home/runner/work/gnu-efi/gnu-efi//apps/../riscv64/gnuefi/crt0-efi-riscv64.o -shared -Bsymbolic -L/home/runner/work/gnu-efi/gnu-efi//apps/../riscv64/lib --defsym=EFI_SUBSYSTEM=0xb drv0.o -o drv0.so -T /home/runner/work/gnu-efi/gnu-efi//apps/../gnuefi/elf_riscv64_efi.lds -lefi -lgnuefi /usr/lib/gcc-cross/riscv64-linux-gnu/11/libgcc.a

It seems that the EFI subsystem is not properly applied to the RISCV64 driver, as the riscv64 artifacts from the build that produced https://github.com/ncroxon/gnu-efi/actions/runs/9159433032/job/25179796521 show that the drv0.efi is still set as a UEFI Application (EFI_SUBSYSTEM=0xa):

Image1

This is also confirmed by trying to load the driver in with an UEFI firmware in QEMU RISCV64, which fails because of the wrong subsystem type.

Considering that we have an explicit:

#ifndef EFI_SUBSYSTEM
#define EFI_SUBSYSTEM 10
#endif

in gnuefi/crt0-efi-riscv64.S that we don't have in other archs, and that removing it produces the error:

gnuefi/crt0-efi-riscv64.S:70: Error: cannot represent BFD_RELOC_16 relocation in object file

I would think that the issue is that we need a delayed symbol resolution in crt0-efi-riscv64.o (since it goes into libgnuefi.a which we then link with the app, and which is the library that contains the PE header with the EFI_SUBSYSTEM field), that either we haven't figured how to do, or that the current RISCV64 toolchain doesn't support yet...

gnu-efi 3.0.16+ breaks AArch64 EFI binaries

In Nixpkgs, we've found that gnu-efi 3.0.17 and 3.0.18 have serious regressions (NixOS/nixpkgs#234796 (comment), NixOS/nixpkgs#307063 (comment)) on aarch64-linux. For example, for efitools, a reverse dependency of gnu-efi:

sbsign --key DB.key --cert DB.crt --output HelloWorld-signed.efi HelloWorld.efi
Invalid DOS header magic
make: *** [Make.rules:123: HelloWorld-signed.efi] Error 1
rm HelloWorld.o

The full error log can be found at https://hydra.nixos.org/build/257666776. There's also a bug report on the same issue for Gentoo: https://bugs.gentoo.org/923101

As a bisection leads to 593e139, the same commit https://sourceforge.net/p/gnu-efi/bugs/37/ referred to, we believe that the issue on SourceForge is not actually resolved. Also, we're shipping binutils 2.41, if relevent.

Move riscv64 crt0 to objcopy

gnu-efi should move the crt0 for riscv64 to the objcopy type instead of the 'manual symbols' type as we now have efi-app-riscv64.
We should keep the original and rename it and allow detection of what is the default to prevent mix-ups like ARM64.

Relates to rhboot/shim#641

Avoid wchar_t by moving to C11 types

Use of wchar_t and -fshort-wchar is not permitted by musl libc toolchain. It only allows 32-bit wchar_t, we need CHAR16 to be 16-bit (obviously)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.