Commit Graph

17 Commits

Author SHA1 Message Date
Heinrich Schuchardt b95f138fa1 Initial support for RISCV64
Add the RISCV64 architecture

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-01 17:17:33 +02:00
Ben Wolsieffer 44267b59d8 Fix ARCH on ARMv6.
Extends the armv7 ARCH sed expression to work correctly on armv6.

Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
2019-12-04 11:47:40 -05:00
Peter Jones 656e495d51 Call ar in deterministic mode.
We need the x86_64 and i686 builds of .a's to be the same, and that
means we need to not have timestamps.  Also force the timestamps on disk
just in case that doesn't work, because RHEL's ar /silently ignores -D/.

v2: use "ar rvD" not "ar rv -D".

It's a wonder anybody ever gets these command line options right, if
"ar rv -D libfoo.a foo.o" doesn't use deterministic mode (or
complain), but "ar rvD libfoo.a foo.o" does.

v3: Add a bunch of junk to try to set timestamps to 0 manually

For some reason I'm still getting timestamps in the .a even though ar seems to
be invoked correctly.  When I do "mock -r rhel-7-build --shell" and run make
manually, they're fine.  Very strange.

v4: go back to v2, the problem isn't in the make process.

"ar rDv" works just fine, but /usr/lib/rpm/redhat/brp-strip-static-archive is
calling "%{__strip} -g $for_each.a", and it's rewriting our binary from
ts/uid/gid of 0/0/0 to $epoch/$UID/$GID.  Awesomely /usr/bin/strip it seems to
have 3 modes of operation:
-U: the default, which adds $epoch/$UID/$GID to your binary archive
    instead of just removing stuff.  Clearly the Principle of Least
    Surprise is strong here.
-p: preserve the timestamp from the original .a, but add UID and GID,
    because this is 1980 and people use ar(1) for archiving stuff they
    might want that out of.
-D: Condescend at you in a command line error and explain that -D both
    is and is not a valid option:
      /usr/bin/strip: invalid option -- 'D'
      Usage: /usr/bin/strip <option(s)> in-file(s)
      Removes symbols and sections from files
      The options are:
      ...
      -D --enable-deterministic-archives
                  Produce deterministic output when stripping archives
    So I agree that it's invalid, but I think we may be pronouncing that
    second vowel differently.  They say in-VAL-id, I say IN-vuh-lid.

Nobody should ever have to run "strace -ttt -v -f -o make.strace make all",
just to discover the problem isn't even in there.

Related: rhbz#1310782

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones be57aadba6 Nerf -Werror=pragma away
Nerf -Werror=-pragma away

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones 2c624c22fe Make ARCH overrideable on the command line
Make ARCH overrideable on the command line.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones f0bf464a37 make clang not complain about -fno-merge-all-constants
Make clang not complain about -fno-merge-all-constants

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones 5fa13d4609 Fix arm build paths in the makefile
Previous work was apparently done with arm-linux-gnueabi-gcc as a
cross-builder, but our armv7 builders have native gcc with the target as
armv7hl-linux-gnueabi, so we need to munge the arch there to get our arm
path.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:22 -04:00
Nigel Croxon 99d94682de [PATCH] Disable AVX instruction set on IA32 and x86_64 platforms
If gnu-efi is compiled with "-march=native" on a host that supports AVX, both
gcc and clang will use AVX instructions freely which is currently not supported
and will result in a non-functional gnu-efi build (e.g. black screen, hangs).

For now, disable AVX on IA32 and x86_64 by checking first if the compiler does
actually support the appropriate flag (-mno-avx) and use it if possible.

Credit for the compiler command line to check if a flag is supported goes to
Gentoo's awesome flag-o-matic eclass, where it is taken from. Thanks.

Signed-off-by: Matthias Dahl <matthias.dahl@binary-island.eu>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-07-13 08:43:16 -04:00
Nigel Croxon 787cb7fcd8 fix clang support.
Tested:
  make all apps + tests apps/ on x86_64
  make CC=clang all apps + tests apps/ on x86_64

Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-02-17 16:24:26 -05:00
Nigel Croxon 3f234f5b6f Add support for 64 bit MIPS
This is a patch to add support for 64-bit MIPS.

Signed-off-by: Hev heiher <heiher@users.sf.net>
Signed-off-by: Nigel Croxon <noxorc@mac.com>
2017-01-08 07:04:52 -05:00
Nigel Croxon bd38ba4b6b GNU ar warning about deterministic mode
GNU ar currently produces the following string of warnings:
Warning: Archive 'libefi.a' seems to have been created in
deterministic mode.
'<file>.o' will always be updated. Please consider passing
the U flag to ar to avoid the problem. This patch fixes the issue.

Signed-off-by: Pete Batard <pete@akeo.ie>
Signed-off-by: Nigel Croxon <noxorc@users.sf.net>
2016-11-21 10:59:13 -05:00
Nigel Croxon b2c4db065f I did a quick review of the MS x86_64 calling convention for floating
point and as far as I can tell it agrees with the UEFI spec.
The attached patch removes -mno-mmx and -mno-sse for x86_64 and adds
a new Print target, "%f", to print float and double types.

It seems to compile for ia32, although I'm not sure why - shouldn't
it be throwing errors because the new function FloatToStr() in print.c
accepts a float, yet I left -no-sse for ARCH=ia32? A better solution
might be to add -msoft-float for targets where the floating point
calling convention doesn't match the UEFI spec. As I'm not familiar
with UEFI on ia32, I didn't make any changes to it.

Signed-off-by: Nathan Blythe <nblythe@lgsinnovations.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-06-17 10:07:25 -04:00
Nigel Croxon 50b883773f -fpic is not needed for MinGW, and MinGW32 issues a warning as a
result, which breaks gnu-efi compilation due to -Werror:
gnu-efi/lib/boxdraw.c:1:0: error: -fpic ignored for target
(all code is position independent) [-Werror]

This patch ensures that -fpic is disabled when MinGW is used.

Signed-off-by: Pete Batard <pbatard@users.sf.net>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-29 10:16:21 -04:00
Nigel Croxon a213b514a3 Note that there are probably some bugs on some architectures that
I havan't fixed, so somebody will see a build failure from this.
It will most likely be very easy to fix.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-03 16:34:17 -05:00
Nigel Croxon 11a459ba96 This patch makes the following symbols (relatively) consistent between
all of our linker scripts:

_text
_etext
_text_size
_data
_edata
_data_size

There are various things that are slightly different (positions of
.rela*, .dynamic, and similar in relation to .data), but _text and _data
are now always at the beginning of their respective sections with regard
to how a debuger would reference the debug info, and _etext and _edata
are now always extant and guaranteed to be after any of the respective
kind of data the debugger would look for in that section.

This also adds an application example of how it might be used, and a
makefile target for %.efi.debug which will generate a separate debuginfo
file for that example.

This also enables debugging by default (i.e. -g is in CFLAGS) and adds
.note.gnu.build-id sections to our .so files (i.e. --build-id=sha1 is in
LDFLAGS).

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-07-16 12:31:23 -04:00
Nigel Croxon ce7098fb52 Enable out-of-tree building
This patch enables building gnu-efi outside of the source tree.
That in turn enables building for multiple architectures in parallel.

The build directory is controlled by the OBJDIR make variable.  It
defaults to the value of ARCH, and can be overridden from the command
line.

This patch also cleans up some doubled slashes between INSTALLROOT
and PREFIX.

Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-02-19 11:22:45 -05:00
Nigel Croxon 530d68ba19 The gnu-efi-3.0 toplevel subdirectory is really annoying. Kill it.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2014-11-25 10:09:50 -05:00