Skip to contentSkip to conversation

Request for openhackware.git mirror

Qemu-devel Andreas Färber 3 participants 8 messages Mar 2, 2014 – Mar 12, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello Stefan,

We have a file pc-bios/ppc_rom.bin in qemu.git, used by PReP emulation, to which we do not have available the full GPL source code. I would like to replace the current file with a new binary built from original OpenHack'Ware sources plus our pc-bios/ohw.diff plus build fixes plus workaround for the unknown delta between v0.4.1+ohw.diff and Jocelyn's ppc_rom.bin: http://repo.or.cz/w/openhackware.git is finally building for me [1] and seems to be working as before.

Can you please set up an openhackware.git mirror on git.qemu.org for my
git://repo.or.cz/openhackware.git so that we can properly integrate the sources as a submodule before I exchange the binary?

Next steps would then be to agree on an approach to blow the binary up from 512 KiB to 1 MiB (proposals by Hervé and Alex) and then continue with Hervé's Raven PHB patches with a view to making both ppc_rom.bin and openbios-ppc testable in 2.0 until we can hopefully switch to OpenBIOS some time after.

Thanks,
Andreas

[1] Using make CROSS_COMPILE=powerpc-elf- works for GCC 4.8.2 and binutils 2.24; I did not find a solution for my identically versioned CROSS_COMPILE=powerpc-eabi- setup (that I had been successfully using for OpenBIOS), lacking an __eabi symbol on final ld.

#1 lore raw
Quoted 11 lines · Andreas Färber

We have a file pc-bios/ppc_rom.bin in qemu.git, used by PReP emulation, to which we do not have available the full GPL source code. I would like to replace the current file with a new binary built from original OpenHack'Ware sources plus our pc-bios/ohw.diff plus build fixes plus workaround for the unknown delta between v0.4.1+ohw.diff and Jocelyn's ppc_rom.bin: http://repo.or.cz/w/openhackware.git is finally building for me [1] and seems to be working as before.

Can you please set up an openhackware.git mirror on git.qemu.org for my
git://repo.or.cz/openhackware.git so that we can properly integrate the sources as a submodule before I exchange the binary?

The mirror is now available here:

git://git.qemu-project.org/openhackware.git

It updates daily. Please let me know if you experience any issues.

Stefan

#2 lore raw
In reply to Andreas Färber
Quoted 20 lines · Andreas Färber

Hello Stefan,

We have a file pc-bios/ppc_rom.bin in qemu.git, used by PReP emulation, to which we do not have available the full GPL source code. I would like to replace the current file with a new binary built from original OpenHack'Ware sources plus our pc-bios/ohw.diff plus build fixes plus workaround for the unknown delta between v0.4.1+ohw.diff and Jocelyn's ppc_rom.bin: http://repo.or.cz/w/openhackware.git is finally building for me [1] and seems to be working as before.

Can you please set up an openhackware.git mirror on git.qemu.org for my
git://repo.or.cz/openhackware.git so that we can properly integrate the sources as a submodule before I exchange the binary?

Next steps would then be to agree on an approach to blow the binary up from 512 KiB to 1 MiB (proposals by Hervé and Alex) and then continue with Hervé's Raven PHB patches with a view to making both ppc_rom.bin and openbios-ppc testable in 2.0 until we can hopefully switch to OpenBIOS some time after.

Quoted 7 lines

Thanks,
Andreas

[1] Using make CROSS_COMPILE=powerpc-elf- works for GCC 4.8.2 and binutils 2.24; I did not find a solution for my identically versioned CROSS_COMPILE=powerpc-eabi- setup (that I had been successfully using for OpenBIOS), lacking an __eabi symbol on final ld.

Hi Andreas,

This is great news! FWIW I've just tried building a clone of the repository at git://git.qemu-project.org/openhackware.git and it looks good until the final link stage:

