david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

152 Commits

Author SHA1 Message Date
Michael Brown 6ef1f51f10 [build] Remove obsolete check for GNU as version 2.9.1
Reported-by: Dewey Hylton <dewey@hyltown.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-21 13:13:46 +00:00
Michael Brown 1403bda951 [build] Fix building on OpenBSD 5.4
OpenBSD 5.4 seems to generate dynamically linked binaries by default,
which breaks our build process.  Fix by forcing the linker to always
create static binaries.

Reported-by: Jiri B <jirib@devio.us>
Tested-by: Jiri B <jirib@devio.us>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-02 15:58:38 +00:00
Michael Brown ca319873bf [build] Fix %.licence build target
Our use of --gc-sections causes the linker to discard the symbols
defined by FILE_LICENCE(), meaning that the resulting licence
determination is incomplete.

We must use the KEEP() directive in the linker script to force the
linker to not discard the licence symbols.  Using KEEP(*(COMMON))
would be undesirable, since there are some symbols in COMMON which we
may wish to discard.

Fix by placing symbols defined by PROVIDE_SYMBOL() (which is used by
FILE_LICENCE()) into a special ".provided" section, which we then mark
with KEEP().  All such symbols are zero-length, so there is no cost in
terms of the final binary size.

Since the symbols are no longer in COMMON, the linker will reject
symbols with the same name coming from multiple objects.  We therefore
append the object name to the licence symbol, to ensure that it is
unique.

Reported-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-16 00:50:54 +02:00
Michael Brown dbea47ce7d [build] Add efidrv.cab target for UEFI Secure Boot signing
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-05-14 20:46:53 +01:00
Michael Brown 640ab792a4 [build] Provide "allXXXs" targets for all media on all platforms
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-05-14 16:18:44 +01:00
Michael Brown 05d11b7337 [build] Use $(eval) if available
When the $(eval) function is available (in GNU make >= 3.80), we can
evaluate many of the dynamically-generated Makefile rules directly.
This avoids generating a few hundred Makefile fragments in the
filesystem, and so speeds up the build process.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-05-14 14:28:30 +01:00
Michael Brown e5cbfefdf3 [build] Use -Wno-decl when running sparse
Linker table entries must be non-static in order to avoid being
completely optimised away by some versions of gcc.  Use -Wno-decl to
prevent sparse from warning about these, since the alternative would
be to litter the code with otherwise unnecessary "extern"
declarations.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-04-28 16:43:32 +01:00
Michael Brown 39ab88ac09 [build] Allow sparse to be invoked via "make C=1"
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-04-25 14:56:48 +01:00
Michael Brown 5b9ce33c5c [build] Allow sparse to find compiler.h
sparse seems to have problems finding compiler.h when specified as
"-include compiler.h"; one possible explanation is that it ignores the
include path.  Fix by using "-include include/compiler.h".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-04-25 13:45:41 +01:00
Thomas Miletich f68b4069b1 [build] Make version.o depend on the git index
The version number string is currently updated only if version.o
happens to be rebuilt due to changes in its dependencies.  Add a
dependency upon the git index, so that the version number is updated
after any checkout.

Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-11-02 15:00:09 +00:00
Michael Brown 4867085c0c [build] Include version number within only a single object file
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-11-02 14:46:39 +00:00
Michael Brown 0932bc5156 [build] Inhibit .eh_frame on newer gcc versions
Using -fno-dwarf2-cfi-asm is not sufficient to prevent the .eh_frame
section from being generated on newer versions of gcc.  Add
-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables;
this is sufficient to inhibit the .eh_frame section on gcc 4.7.1.

