summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
authorDan HorĂ¡k <dan@danny.cz>2010-09-17 14:13:27 +0100
committerRichard W.M. Jones <rjones@redhat.com>2010-09-17 14:15:43 +0100
commitbeade5dece2fa01d78da8a2f12d5a86adc96ad13 (patch)
tree1eeab4bf0d4eaf38ee5b43e410c9d5e9dc9b3b6e /helper
parentdd4179bf7bcb8314c21b8863cce3a9594813855c (diff)
downloadfebootstrap-beade5dece2fa01d78da8a2f12d5a86adc96ad13.tar.gz
febootstrap-beade5dece2fa01d78da8a2f12d5a86adc96ad13.tar.xz
febootstrap-beade5dece2fa01d78da8a2f12d5a86adc96ad13.zip
Fix elf-default-arch detection to work on secondary archs (RHBZ#634951)
Recent state of the elf-default-arch script and the hardcoded i386 arch doesn't allow building on other arches than ix86 or x86_64. See attachment for a fix. Can be easily extended to support additional secondary arches by adding new patterns to the elf-default-arch script
Diffstat (limited to 'helper')
-rw-r--r--helper/Makefile.am5
-rwxr-xr-xhelper/elf-default-arch6
2 files changed, 7 insertions, 4 deletions
diff --git a/helper/Makefile.am b/helper/Makefile.am
index 940a2ee..804fa49 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -43,12 +43,13 @@ init_CFLAGS = -static
init_LDFLAGS = -all-static
# http://www.doof.me.uk/2010/05/07/cute-objcopy-hack/
-ELF_DEFAULT_ARCH = $(shell $(srcdir)/elf-default-arch)
+ELF_DEFAULT_ARCH = $(shell $(srcdir)/elf-default-arch | gawk '{ print $$1 }')
+DEFAULT_ARCH = $(shell $(srcdir)/elf-default-arch | gawk '{ print $$2 }')
ext2init.o: init
strip --strip-all $<
@file $< | grep -isq static || \
(echo "*** error: init is not staticly linked"; exit 1)
- objcopy -I binary -B i386 -O $(ELF_DEFAULT_ARCH) $< $@
+ objcopy -I binary -B $(DEFAULT_ARCH) -O $(ELF_DEFAULT_ARCH) $< $@
man_MANS = \
febootstrap-supermin-helper.8
diff --git a/helper/elf-default-arch b/helper/elf-default-arch
index 0adc351..66cfbab 100755
--- a/helper/elf-default-arch
+++ b/helper/elf-default-arch
@@ -20,8 +20,10 @@
# so instead we hard code it.
case $(uname -m) in
- i[3456]86) echo elf32-i386 ;;
- x86_64) echo elf64-x86-64 ;;
+ i[3456]86) echo "elf32-i386 i386" ;;
+ x86_64) echo "elf64-x86-64 i386" ;;
+ s390) echo "elf32-s390 s390:31-bit" ;;
+ s390x) echo "elf64-s390 s390:31-bit" ;;
*)
echo "This architecture is not recognized. Please update helper/elf-default-arch."
esac