powerpc-elf-ld -m elf32ppc -O2 -g -nostdlib -T src/main.ld -o .objs/main.out .objs/main.o .objs/bootinfos.o .objs/bloc.o .objs/pci.o .objs/of.o .objs/start.o .objs/nvram.o .objs/vga.o .objs/mm.o .objs/char.o .objs/malloc.o .objs/errno.o .objs/_vprintf.o .objs/printf.o .objs/sprintf.o .objs/snprintf.o .objs/vprintf.o .objs/vsprintf.o .objs/vsnprintf.o .objs/dprintf.o .objs/vdprintf.o .objs/memcpy.o .objs/memccpy.o .objs/mempcpy.o .objs/memmove.o .objs/memcmove.o .objs/mempmove.o .objs/memset.o .objs/memcmp.o .objs/memchr.o .objs/rawmemchr.o .objs/memrchr.o .objs/memmem.o .objs/strcpy.o .objs/strdup.o .objs/strndup.o .objs/stpcpy.o .objs/stpncpy.o .objs/strcat.o .objs/strncat.o .objs/strcmp.o .objs/strcasecmp.o .objs/strncmp.o .objs/strncasecmp.o .objs/strchr.o .objs/strchrnul.o .objs/strrchr.o .objs/basename.o .objs/dirname.o .objs/strlen.o .objs/strnlen.o .objs/exec_core.o .objs/exec_elf.o .objs/exec_xcoff.o .objs/exec_macho.o .objs/exec_chrp.o .objs/exec_prep.o .objs/exec_pef.o .objs/fs_core.o .objs/fs_raw.o .objs/fs_ext2.o .objs/fs_isofs.o .objs/fs_hfs.o .objs/part_core.o .objs/part_apple.o .objs/part_isofs.o .objs/part_prep.o .objs/dev_char_pckbd.o .objs/dev_char_kbdadb.o .objs/dev_char_kbd.o
powerpc-elf-ld: .objs/main.out section .text.startup will not fit in region start
powerpc-elf-ld: section .text [0000000005800400 -> 0000000005812e23] overlaps section .text.startup [0000000005800054 -> 00000000058006d7]
powerpc-elf-ld: section .rodata.str1.4 [00000000058006d8 -> 0000000005804cdb] overlaps section .text [0000000005800400 -> 0000000005812e23]
powerpc-elf-ld: region start overflowed by 18668 bytes
make: *** [.objs/main.out] Error 1

build@kentang:~/src/ohw/openhackware$ powerpc-elf-gcc -v
Using built-in specs.
COLLECT_GCC=powerpc-elf-gcc
COLLECT_LTO_WRAPPER=/home/build/ppc-cross/libexec/gcc/powerpc-elf/4.8.2/lto-wrapper
Target: powerpc-elf
Configured with: ../gcc-4.8.2/configure --prefix=/home/build/ppc-cross --enable-languages=c --target=powerpc-elf --disable-libssp
Thread model: single
gcc version 4.8.2 (GCC)
build@kentang:~/src/ohw/openhackware$

Am I missing something from the build in order for the final link to complete correctly?

Many thanks,

Mark.

#3 lore raw

Hi Mark,

Am 03.03.2014 19:08, schrieb Mark Cave-Ayland:

Quoted 56 lines · Andreas Färber
Quoted 5 lines

[1] Using make CROSS_COMPILE=powerpc-elf- works for GCC 4.8.2 and binutils 2.24; I did not find a solution for my identically versioned CROSS_COMPILE=powerpc-eabi- setup (that I had been successfully using for OpenBIOS), lacking an __eabi symbol on final ld.

Hi Andreas,

This is great news! FWIW I've just tried building a clone of the repository at git://git.qemu-project.org/openhackware.git and it looks good until the final link stage:

