Commit graph

276 commits

Author SHA1 Message Date
Peter Jones
9ee5e38883 Try something else 2021-02-19 17:38:44 -05:00
Peter Jones
fbf39761a6 moar reloc debug 2021-02-19 17:38:44 -05:00
Peter Jones
5e13923061 dunno 2021-02-19 17:38:44 -05:00
Peter Jones
b3f4236e8f Add some Print() debugging 2021-02-19 17:38:44 -05:00
Peter Jones
4f08b34bcd TEMPORARY Define a bunch of _MAX stuff in stdint.h 2021-02-19 17:38:44 -05:00
Peter Jones
9a4ba1a95e Temporarily don't install the .pc and .personality files for pkgconfig 2021-02-19 17:38:44 -05:00
Peter Jones
f9a2c177c6 temporary - add a stdint.h for some reason 2021-02-19 17:38:44 -05:00
Peter Jones
8c19ff4337 Kill the .file/.loc in crt0-efi-mips64el.S 2021-02-19 17:38:44 -05:00
Peter Jones
c34e90aa10 Make crt0-efi-${efiarch}.S files for aa64/mips64el/x64 2021-02-19 17:38:44 -05:00
Peter Jones
0162035666 more messing around with the linker scripts 2021-02-19 17:38:44 -05:00
Peter Jones
acddc3d05e Make ctors/dtors take ldbase as arguments 2021-02-19 17:38:44 -05:00
Peter Jones
26b04feffc Mark more stuff EFIAPI 2021-02-19 17:38:44 -05:00
Peter Jones
5d5bc87944 More ld flags: --no-ld-generated-unwind-info --no-eh-frame-hdr --orphan-handling=error 2021-02-19 17:38:44 -05:00
Peter Jones
e4cb329732 more print debugging 2021-02-19 17:38:44 -05:00
Peter Jones
532bb4198f strcpy format specifier fix 2021-02-19 17:38:44 -05:00
Peter Jones
03bdb634cd x64 2021-02-19 17:38:44 -05:00
Peter Jones
5bc7879b89 mipsel64 2021-02-19 17:38:44 -05:00
Peter Jones
aada1e513e ia32 2021-02-19 17:38:44 -05:00
Peter Jones
c6311d16ce ia64 2021-02-19 17:38:44 -05:00
Peter Jones
cb3cb21949 arm 2021-02-19 17:38:44 -05:00
Peter Jones
43968645a8 aa64 ctors_test.efi works again
There's probably still lots of broken stuff
2021-02-19 17:38:42 -05:00
Peter Jones
ad90af64b2 dwarf headers 2021-02-19 17:38:07 -05:00
Peter Jones
ea4b168693 Temporarily just use --target efi-app-whatever to make efi debug files. 2021-02-19 17:38:07 -05:00
Peter Jones
393f1146f8 Build debuginfo bins for everything in apps/ 2021-02-19 17:38:07 -05:00
Peter Jones
902d428fc9 Make: make all rules build the entire source list, not just the first one. 2021-02-19 17:38:07 -05:00
Peter Jones
5f418ef45b Use .8byte not .long for pointer arrays. 2021-02-19 17:38:07 -05:00
Peter Jones
abcaccf240 Generate .pc files for pkgconf
This adds several .pc files, making commands like the following do the
appropriate things:

pkgconf --personality amd64-efi-gnu gnu-efi --cflags --libs
pkgconf --personality x64-efi-gnu gnu-efi --cflags --libs-only-L
pkgconf --personality x86_64-efi-gnu gnu-efi --libs-only-other
pkgconf --personality aarch64-efi-gnu gnu-efi --libs-only-l
pkgconf --personality aa64-efi-gnu gnu-efi --cflags

The currently provided personality tuples for each architecture are
prefixed with all of the following architecture prefixes:

32-bit x86: ia32 i686 i386
64-bit x86: x64 x86_64 amd64
32-bit arm: arm armv7 armv6
64-bit arm: aa64 aarch64
64-bit itanium: ia64
64-bit mips-le: mips64el

i.e. x86_64-efi-gnu and x64-efi-gnu will get you the exact same result

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:38:07 -05:00
Peter Jones
7d827de29f Distinguish between CFLAGS/LDFLAGS we use internally and those needed to build.
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:38:07 -05:00
Peter Jones
934f137f47 Move VERSION= to Make.version so we can include it at other places.
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:38:05 -05:00
Peter Jones
b2fab69357 Always pass -Wa,-g to gcc when building .S files
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
2e8e864a6c Make travis use a newer distro
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
8e2618043a apps: Ignore some minor type errors on 32-bit builds. 2021-02-19 17:37:43 -05:00
Peter Jones
65c108d343 Fix efi_main definition in apps that had *image
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
49da74c183 Minor whitespace fixups 2021-02-19 17:37:43 -05:00
Peter Jones
d2840846c2 Add definitions for the EFI Adapter Information Protocol
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
39a76458bd CFLAGS: add -Wno-pointer-sign
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
4d6cdb5eed Use CFLAGS with "gcc -print-libgcc-file-name" to get the right one.
This makes us use CFLAGS when trying to find libgcc, so we don't get the
one with the wrong endian or float ABI.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
8ba0808e5c Fix the arch subdirs in .gitignore.
Currently they'll exclude e.g. inc/x64/ by accident; this makes it only
apply to the top level.

Also adds vim temp files to the ignore list.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
b3b21dd906 lfbgrid: Make pointer size testing not arch name dependent.
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
9f75c5e5cd Switch to -fPIE
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
e403a206a6 Implement Print(L"%p", ptr);
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
2011717351 Semi-asciibetize _Print()'s formatters.
This is ascii order but with upper and lower case letters mixed, so
things like 'X' and 'x' that use fallthrough still stay together.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
c77b499eea Supply makefile templates.
This supplies template makefiles for applications consuming gnu-efi to
use as:

include efi.mk

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
d18661a11d Rename our installed .o and linker scripts.
Since crt0 and our linker scripts are now in a subdirectory, there's no
need to make them named differently in the installed machine.  This
renames them to crt0.o and efi.lds .

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
33469a5654 Install all headers for all arches.
This further enables cross-builds by installing all the arches headers.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
70facc46b3 Install our libraries in $(LIBDIR)/gnuefi/$(ARCH)
This makes it possible to install all the output on the same machine for
cross-builds.  This also adds "install_compat", which uses the previous
paths.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
57e36b9ecf Make: make "make DESTDIR=../foo install" work right.
This makes the normal DESTDIR= variable work on the command line, and
makes relative paths always relative to the top-level directory.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:43 -05:00
Peter Jones
af5955d795 Make: make TOPDIR actually work and get rid of unused CDIR
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:37:41 -05:00
Peter Jones
6922cd2446 Make CHAR8 and similar be defined the same way edk2 does it.
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:35:37 -05:00
Peter Jones
7b91ae1673 Make our dummy .reloc sections not depend on section order.
Currently on x64 we manually build a dummy .reloc table entry by using a
symbol in .text and subtracting its address from another symbol that's
inside the .reloc section.  On ia32 we just use its location.  In either
case, if the linker puts either section in a location we're not
expecting, the .reloc table winds up having invalid values, and the PE
loader will fail to load the binary.

This changes it to be two symbols that are both in .text, making the
result unrelated to the section order or location.

It's not clear to me that these .reloc entries are actually necessary at
all, but I'm going to leave them in place for now, in case they are.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-19 17:35:37 -05:00