The comparison would've always been false due to missing $.
Signed-off-by: Andreas Färber andreas.faerber@web.de --- config/scripts/switch-arch | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index 8b6563d..60782e9 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -48,7 +48,7 @@ crosscflags()
# target long bits test if test "$target" = "sparc64" -o "$target" = "ia64" \ - -o "$target" = "amd64" -o "target" = "x86_64" \ + -o "$target" = "amd64" -o "$target" = "x86_64" \ -o "$target" = "alpha"; then targetlongbits="64" else
Detect ppc64 as Big Endian and 64-bit. Reuse arch/ppc/ wherever possible.
Signed-off-by: Andreas Färber andreas.faerber@web.de --- The -m64 is not yet working in my gcc configuration. Using -mcpu=powerpc64 instead, the C files compiled but despite tweaking the linker script and adding -melf64ppc to LD there was a mismatch:
powerpc-elf-ld: powerpc:common64 architecture of input file `target/arch/ppc/qemu/start.o' is incompatible with powerpc:common output [...]
config/scripts/switch-arch | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index 60782e9..027632d 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -38,6 +38,7 @@ crosscflags() fi
if test "$target" = "powerpc" -o "$target" = "ppc" \ + -o "$target" = "powerpc64" -o "$target" = "ppc64" \ -o "$target" = "mips" -o "$target" = "s390" \ -o "$target" = "sparc32" -o "$target" = "sparc64" \ -o "$target" = "m68k" -o "$target" = "armv4b"; then @@ -49,6 +50,7 @@ crosscflags() # target long bits test if test "$target" = "sparc64" -o "$target" = "ia64" \ -o "$target" = "amd64" -o "$target" = "x86_64" \ + -o "$target" = "powerpc64" -o "$target" = "ppc64" \ -o "$target" = "alpha"; then targetlongbits="64" else @@ -139,6 +141,12 @@ for RULES_ARCH in $*; do AS_FLAGS= ;;
+ ppc64) + select_prefix powerpc + CFLAGS="-Wa,-a64 -m64 -msoft-float -fno-builtin-bcopy -fno-builtin-log2" + AS_FLAGS="-Wa,-a64" + ;; + sparc32) select_prefix sparc CFLAGS="-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin" @@ -192,9 +200,15 @@ for RULES_ARCH in $*; do mkdir -p $OBJDIR/host/include mkdir -p $OBJDIR/host/kernel mkdir -p $OBJDIR/forth - ln -s ../../../include/arch/$ARCH $OBJDIR/target/include/asm + + INCLUDEARCH=$ARCH + if test "$ARCH" = "ppc64"; then + INCLUDEARCH=ppc + fi + ln -s ../../../include/arch/$INCLUDEARCH $OBJDIR/target/include/asm #compile the host binary with target settings instead #ln -s ../../../include/arch/$HOSTARCH $OBJDIR/host/include/asm + echo "ok."
cd $OBJDIR
Use $(ARCH) to allow using a different linker script for ppc64.
Signed-off-by: Andreas Färber andreas.faerber@web.de --- arch/ppc/build.xml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/ppc/build.xml b/arch/ppc/build.xml index 9778a43..4aec62f 100644 --- a/arch/ppc/build.xml +++ b/arch/ppc/build.xml @@ -178,7 +178,7 @@
<executable name="openbios-qemu.elf" target="target" condition="QEMU"> <rule> - $(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/ppc/qemu/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@") + $(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/$(ARCH)/qemu/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@") $(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-qemu.syms," GEN $(TARGET_DIR)$@.syms") $(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule> <object source="qemu/start.S"/>
Am 03.10.2010 um 15:20 schrieb Andreas Färber:
Use $(ARCH) to allow using a different linker script for ppc64.
Signed-off-by: Andreas Färber andreas.faerber@web.de
Applied updated versions of these two in r927-r929.
On Sun, Oct 3, 2010 at 1:20 PM, Andreas Färber andreas.faerber@web.de wrote:
Detect ppc64 as Big Endian and 64-bit. Reuse arch/ppc/ wherever possible.
Perhaps we should try to aim for unified targets, like in recent Linux there is unified sparc32 and sparc64 tree in arch/sparc.
Signed-off-by: Andreas Färber andreas.faerber@web.de
The -m64 is not yet working in my gcc configuration. Using -mcpu=powerpc64 instead, the C files compiled but despite tweaking the linker script and adding -melf64ppc to LD there was a mismatch:
powerpc-elf-ld: powerpc:common64 architecture of input file `target/arch/ppc/qemu/start.o' is incompatible with powerpc:common output
You should build binutils for powerpc64-elf.
Am 03.10.2010 um 16:18 schrieb Blue Swirl:
On Sun, Oct 3, 2010 at 1:20 PM, Andreas Färber andreas.faerber@web.de wrote:
The -m64 is not yet working in my gcc configuration. Using - mcpu=powerpc64 instead, the C files compiled but despite tweaking the linker script and adding -melf64ppc to LD there was a mismatch:
powerpc-elf-ld: powerpc:common64 architecture of input file `target/arch/ppc/qemu/start.o' is incompatible with powerpc:common output
You should build binutils for powerpc64-elf.
I built powerpc-elf- binutils with --enable-targets=powerpc64-elf, which added above elf64ppc to -V...
LD=powerpc64-elf-ld does solve the above but leaves me with:
PMG5-2:obj-ppc64 andreas$ make V=1 LD="powerpc64-elf-ld" powerpc64-elf-ld --warn-common -N -T ../arch/ppc64/qemu/ldscript -o openbios-qemu.elf.nostrip --whole-archive target/arch/ppc/qemu/start.o target/arch/ppc/timebase.o libqemu.a libbootstrap.a libopenbios.a libpackages.a libdrivers.a libfs.a liblibc.a libgcc.a target/arch/ppc/qemu/start.o: In function `vector__0x300': /Users/andreas/QEMU/OpenBIOS/openbios/obj-ppc64/../arch/ppc/qemu/ start.S:209: relocation truncated to fit: R_PPC64_ADDR24 against `.text.vectors'+c target/arch/ppc/qemu/start.o: In function `vector__0x400': /Users/andreas/QEMU/OpenBIOS/openbios/obj-ppc64/../arch/ppc/qemu/ start.S:217: relocation truncated to fit: R_PPC64_ADDR24 against `.text.vectors'+c make: *** [openbios-qemu.elf] Error 1
ldscript is unchanged except for the output format.
Andreas
 The -m64 is not yet working in my gcc configuration. Using -mcpu=powerpc64 instead, the C files compiled