powerpc-elf-ld -m elf32ppc -O2 -g -nostdlib -T src/main.ld -o .objs/main.out .objs/main.o .objs/bootinfos.o .objs/bloc.o .objs/pci.o .objs/of.o .objs/start.o .objs/nvram.o .objs/vga.o .objs/mm.o .objs/char.o .objs/malloc.o .objs/errno.o .objs/_vprintf.o .objs/printf.o .objs/sprintf.o .objs/snprintf.o .objs/vprintf.o .objs/vsprintf.o .objs/vsnprintf.o .objs/dprintf.o .objs/vdprintf.o .objs/memcpy.o .objs/memccpy.o .objs/mempcpy.o .objs/memmove.o .objs/memcmove.o .objs/mempmove.o .objs/memset.o .objs/memcmp.o .objs/memchr.o .objs/rawmemchr.o .objs/memrchr.o .objs/memmem.o .objs/strcpy.o .objs/strdup.o .objs/strndup.o .objs/stpcpy.o .objs/stpncpy.o .objs/strcat.o .objs/strncat.o .objs/strcmp.o .objs/strcasecmp.o .objs/strncmp.o .objs/strncasecmp.o .objs/strchr.o .objs/strchrnul.o .objs/strrchr.o .objs/basename.o .objs/dirname.o .objs/strlen.o .objs/strnlen.o .objs/exec_core.o .objs/exec_elf.o .objs/exec_xcoff.o .objs/exec_macho.o .objs/exec_chrp.o .objs/exec_prep.o .objs/exec_pef.o .objs/fs_core.o .objs/fs_raw.o .objs/fs_ext2.o .objs/fs_isofs.o .objs/fs_hfs.o .objs/part_core.o .objs/part_apple.o .objs/part_isofs.o .objs/part_prep.o .objs/dev_char_pckbd.o .objs/dev_char_kbdadb.o .objs/dev_char_kbd.o
powerpc-elf-ld: .objs/main.out section .text.startup will not fit in region start
powerpc-elf-ld: section .text [0000000005800400 -> 0000000005812e23] overlaps section .text.startup [0000000005800054 -> 00000000058006d7]
powerpc-elf-ld: section .rodata.str1.4 [00000000058006d8 -> 0000000005804cdb] overlaps section .text [0000000005800400 -> 0000000005812e23]
powerpc-elf-ld: region start overflowed by 18668 bytes
make: *** [.objs/main.out] Error 1

build@kentang:~/src/ohw/openhackware$ powerpc-elf-gcc -v
Using built-in specs.
COLLECT_GCC=powerpc-elf-gcc
COLLECT_LTO_WRAPPER=/home/build/ppc-cross/libexec/gcc/powerpc-elf/4.8.2/lto-wrapper

Target: powerpc-elf
Configured with: ../gcc-4.8.2/configure --prefix=/home/build/ppc-cross --enable-languages=c --target=powerpc-elf --disable-libssp Thread model: single
gcc version 4.8.2 (GCC) build@kentang:~/src/ohw/openhackware$

Quoted 2 lines

Am I missing something from the build in order for the final link to complete correctly?

Hm, repository looks okay, and I didn't run into this yet. Possibly you are using different binutils?

Presumably you did try make clean CROSS_COMPILE=... :)

I chose not to apply one hunk from Rene Rebe since not needed here. Maybe the above .rodata.str1.4 would end up in .rodata this way?

Make it link at al.

- Rene Rebe <[email protected]>

--- OpenHackWare-release-0.4/src/main.ld 2005-03-31
09:23:33.000000000 +0200
+++ OpenHackWare-release-0.4-hacked/src/main.ld 2008-05-06
11:23:29.000000000 +0200
@@ -49,7 +49,7 @@

         _sdata_end = . ;
         . = ALIGN(4) ;
         _ro_start = . ;
-        .rodata    : { *(.rodata) } > bios
+        .rodata    : { *(.rodata*) } > bios
         _ro_end = . ;
         . = ALIGN(4) ;
         _RTAS_start = .;

