Commit graph

93 commits

Author SHA1 Message Date
Colin Watson
35b909062e gnulib: Upgrade Gnulib and switch to bootstrap tool
Upgrade Gnulib files to 20190105.

It's much easier to maintain GRUB's use of portability support files
from Gnulib when the process is automatic and driven by a single
configuration file, rather than by maintainers occasionally running
gnulib-tool and committing the result.  Removing these
automatically-copied files from revision control also removes the
temptation to hack the output in ways that are difficult for future
maintainers to follow.  Gnulib includes a "bootstrap" program which is
designed for this.

The canonical way to bootstrap GRUB from revision control is now
"./bootstrap", but "./autogen.sh" is still useful if you just want to
generate the GRUB-specific parts of the build system.

GRUB now requires Autoconf >= 2.63 and Automake >= 1.11, in line with
Gnulib.

Gnulib source code is now placed in grub-core/lib/gnulib/ (which should
not be edited directly), and GRUB's patches are in
grub-core/lib/gnulib-patches/.  I've added a few notes to the developer
manual on how to maintain this.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-03-05 10:48:12 +01:00
Adam Williamson
8b467844e1 python: Use AM_PATH_PYTHON to determine interpreter for gentpl.py
gentpl.py is python2/3-agnostic, but there's no way to cause it
to be run with any interpreter other than 'python', it's just
hard-coded into Makefile.common that way. Adjust that to use
AM_PATH_PYTHON (provided by automake) to find an interpreter
and run gentpl.py with that instead. This makes grub buildable
when `python` does not exist (but rather `python3` or `python2`
or `python2.7`, etc.) Minimum version is set to 2.6 as this is
the first version with `__future__.print_function` available.

Note, AM_PATH_PYTHON respects the PYTHON environment variable
and will treat its value as the *only* candidate for a valid
interpreter if it is set - when PYTHON is set, AM_PATH_PYTHON
will not try to find any alternative interpreter, it will only
check whether the interpreter set as the value of PYTHON meets
the requirements and use it if so or fail if not. This means
that when using grub's `autogen.sh`, as it too uses the value
of the PYTHON environment variable (and if it is not set, just
sets it to 'python') you cannot rely on AM_PATH_PYTHON
interpreter discovery. If your desired Python interpreter is
not just 'python', you must set the PYTHON environment variable,
e.g. 'PYTHON=/usr/local/bin/python3 ./autogen.sh'. The specified
interpreter will then be used both by autogen.sh itself and by
the autotools-driven build scripts.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2018-09-27 14:52:28 +02:00
Vladimir Serbinenko
fcbb723d4b Add support for device-tree-based drivers. 2017-05-08 21:19:59 +02:00
Vladimir Serbinenko
fabde8324d Remove -Wno-maybe-uninitialized as it may not be present. 2016-02-17 17:58:05 +01:00
Vladimir Serbinenko
5cae910665 Fix warnings when compiling with -O3 2016-02-17 17:56:41 +01:00
Vladimir Serbinenko
68e158dffd Strip .ARM.exidx
This section is generated by clang and is useful only for debugging.
It contains exotic relocations, so strip them to avoid them interferring
with module loading.
2015-12-31 18:13:59 +01:00
Vladimir Serbinenko
b2fc9acdc9 Adapt build-system to use imported xen headers. 2015-11-08 21:24:18 +01:00
Paulo Flabiano Smorigo
afd0f21b20 Add flag for powerpc ieee1275 to avoid unneeded optimizations 2015-06-15 09:10:19 -03:00
Vladimir Serbinenko
064360e667 Remove libgcc dependency.
libgcc for boot environment isn't always present and compatible.
libgcc is often absent if endianness or bit-size at boot is different
from running OS.
libgcc may use optimised opcodes that aren't available on boot time.
So instead of relying on libgcc shipped with the compiler, supply
the functions in GRUB directly.
Tests are present to ensure that those replacement functions behave the
way compiler expects them to.
2015-03-03 20:50:37 +01:00
Vladimir Serbinenko
155f334f57 Experimental support for clang for sparc64.
Automatically discover command line options to make clang and
gcc behave in same way.

