[ipxe-devel] [PATCH 1/1] Error when building bin-arm64-efi/snp

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Jun 23 17:19:33 UTC 2017


I try to build ipxe on arm64 Debian Stretch:

git checkout 14e3b4b29a96eda6230b1c2dac6cc5e793235d5a
cd src/
make V=1 bin-arm64-efi/snp

I get the following error messages:

gcc  -q -S   --gc-sections -static  bin-arm64-efi/snp.o   -o bin-arm64-efi/snp
gcc: error: unrecognized command line option ‘-q’
gcc: error: unrecognized command line option ‘--gc-sections’; did you mean ‘--data-sections’?
<builtin>: recipe for target 'bin-arm64-efi/snp' failed

$ gcc --version
gcc (Debian 6.3.0-18) 6.3.0 20170516

Linker options should be passed with -Wl.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 src/Makefile.efi          | 2 +-
 src/Makefile.housekeeping | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Makefile.efi b/src/Makefile.efi
index 151b3318..7e45fa39 100644
--- a/src/Makefile.efi
+++ b/src/Makefile.efi
@@ -6,7 +6,7 @@ LDSCRIPT	= scripts/efi.lds
 
 # Retain relocation information for elf2efi
 #
-LDFLAGS		+= -q -S
+LDFLAGS		+= -Wl,-q -Wl,-S
 
 # Media types.
 #
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index f09db372..e7a50a3d 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -480,7 +480,7 @@ FS_TEST		= $(CC) -ffunction-sections -g -c -x c /dev/null \
 FS_FLAGS	:= $(shell $(FS_TEST) && $(ECHO) '-ffunction-sections')
 CFLAGS		+= $(FS_FLAGS) $(DS_FLAGS)
 endif
-LDFLAGS		+= --gc-sections
+LDFLAGS		+= -Wl,-gc-sections
 
 # Force creation of static binaries (required for OpenBSD, does no
 # harm on other platforms).
-- 
2.11.0




More information about the ipxe-devel mailing list