Cheers,
Andreas

#4 lore raw
Quoted 29 lines · Andreas Färber
Quoted 2 lines

Am I missing something from the build in order for the final link to complete correctly?

Hm, repository looks okay, and I didn't run into this yet. Possibly you are using different binutils?

Presumably you did try make clean CROSS_COMPILE=... :)

I chose not to apply one hunk from Rene Rebe since not needed here. Maybe the above .rodata.str1.4 would end up in .rodata this way?

Make it link at al.

- Rene Rebe<[email protected]>

--- OpenHackWare-release-0.4/src/main.ld 2005-03-31
09:23:33.000000000 +0200
+++ OpenHackWare-release-0.4-hacked/src/main.ld 2008-05-06
11:23:29.000000000 +0200

(quoted diff) +1 -1
@@ -49,7 +49,7 @@
          _sdata_end = . ;
          . = ALIGN(4) ;
          _ro_start = . ;
-        .rodata    : { *(.rodata) }>  bios
+        .rodata    : { *(.rodata*) }>  bios
          _ro_end = . ;
          . = ALIGN(4) ;
          _RTAS_start = .;
Quoted 2 lines

Cheers,
Andreas

Hi Andreas,

That patch definitely helps as it reduces the error to just:

powerpc-elf-ld: .objs/main.out section .text.startup will not fit in region start
powerpc-elf-ld: section .text [0000000005800400 -> 0000000005812e23] overlaps section .text.startup [0000000005800054 -> 00000000058006d7]
powerpc-elf-ld: region start overflowed by 728 bytes

So if I then apply the same trick to the .text section (patch attached) then I get a successful link and an output image. The output image does execute under QEMU, although for all of the CD images I have it reports "ERROR: Found no boot partition!". Do you have pointers to any ISOs that can boot from the resulting image?

FWIW my cross-compile setup is based upon binutils 2.19.

ATB,

Mark.

Makefile +1 -1
index c0213b2..c4bf5ea 100644
@@ -21,7 +21,7 @@
 
 #DEBUG=1
 
-CROSS_COMPILE?=powerpc-linux-
+CROSS_COMPILE?=powerpc-elf-
 CC:= $(CROSS_COMPILE)gcc -m32
 LD:= $(CROSS_COMPILE)ld -m elf32ppc
 OBJCOPY:= $(CROSS_COMPILE)objcopy
src/main.ld +2 -2
index f689f72..7a4f9aa 100644
@@ -30,7 +30,7 @@ SECTIONS
 {
         .start    : { *(.start)   } > start
         . = ALIGN(4) ;
-        .text     : { *(.text)    } > bios
+        .text     : { *(.text*)    } > bios
         . = ALIGN(4) ;
         .OpenFirmware : { *(.OpenFirmware) } > bios
         . = ALIGN(4) ;
@@ -49,7 +49,7 @@ SECTIONS
         _sdata_end = . ;
         . = ALIGN(4) ;
         _ro_start = . ;
-        .rodata    : { *(.rodata) } > bios
+        .rodata    : { *(.rodata*) } > bios
         _ro_end = . ;
         . = ALIGN(4) ;
         _RTAS_start = .;
#5 lore raw

Am 03.03.2014 19:42, schrieb Mark Cave-Ayland:

Quoted 38 lines · Andreas Färber
Quoted 30 lines
Quoted 3 lines

Am I missing something from the build in order for the final link to complete correctly?

Hm, repository looks okay, and I didn't run into this yet. Possibly you are using different binutils?

Presumably you did try make clean CROSS_COMPILE=... :)

I chose not to apply one hunk from Rene Rebe since not needed here. Maybe the above .rodata.str1.4 would end up in .rodata this way?

Make it link at al.

- Rene Rebe<[email protected]>

--- OpenHackWare-release-0.4/src/main.ld 2005-03-31
09:23:33.000000000 +0200
+++ OpenHackWare-release-0.4-hacked/src/main.ld 2008-05-06
11:23:29.000000000 +0200