Tested with qemu.
2015-02-22 01:54:55 +01:00
Vladimir Serbinenko
e3c7aca76d Strip .MIPS.abiflags which causes compile failure 2015-02-21 16:01:53 +01:00
Vladimir Serbinenko
11504d523c conf/Makefile.common: Remove unused {LD,C}FLAGS_CPU. 2015-01-24 17:44:19 +01:00
Vladimir Serbinenko
6d05b6383c Revert " Use -Wl,--no-relax rather than -mno-relax for uniformity."
This reverts commit 063f2a04d1.
2014-09-21 19:02:11 +02:00
Vladimir Serbinenko
0438ebf1c3 * conf/Makefile.common: Don't include non-existing directory
grub-core/lib/libgcrypt-grub/include.
2013-12-21 13:21:42 +01:00
Vladimir Serbinenko
a29f317af1 Allow compilation without thumb-interwork as long as no thumb is
involved or only thumb2 is used.
2013-12-18 13:33:39 +01:00
Vladimir Serbinenko
063f2a04d1 Use -Wl,--no-relax rather than -mno-relax for uniformity. 2013-12-18 13:13:23 +01:00
Vladimir Serbinenko
60b967be7e Make i386-* other than i386-pc compileable under cygwin. 2013-12-14 23:12:53 +01:00
Vladimir Serbinenko
eaf01c25fe Add missing compile and link options for sparc64-emu. 2013-12-10 00:05:28 +01:00
Vladimir Serbinenko
c311ced5d7 Make arm-emu work. 2013-12-08 02:59:21 +01:00
Vladimir Serbinenko
4182262560 Don't add -mlong-calls when compiling with clang. 2013-12-06 11:58:17 +01:00
Vladimir Serbinenko
e3046431da * conf/Makefile.common (CFLAGS_GNULIB): Remove -Wno-old-style-definition
as it's no longer necessarry.
2013-12-04 14:32:04 +01:00
Leif Lindholm
b29b77fee2 New port arm64-efi 2013-11-30 16:50:31 +01:00
Vladimir Serbinenko
af1faca3f8 * conf/Makefile.common: Remove -mexplicit-relocs and -DUSE_ASCII_FALLBACK on yeeloong.
-DUSE_ASCII_FALLBACK is already added by font snippets.
	-mexplicit-relocs isn't needed is compiler/assemblera are
	configured properly.
	If they're not we shouldn't attempt to fix it by ourselves.
	Binary compare between before and after shows no difference.
2013-11-29 03:45:50 +01:00
Colin Watson
ab4f15013a Generate Makefile.*.am directly from gentpl.py, eliminating the use of Autogen. The Autogen definitions files remain intact as they offer a useful abstraction. 2013-11-26 17:13:01 +00:00
Vladimir Serbinenko
d6c92cdc34 Merge branch 'master' into leiflindholm/arm64
Conflicts:
	include/grub/util/install.h
2013-11-25 13:02:27 +01:00
Vladimir Serbinenko
f93ddcfd1c Don't add -mflush-func if it's not supported by compiler. 2013-11-23 12:40:44 +01:00
Vladimir Serbinenko
0d8f04cd83 Remove -march=mips3 from TARGET_CCASFLAGS as it creates linking problem
when rest of GRUB is compiled for hisher stepping. Instead use
	.set mips3/.set mips1 around cache and sync opcodes.
2013-11-22 04:36:53 +01:00
Leif Lindholm
15a463d742 ARM 64 port by Leif Lindholm 2013-11-16 20:52:55 +01:00
Vladimir Serbinenko
2416415c53 * conf/Makefile.common (CCASFLAGS_PLATFORM) [COND_arm]: Add
-mthumb-interwork.
2013-11-14 08:34:54 +01:00
Vladimir Serbinenko
9612ebc00e Add new ports: i386-xen and x86_64-xen. This allows running GRUB in
XEN PV environment and load kernels.
2013-11-09 21:29:11 +01:00
Vladimir Serbinenko
d5524ca87b * configure.ac: Run linker tests without -Werror.
Define TARGET_LDFLAGS_STATIC_LIBGCC and TARGET_LIBGCC.
	Change all occurences of -static-libgcc resp -lgcc to
	TARGET_LDFLAGS_STATIC_LIBGCC resp TARGET_LIBGCC.
2013-11-07 18:21:22 +01:00
Vladimir Serbinenko
60375a88fe Allow compiling with clang (not really supported though).
* conf/Makefile.common (CFLAGS_PLATFORM): Don't add -mrtd -mregparm=3
	unconditionally.
	* configure.ac: Add -no-integrated-as when using clangfor asm files.
	Add -mrtd -mregparm=3 on i386 when not using clang.
	* grub-core/kern/misc.c (grub_memset): Add volatile when on clang.