They compiled as 32-bit objects, that's no good.
 but despite tweaking the linker script and adding -melf64ppc to LD there was a mismatch:
 powerpc-elf-ld: powerpc:common64 architecture of input file `target/arch/ppc/qemu/start.o' is incompatible with powerpc:common output
You should build binutils for powerpc64-elf.
Or enable 64-bit target support in binutils. It sounds like the linker script does OUTPUT_ARCH(powerpc:common); fix that?
Segher
Am 04.10.2010 um 06:08 schrieb Segher Boessenkool:
 The -m64 is not yet working in my gcc configuration. Using -mcpu=powerpc64 instead, the C files compiled
They compiled as 32-bit objects, that's no good.
 but despite tweaking the linker script and adding -melf64ppc to LD there was a mismatch:
 powerpc-elf-ld: powerpc:common64 architecture of input file `target/arch/ppc/qemu/start.o' is incompatible with powerpc:common output
You should build binutils for powerpc64-elf.
Or enable 64-bit target support in binutils. It sounds like the linker script does OUTPUT_ARCH(powerpc:common); fix that?
For the record, the linker script had OUTPUT_ARCH(powerpc), changing that to OUTPUT_ARCH(powerpc:common64) helped. Thanks for pointing me in the right direction.
Andreas
Thanks, applied.
On Sun, Oct 3, 2010 at 10:54 AM, Andreas Färber andreas.faerber@web.de wrote:
The comparison would've always been false due to missing $.
Signed-off-by: Andreas Färber andreas.faerber@web.de
config/scripts/switch-arch | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index 8b6563d..60782e9 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -48,7 +48,7 @@ crosscflags()
# target long bits test if test "$target" = "sparc64" -o "$target" = "ia64" \
- -o "$target" = "amd64" -o "target" = "x86_64" \
- -o "$target" = "amd64" -o "$target" = "x86_64" \
-o "$target" = "alpha"; then targetlongbits="64" else -- 1.7.3
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you