src/main.ld +1 -1
@@ -49,7 +49,7 @@
          _sdata_end = . ;
          . = ALIGN(4) ;
          _ro_start = . ;
-        .rodata    : { *(.rodata) }>  bios
+        .rodata    : { *(.rodata*) }>  bios
          _ro_end = . ;
          . = ALIGN(4) ;
          _RTAS_start = .;
Quoted 2 lines

Cheers,
Andreas

Hi Andreas,

That patch definitely helps as it reduces the error to just:

Quoted 8 lines

powerpc-elf-ld: .objs/main.out section .text.startup will not fit in region start
powerpc-elf-ld: section .text [0000000005800400 -> 0000000005812e23] overlaps section .text.startup [0000000005800054 -> 00000000058006d7]
powerpc-elf-ld: region start overflowed by 728 bytes

So if I then apply the same trick to the .text section (patch attached) then I get a successful link and an output image.

Mark, can you sign off .text part of the patch please for me to pick up?

Andreas

Quoted 11 lines

The output image does
execute under QEMU, although for all of the CD images I have it reports "ERROR: Found no boot partition!". Do you have pointers to any ISOs that can boot from the resulting image?

FWIW my cross-compile setup is based upon binutils 2.19.

ATB,

Mark.

#6 lore raw

Am 12.03.2014 15:40, schrieb Andreas Färber:

Quoted 45 lines

Am 03.03.2014 19:42, schrieb Mark Cave-Ayland:

Quoted 44 lines · Andreas Färber
Quoted 30 lines
Quoted 3 lines

Am I missing something from the build in order for the final link to complete correctly?

Hm, repository looks okay, and I didn't run into this yet. Possibly you are using different binutils?

Presumably you did try make clean CROSS_COMPILE=... :)

I chose not to apply one hunk from Rene Rebe since not needed here. Maybe the above .rodata.str1.4 would end up in .rodata this way?

Make it link at al.

- Rene Rebe<[email protected]>

--- OpenHackWare-release-0.4/src/main.ld 2005-03-31
09:23:33.000000000 +0200
+++ OpenHackWare-release-0.4-hacked/src/main.ld 2008-05-06
11:23:29.000000000 +0200

src/main.ld +1 -1
@@ -49,7 +49,7 @@
          _sdata_end = . ;
          . = ALIGN(4) ;
          _ro_start = . ;
-        .rodata    : { *(.rodata) }>  bios
+        .rodata    : { *(.rodata*) }>  bios
          _ro_end = . ;
          . = ALIGN(4) ;
          _RTAS_start = .;
Quoted 2 lines

Cheers,
Andreas

Hi Andreas,

That patch definitely helps as it reduces the error to just:

powerpc-elf-ld: .objs/main.out section .text.startup will not fit in region start
powerpc-elf-ld: section .text [0000000005800400 -> 0000000005812e23] overlaps section .text.startup [0000000005800054 -> 00000000058006d7]
powerpc-elf-ld: region start overflowed by 728 bytes

Quoted 4 lines
Quoted 2 lines

So if I then apply the same trick to the .text section (patch attached) then I get a successful link and an output image.

Mark, can you sign off .text part of the patch please for me to pick up?

Never mind, pushed a minor variation with a Reported-by. Next time please think of it.

Andreas

#7 lore raw
Quoted 7 lines · Andreas Färber
Quoted 4 lines
Quoted 2 lines

So if I then apply the same trick to the .text section (patch attached) then I get a successful link and an output image.

Mark, can you sign off .text part of the patch please for me to pick up?

Never mind, pushed a minor variation with a Reported-by. Next time please think of it.

Oh sorry, I didn't realise you were waiting for a SOB from me. I figured that the change was so trivial it could just be picked up in the next version of the patchset.

ATB,

Mark.