This does not affect the overall binary size, but does fix the numbers
reported by "size" for individual object files.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-11-02 13:41:50 +00:00
Anton D. Kachalov 34a637f46f [build] Display commands for dependency generation when building with V=1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-08-27 00:24:23 +01:00
Michael Brown 4fa1a2b4fe [crypto] Rename KEY= to PRIVKEY= and "key" to "privkey"
The setting name "key" conflicts with the setting name "key" already
in use by the 802.11 code.  Resolve the conflict by renaming the newer
setting to "privkey".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-22 01:13:43 +01:00
Michael Brown 0e59417cec [build] Use $(xxx_DEPS) for additional dependency information
Some objects (embedded.o, rootcert.o, and clientcert.o) define
additional dependencies on external files, using syntax such as:

    $(BIN)/clientcert.o : $(CERT_LIST)

This dependency can be missed when using debug builds.  For example,
if DEBUG=clientcert is used, then the relevant object is
$(BIN)/clientcert.dbg1.o rather than $(BIN)/clientcert.o.

Fix by adding dependencies to $(clientcert_DEPS) instead:

    clientcert_DEPS += $(CERT_LIST)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 13:15:44 +01:00
Michael Brown 196751ce95 [build] Enable warnings when building utilities
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 19:38:54 +01:00
Michael Brown 8685280cbd [build] Allow a client certificate to be specified at build time
Allow a client certificate and corresponding private key to be
specified at build time using the syntax

  make CERT=/path/to/certificate KEY=/path/to/key

The build process uses openssl to convert the files into DER format,
and includes them within the client certificate store in
clientcert.c.  The build process will prompt for the private key
password if applicable.

Note that the private key is stored unencrypted, and so the resulting
iPXE binary (and the temporary files created during the build process)
should be treated as being equivalent to an unencrypted private key
file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-20 20:39:11 +00:00
Michael Brown aee3a064f2 [build] Allow trusted root certificates to be specified at build time
Allow trusted root certificates to be specified at build time using
the syntax

  make TRUST=/path/to/certificate1,/path/to/certificate2,...

The build process uses openssl to calculate the SHA-256 fingerprints
of the specified certificates, and adds them to the root certificate
store in rootcert.c.  The certificates can be in any format understood
by openssl.

The certificates may be server certificates or (more usefully) CA
certificates.