2013-11-07 11:44:40 +01:00
Vladimir Serbinenko
d1307d873a Import libgcrypt 1.5.3. 2013-11-07 06:35:50 +01:00
Vladimir Serbinenko
cdc17f60dc * configure.ac: Add -freg-struct-return on all platforms that
support it.
2013-11-07 03:33:20 +01:00
Vladimir Serbinenko
ec0ebb3fc2 Remove vestiges of -Wunsafe-loop-optimisations.
* conf/Makefile.common (CFLAGS_GNULIB): Remove
	-Wno-unsafe-loop-optimisations.
	* grub-core/commands/legacycfg.c: Remove -Wunsafe-loop-optimisations
	pragma.
	* grub-core/io/gzio.c: Likewise.
	* grub-core/script/parser.y: Likewise.
	* grub-core/script/yylex.l: Likewise.
	* util/grub-mkfont.c: Likewise.
2013-11-07 02:25:31 +01:00
Vladimir Serbinenko
2855a0fcce * conf/Makefile.common (CFLAGS_PLATFORM): Remove poisoning of float
and double.
2013-11-02 16:25:13 +01:00
Vladimir Serbinenko
af81ed880d * conf/Makefile.common (CPPFLAGS_KERNEL): Add -DGRUB_KERNEL=1.
* include/grub/dl.h (GRUB_MOD_INIT), (GRUB_MOD_FINI): Define
	functions when compiling for kernel.
2013-10-25 16:07:01 +02:00
Vladimir 'phcoder' Serbinenko
7abdac8e13 * conf/Makefile.common: Use -freg-struct-return on i386. This
decreases code size and improves performance.
2013-10-19 23:56:59 +02:00
Vladimir 'phcoder' Serbinenko
f7b69a3f2c * autogen.sh: Don't set LC_CTYPE as it doesn't create problem for
compilation but prevents gcc from displaying messages in non-Latin
	alphabets.
	* conf/Makefile.common: Likewise.
2013-10-17 01:09:19 +02:00
Vladimir 'phcoder' Serbinenko
d9104204ac * conf/Makefile.common (CPPFLAGS_LIBFDT): Remove leftover. 2013-09-23 14:08:26 +02:00
Vladimir 'phcoder' Serbinenko
8f0baaac38 * configure.ac: Add -Wl,-melf_i386 and -Wl,-melf_x86_64 systematically
when on x86 and not cygwin.
	* conf/Makefile.common: Remove unsystematic -Wl,-melf_i386 and
	-Wl,-melf_x86_64.
2013-08-22 19:00:25 +02:00
Vladimir 'phcoder' Serbinenko
fd7dd66dbd * conf/Makefile.common (CFLAGS_GCRY): Add -Wno-redundant-decls. 2013-08-22 16:30:44 +02:00
Vladimir 'phcoder' Serbinenko
00c28dd9bc * conf/Makefile.common: Fix typo. 2013-08-21 20:59:18 +02:00
Vladimir 'phcoder' Serbinenko
7c9d0c39af Fix handling of build-time grub-bin2h and grub-mkfont when doing
full Canadian cross. Tested with build=x86_64, host=arm,
	target=ppc-ieee1275.
2013-08-14 10:56:55 +02:00
Vladimir 'phcoder' Serbinenko
ae27e4d323 Merge mainline into arm 2013-07-16 18:43:43 +02:00
Vladimir 'phcoder' Serbinenko
ccfc0bdb53 Fix typo (failback vs fallback). 2013-06-07 15:35:16 +02:00
Vladimir 'phcoder' Serbinenko
57e0c20cb5 * Makefile.am, conf/Makefile.common: Fix compilation problem with some
automake versions.
2013-05-30 21:36:12 +02:00
Andrey Borzenkov
17806392f1 * gentpl.py: Replace EXTRA_DIST with dist_noinst_DATA or
dist_<directory>_DATA. EXTRA_DIST is ignored by automake inside
	false conditions.
	* conf/Makefile.common: define dist_grubconf_DATA
2013-05-14 20:54:05 +04:00
Vladimir 'phcoder' Serbinenko
8e71d87482 merge mainline into arm 2013-05-11 10:24:24 +02:00
Vladimir 'phcoder' Serbinenko
3e912fda81 * conf/Makefile.common: Poison float and double on non-emu. 2013-05-08 11:05:37 +02:00