If no trusted certificates are specified, then the default "iPXE root
CA" certificate will be used.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 00:23:29 +00:00
Michael Brown 95d82bb2a2 [build] Avoid using -ffunction-sections on some older versions of gcc
Some older versions of gcc issue a warning if -ffunction-sections is
used in combination with -g (gcc bug #18553).  Inhibit
-ffunction-sections when building with such a version of gcc.

Reported-by: zhengwei <zw111_2001@126.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-06-29 11:48:29 +01:00
Michael Brown 57e65d2c4d [build] Accept EMBED=... as a synonym for EMBEDDED_IMAGE=...
Make the build command line less cumbersome by accepting

  make DEBUG=int13 EMBED=test.ipxe

rather then

  make DEBUG=int13 EMBEDDED_IMAGE=test.ipxe

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-04-28 11:56:27 +01:00
Michael Brown bd9ff16c21 [build] Run parserom.pl only on potential driver files
PCI_ROM() and ISA_ROM() macros occur only within driver files.
Running parserom.pl on non-driver files is therefore redundant.

Skip running parserom.pl on any files outside a "drivers" directory.
This reduces the time taken to generate build rules and dependencies
after a "make veryclean" by around 12%.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-04-09 23:41:45 +01:00
Michael Brown 6e6ecacebf [build] Refuse to attempt building with the GNU gold linker
GNU gold (part of newer binutils builds) does not appear to be
designed to support generic linker functionality, since its source
code contains several Linux-specific hard-coded assumptions about the
layout of ELF binaries.  Attempting to build iPXE using GNU gold will
generally cause some kind of "linker internal error".

Provide an explicit error message suggesting the use of GNU ld
instead.

Reported-by: Chris Hills <chaz@chaz6.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-04-05 14:59:27 +01:00
Michael Brown 7514172b50 [build] Perform tool checks on each make invocation
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-04-05 14:51:03 +01:00
Bastian Blank 293e347a2e [build] Add "allmroms" target
Signed-off-by: Bastian Blank <waldi@debian.org>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-30 16:19:23 +01:00
Michael Brown 647522793d [build] Include $(BIN)/errors in "make clean"
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-30 15:55:14 +01:00
Michael Brown 83994886ab [build] Remove obsolete "allzroms" target
The .zrom format has not existed since around 2007.  ROMs are now
compressed by default.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-30 15:22:19 +01:00
Gilles Espinasse fe61f6de0d [build] Fix compilation when gcc is patched to default to -fPIE -Wl,-pie
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-29 15:33:28 +01:00
Michael Brown 7ccd5b831a [build] Delete incomplete targets if building fails for any reason
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-27 22:37:03 +01:00
Michael Brown c8e51f80a8 [build] Avoid spurious address comparison warnings in gcc 4.6
A construction such as "assert ( ptr != NULL )" seems to trigger a
false positive warning in gcc 4.6 if the value of "ptr" is known at
compile-time to be non-NULL.  Use -Wno-address to inhibit this
warning.

Reported-by: Ralph Giles <giles@thaumas.net>
Tested-by: Ralph Giles <giles@thaumas.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 19:32:17 +00:00
Michael Brown b8924c1aed [build] Allow workaround-specific flags to override default flags
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 19:31:41 +00:00
Michael Brown 9b68dc78b9 [build] Avoid rebuilding keymap files automatically
The keymap files, though autogenerated, are checked in to version
control and should be considered as source files.  They should never
be automatically rebuilt.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 14:06:46 +00:00
Michael Brown 1febd879e3 [console] Add keymap generator
Inspired by LILO's keytab-lilo.pl, genkeymap.pl uses "loadkeys -b" to
obtain a Linux keyboard map, and generates a file keymap_xx.c in
hci/keymap.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 12:02:59 +00:00
Michael Brown 3f13e3d5d2 [build] Allow DEBUG=... to affect builds of assembler source files
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-01 14:18:35 +00:00
Michael Brown 030e5a064e [build] Use unique entry symbols for each prefix
Some binutils versions will drag in an object to satisfy the entry
symbol; some won't.  Try to cope with this exciting variety of
behaviour by ensuring that all entry symbols are unique.

Remove the explicit inclusion of the prefix object on the linker
command line, since the entry symbol now provides all the information
needed to identify the prefix.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-02-23 21:12:56 +00:00
Michael Brown 623469de5d [build] Eliminate unused sections at link-time
Use -ffunction-sections, -fdata-sections, and --gc-sections to
automatically prune out any unreferenced sections.

This saves around 744 bytes (uncompressed) from the rtl8139.rom build.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-02-22 21:02:00 +00:00
Michael Brown e65e4e930c [legal] Ignore config/local header files for licensing purposes
The config/local/*.h files are expected to be empty in most cases.
This should not cause a licence determination to fail.

Fix by ignoring config/local/*.h for licensing purposes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-10-18 01:25:42 +01:00
Michael Brown c9aff55320 [build] Fix building elf2efi using binutils 2.20
When using binutils 2.20, it seems to be necessary to add -ldl to link
against -lbfd.

Reported-by: Duane Voth <duanev@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-10-14 23:01:15 +01:00
Michael Brown 42a1f43bf9 [build] Provide %.fd0 build targets only for pcbios
Originally-fixed-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-17 14:36:39 +01:00
Piotr Jaroszyński 2d98d4a018 [build] Properly handle multiple goals per BIN directory
When building multiple targets per BIN with multiple jobs, for
example:

  make -j16 bin-i386-efi/ipxe.efi{,drv,rom} bin-x86_64-efi/ipxe.efi{,drv,rom}

we would invoke a make subprocess for each goal in parallel resulting
in multiple makes running in a single BIN directory.  Fix by grouping
goals per BIN directory and invoking only one make per BIN.  It is
both safer and faster.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-16 17:26:20 +01:00
Geoff Lywood b8dd94686b [efi] Fix the 32-bit version of elf2efi64
Currently, if elf2efi.c is compiled using a 32-bit HOST_CC, then the
resulting elf2efi64 binary will generate 32-bit EFI binaries instead
of 64-bit EFI binaries.

The problem is that elf2efi.c uses the MDE_CPU_* definitions to decide
whether to output a 32-bit or 64-bit PE binary.  However, MDE_CPU_*
gets defined in ProcessorBind.h, depending on the compiler's target
architecture.  Overriding them on the command line doesn't work in the
expected way, and you can end up in cases where both MDE_CPU_IA32 and
MDE_CPU_X64 are defined.

Fix by using a separate definition, EFI_TARGET_IA32/EFI_TARGET_X64,
which is specified only on the command line.

Signed-off-by: Geoff Lywood <glywood@vmware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-21 12:41:41 +01:00
Michael Brown 770317a57d [build] Speed up rebuilding on header file changes
Split src_template into deps_template (which handles the definition of
foo_DEPS) and rules_template (which handles the rules referencing
foo_DEPS).  The rules_template is not affected by any included header
files and so does not need to be reprocessed following a change to an
included header file.

This reduces the time required to rebuild the Makefile rules following
a change to stdint.h by around 45%, at a cost of increasing the time
required to rebuild after a "make veryclean" by around 3%.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-14 18:47:35 +01:00
Michael Brown f00c3c619a [build] Standardise variable naming for inter-build state files
For files such as $(BIN)/.blib.list, standardise the variable names
used to represent the file contents.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-14 17:45:49 +01:00
Michael Brown 4d73b49d60 [build] Avoid unnecessary "rm" and "touch" in dependency generation
Speed up dependency generation by omitting the totally unnecessary
"rm" and "touch" commands.  This reduces the time taken to generate
dependencies by around 6%.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-14 17:00:51 +01:00
Michael Brown 719b49879d [build] Fix broken build caused by implied dependency upon "perl"
Commit ea12dc0 ("[build] Avoid hard-coding the path to perl")
introduced a build failure for fully clean trees (e.g. after running
"make veryclean"), since the dependency upon $(PARSEROM) now includes
a dependency upon "perl" (which doesn't exist) rather than upon
"/usr/bin/perl" (which does exist).

There should of course be no dependency upon the perl binary at all;
the dependency should be upon "./util/parserom.pl" alone.

Fix by removing the $(PERL) from the definition of Perl-based utility
paths, and adding $(PERL) at the point of usage.

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-06-24 17:25:54 +01:00
Michael Brown 6c0e8c14be [libc] Enable automated extraction of error usage reports
Add preprocessor magic to the error definitions to enable every error
usage to be tracked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-31 03:11:57 +01:00
Geoff Lywood 6514d6430d [dhcp] Use correct DHCP options on EFI systems
See RFC 4578 for details.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-29 08:51:46 +01:00
Geoff Lywood a5ad78f27e [build] Allow building against a zlib in a non-standard location
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-27 23:00:07 +01:00
Piotr Jaroszyński c68839d4d6 [efi] Fix .efi and .efidrv linking
The linker chooses to look for _start first and always picks
efidrvprefix.o to satisfy it (probably because it's earlier in the
archive) which causes a multiple definition error when the linker
later has to pick efiprefix.o for other symbols.

Fix by using EFI-specific TGT_LD_FLAGS with an explicit entry point.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-27 10:38:12 +01:00
Piotr Jaroszyński ba27168c2e [efi] Fix link order for elf2efi
Dependencies are considered in left-to-right order so the source file
needs to come first in this case.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-27 10:15:49 +01:00
Michael Brown 28f73ca54e [build] Inhibit "skipping incompatible" message from ld
On 64-bit systems with both 32-bit and 64-bit libraries installed, ld
tends to generate noisy "skipping incompatible /usr/lib/libxxx.so"
messages when building elf2efi.c.

Fix by passing --no-warn-search-mismatch to ld.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-27 09:42:53 +01:00