Opened 4 years ago

Closed 8 months ago

#12078 closed bug (fixed)

Cross-compiling for PPC fails

Reported by: haiqu Owned by: mmu_man
Priority: normal Milestone: Unscheduled
Component: Build System Version: R1/Development
Keywords: PPC Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Built the PPC cross-compiler and attempted to build for this platform. Assuming jam -q @nightly-anyboot is a valid command (documentation lags the actual code severely) then there's something wrong.

The compiler complains it can't find <stdarg.h> and <stddef.h> early in the build, causing failures. This *appears* to be a problem with the configure script.

Configured with:

../haiku/configure --cross-tools-prefix cross-tools-ppc/bin/powerpc-apple-haiku- --use-gcc-pipe -j2

which seems correct so maybe the cross-compiler build has faults, but that would still be a configure script error.

Attachments (1)

buildlog.txt (12.9 KB) - added by haiqu 4 years ago.
PPC build attempt from Haiku hybrid

Download all attachments as: .zip

Change History (10)

comment:1 Changed 4 years ago by haiqu

# BuildConfig # Note: This file has been automatically generated by configure with the # following arguments: # --cross-tools-prefix cross-tools-ppc/bin/powerpc-apple-haiku- --use-gcc-pipe -j2

TARGET_PLATFORM ?= "haiku" ; HOST_PLATFORM ?= "haiku_host" ;

HAIKU_INCLUDE_GPL_ADDONS ?= "0" ; HAIKU_INCLUDE_PATENTED_CODE ?= "0" ; HAIKU_INCLUDE_SOURCES ?= "0" ; HAIKU_INCLUDE_3RDPARTY ?= "0" ; HAIKU_ENABLE_MULTIUSER ?= "0" ; HAIKU_DISTRO_COMPATIBILITY ?= "default" ; HAIKU_USE_GCC_PIPE ?= "1" ; HAIKU_HOST_USE_32BIT ?= "0" ; HAIKU_HOST_USE_XATTR ?= "0" ; HAIKU_HOST_USE_XATTR_REF ?= "0" ; HAIKU_HOST_BUILD_ONLY ?= "0" ;

HAIKU_PACKAGING_ARCHS ?= ppc ;

HAIKU_NO_DOWNLOADS ?= "0" ;

HAIKU_BUILD_ATTRIBUTES_DIR ?= /Work/generated.ppc/attributes ;

HAIKU_NASM ?= nasm ; HAIKU_BOOT_BOARD ?= ;

HOST_EXTENDED_REGEX_SED ?= sed -r ; HOST_GCC_RAW_VERSION ?= 4.8.4 ; HOST_GCC_MACHINE ?= i586-pc-haiku ; HOST_LD ?= /boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/4.8.4/../../../../i586-pc-haiku/bin/ld ; HOST_OBJCOPY ?= /boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/4.8.4/../../../../i586-pc-haiku/bin/objcopy ; HOST_SHA256 ?= sha256sum ;

HOST_HAIKU_PORTER ?= ; HAIKU_PORTS ?= ; HAIKU_PORTS_CROSS ?= ; HAIKU_IS_BOOTSTRAP ?= 0 ;

HAIKU_GCC_RAW_VERSION_ppc ?= 4.8.4 ; HAIKU_GCC_MACHINE_ppc ?= powerpc-apple-haiku ; HAIKU_GCC_LIB_DIR_ppc ?= /Work/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.8.4 ; HAIKU_CPU_ppc ?= ppc ; HAIKU_BOOT_LIBGCC_ppc ?= ; HAIKU_BOOT_LIBSUPC++_ppc ?= ; HAIKU_AR_ppc ?= /Work/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-ar ; HAIKU_CC_ppc ?= /Work/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-gcc ; HAIKU_CC_IS_CLANG_ppc ?= 0 ; HAIKU_LD_ppc ?= /Work/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-ld ; HAIKU_OBJCOPY_ppc ?= /Work/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-objcopy ; HAIKU_RANLIB_ppc ?= /Work/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-ranlib ; HAIKU_ELFEDIT_ppc ?= /Work/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-elfedit ; HAIKU_STRIP_ppc ?= /Work/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-strip ; HAIKU_CPPFLAGS_ppc ?= ; HAIKU_CCFLAGS_ppc ?= ; HAIKU_C++FLAGS_ppc ?= ; HAIKU_LDFLAGS_ppc ?= ; HAIKU_ARFLAGS_ppc ?= cru ; HAIKU_UNARFLAGS_ppc ?= x ; HAIKU_USE_GCC_GRAPHITE_ppc ?= 0 ; HAIKU_BOOT_C++_HEADERS_DIR_ppc ?=

;

comment:2 Changed 4 years ago by pulkomandy

The nightly-anyboot profile makes little sense for PPC, as you won't need an MBR to boot there. Building the ISO or a raw image would be better.

The buildbots use jam -q haiku.image to build a raw image. However, this will also fail for another reason: we need to bootstrap the build first.

There is some information on bootstrapping here: https://dev.haiku-os.org/wiki/PackageManagement/Bootstrapping

The process is a bit tricky and can't work as is as long as the port to a new platform isn't far enough to boot a minimal system. For the ARM port we hacked around this, by building the bootstrap packages then converting them to non-bootstrap ones. It is done using this script after running the bootstrap build to get the required packages: http://cgit.haiku-os.org/haiku/tree/3rdparty/pulkomandy/unbootstrap.sh

Once this is done, and the packages are made available in the repositories, it will be possible to do a normal build. However, it is a good idea to start with a minimal one. On ARM we have a specific target (haiku-mmc) that builds a bootable MMC image with only the kernel and bootloader, on PPC I think the target to use is the haiku boot floppy (don't know its exact name).

comment:3 Changed 4 years ago by haiqu

Build of target bootstrap-raw failed, and here's the reason:

Prerequisites: Haiku is not yet supported as a build platform.

Well, that ends it. If the developers don't have the confidence to build on the target platform after 14 years, we all may as well give up.

As for all the jiggery-pokery described above, any bootstrap build system that relies on an online repository and the availability of prebuilt packages seems to miss the point entirely.

And btw, there seems to be no ncurses_development online (or in the haikuports tree) even for x86 so it would have failed again further on.

Last edited 4 years ago by haiqu (previous) (diff)

comment:4 Changed 4 years ago by haiqu

I'm glad you mentioned the Arm port here. As a gradual entry to doing embedded development with this system I decided to try the obvious builds first. Since the PPC build should have had a fair bit of support (being one of the original targets of BeOS) I assumed it would be in a relatively mature state, at least compared to Arm or Mips.

Seems way too complex for embedded development to me, unless you stick to embedded targets that approach a PC in capability. I believe that's the current development viewpoint judging by some earlier replies regarding possible Mips targets.

comment:5 Changed 4 years ago by pulkomandy

Owner: changed from bonefish to mmu_man
Status: newassigned

Haiku is an OS designed for desktop computers. While possible, use for embedded systems (or even mobile phones and tablets) isn't one of our current goals.

The PPC port was the first non-x86 one, but the lack of easily available hardware after Apple switched to x86 stopped most of the efforts there.

Building on the target is a rather unusual mode of working for embedded devices. It could work, but it is much more convenient to build from another system for now. The main reason for this is limitations in GCC, which don't want to be a cross compiler when the host and targets have the same architecture triplet. So, we never could get this to work properly even for x86 and have to hack around this problem.

The bootstrap build should work without an online repository, of course (that's the point). You can try doing this, but it is much more complex than a regular build. If you are interesting in improving that process, it would be great. But if what you're interested in is seeing the kernel running, it's probably better to skip that step, at least for now, and use the pre-built packages. In other words: when you use the online repo, you are NOT doing a bootstrap build. But you can get to play with the kernel already.

All the non-x86 ports are still in a very early state and will need a lot of work to get them running.

comment:6 Changed 4 years ago by haiqu

Hokay then. I'm attaching my build log for the PPC attempt. It complains that TREE_PATH isn't set in haikuports.conf (but it is!) and I can't see anything obviously wrong with the Python code in haikuporter.

Changed 4 years ago by haiqu

Attachment: buildlog.txt added

PPC build attempt from Haiku hybrid

comment:7 Changed 4 years ago by haiqu

Apparently a comment above was misunderstood. When I mentioned "build(ing) on the target platform" I was referring to the Haiku OS, not any particular hardware.

And yes, as you say, building on the target hardware would be unusual for embedded devices. Not impossible but certainly unusual.

comment:8 Changed 17 months ago by kallisti5

I can confirm this issue as of hrev51818. The documentation says the following command to build PowerPC: jam -q haiku-boot-cd-ppc

I personally remember this working to debug our bootloader on Apple hardware (#4433). Now it results in the following:

kallisti5@eris generated.ppc :) $ jam -q haiku-boot-cd-ppc
Starting build of type regular ... 
gcc_syslibs not available for ppc 
gcc_syslibs_devel not available for ppc 
ICU not available for ppc 
Curl not available for ppc 
Giflib support not available on ppc 
GLU not yet available on ppc 
GL not yet available on ppc 
FFMpeg support not available on ppc 
Fluidlite support not available on ppc 
Libvorbis support not available on ppc 
Freetype support not available on ppc 
fontconfig support not available on ppc 
Gutenprint support not available on ppc 
WebKit build feature not available for ppc 
libpng support not available on ppc 
libicns support not available on ppc 
Jasper support not available on ppc 
jpeg support not available on ppc 
zlib support not available on ppc 
libedit support not available on ppc 
libsolv package not available for ppc 
qrencode support not available on ppc 
Tiff support not available on ppc 
OpenEXR support not available on ppc 
IlmBase support not available on ppc 
Libwebp support not available on ppc 
live555 not available for ppc 
ncurses support not available on ppc 
expat support not available on ppc 
zstd support not available on ppc 
AddHaikuImagePackages: package bash not available! 
AddHaikuImagePackages: package bc not available! 
AddHaikuImagePackages: package coreutils not available! 
AddHaikuImagePackages: package curl not available! 
AddHaikuImagePackages: package freetype not available! 
AddHaikuImagePackages: package icu not available! 
AddHaikuImagePackages: package libsolv not available! 
AddHaikuImagePackages: package zlib not available! 
AddHaikuImagePackages: package zstd not available! 
AddHaikuImagePackages: package bzip2 not available! 
AddHaikuImagePackages: package ctags not available! 
AddHaikuImagePackages: package diffutils not available! 
AddHaikuImagePackages: package expat not available! 
AddHaikuImagePackages: package ffmpeg not available! 
AddHaikuImagePackages: package findutils not available! 
AddHaikuImagePackages: package gawk not available! 
AddHaikuImagePackages: package glu not available! 
AddHaikuImagePackages: package grep not available! 
AddHaikuImagePackages: package gutenprint not available! 
AddHaikuImagePackages: package gzip not available! 
AddHaikuImagePackages: package ilmbase not available! 
AddHaikuImagePackages: package jasper not available! 
AddHaikuImagePackages: package jpeg not available! 
AddHaikuImagePackages: package less not available! 
AddHaikuImagePackages: package libedit not available! 
AddHaikuImagePackages: package libicns not available! 
AddHaikuImagePackages: package libpcap not available! 
AddHaikuImagePackages: package libpng16 not available! 
AddHaikuImagePackages: package libwebp not available! 
AddHaikuImagePackages: package mesa not available! 
AddHaikuImagePackages: package mesa_devel not available! 
AddHaikuImagePackages: package mesa_swpipe not available! 
AddHaikuImagePackages: package netcat not available! 
AddHaikuImagePackages: package openexr not available! 
AddHaikuImagePackages: package sed not available! 
AddHaikuImagePackages: package sharutils not available! 
AddHaikuImagePackages: package tar not available! 
AddHaikuImagePackages: package tcpdump not available! 
AddHaikuImagePackages: package unzip not available! 
AddHaikuImagePackages: package wget not available! 
AddHaikuImagePackages: package which not available! 
AddHaikuImagePackages: package zip not available! 
AddHaikuImagePackages: package gcc_syslibs not available! 
/home/kallisti5/Code/haiku/src/libs/libunwind/ppc/Jamfile: No such file or directory
Skipping setjmp_test2.S test on non-x86 
...patience...
don't know how to make <src!system!boot!loader!file_systems!tarfs>adler32.c
don't know how to make <src!system!boot!loader!file_systems!tarfs>crc32.c
don't know how to make <src!system!boot!loader!file_systems!tarfs>inffast.c
don't know how to make <src!system!boot!loader!file_systems!tarfs>inflate.c
don't know how to make <src!system!boot!loader!file_systems!tarfs>inftrees.c
don't know how to make <src!system!boot!loader!file_systems!tarfs>uncompr.c
don't know how to make <src!system!boot!loader!file_systems!tarfs>zutil.c
...found 4720 target(s)...
...updating 523 target(s)...
...can't find 7 target(s)...
...can't make 11 target(s)...
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/system/boot/platform/openfirmware/console.o 
In file included from /home/kallisti5/Code/haiku/headers/posix/sys/types.h:126:0,
                 from /home/kallisti5/Code/haiku/headers/posix/dirent.h:9,
                 from /home/kallisti5/Code/haiku/headers/private/kernel/boot/vfs.h:9,
                 from /home/kallisti5/Code/haiku/headers/private/kernel/boot/platform/generic/text_console.h:9,
                 from /home/kallisti5/Code/haiku/src/system/boot/platform/openfirmware/console.h:8,
                 from /home/kallisti5/Code/haiku/src/system/boot/platform/openfirmware/console.cpp:8:
/home/kallisti5/Code/haiku/headers/posix/size_t.h:9:20: fatal error: stddef.h: No such file or directory
compilation terminated.

/home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-gcc -c "/home/kallisti5/Code/haiku/src/system/boot/platform/openfirmware/console.cpp" -O2 -Wall -Wno-trigraphs -Wno-multichar -fno-strict-aliasing -fno-tree-vrp -Wno-array-bounds -nostdinc -Wno-deprecated -D_BOOT_MODE -fno-rtti -fno-strict-aliasing -fno-tree-vrp -Wno-array-bounds -nostdinc -Wno-deprecated -fno-strict-aliasing -fno-tree-vrp -Wno-array-bounds -finline -fno-builtin -ffreestanding -fno-exceptions -fno-use-cxa-atexit -fno-pic -D_KERNEL_MODE -DARCH_ppc -DBOOT_ARCHIVE_IMAGE_OFFSET=192 -D__HAIKU_PRIMARY_PACKAGING_ARCH=\"ppc\" -DHAIKU_DISTRO_COMPATIBILITY_DEFAULT -DHAIKU_INCLUDE_PATENTED_CODE=0 -DHAIKU_TARGET_PLATFORM_HAIKU -DHAIKU_REGULAR_BUILD -iquote /home/kallisti5/Code/haiku/build/user_config_headers -iquote /home/kallisti5/Code/haiku/build/config_headers -iquote /home/kallisti5/Code/haiku/src/system/boot/platform/openfirmware -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/common/system/boot/platform/openfirmware -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/linux/x86_64/common/system/boot/platform/openfirmware -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/common/system/boot/platform/openfirmware -iquote /home/kallisti5/Code/haiku/src/add-ons/accelerants/common -I /home/kallisti5/Code/haiku/headers/private/graphics/common -I /home/kallisti5/Code/haiku/headers/private/. -I /home/kallisti5/Code/haiku/headers/private/kernel -I /home/kallisti5/Code/haiku/headers/private/libroot -I /home/kallisti5/Code/haiku/headers/private/shared -I /home/kallisti5/Code/haiku/headers/private/kernel/boot/platform/openfirmware -I /home/kallisti5/Code/haiku/headers/private/kernel/arch/ppc -I /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/common/system/kernel -I /home/kallisti5/Code/haiku/headers/private/. -I /home/kallisti5/Code/haiku/headers/private/system -I /home/kallisti5/Code/haiku/headers/private/system/arch/ppc -I /home/kallisti5/Code/haiku/headers -I /home/kallisti5/Code/haiku/headers/posix -I /home/kallisti5/Code/haiku/headers/glibc -I /home/kallisti5/Code/haiku/headers/os -I /home/kallisti5/Code/haiku/headers/os/add-ons -I /home/kallisti5/Code/haiku/headers/os/add-ons/file_system -I /home/kallisti5/Code/haiku/headers/os/add-ons/graphics -I /home/kallisti5/Code/haiku/headers/os/add-ons/input_server -I /home/kallisti5/Code/haiku/headers/os/add-ons/registrar -I /home/kallisti5/Code/haiku/headers/os/add-ons/screen_saver -I /home/kallisti5/Code/haiku/headers/os/add-ons/tracker -I /home/kallisti5/Code/haiku/headers/os/app -I /home/kallisti5/Code/haiku/headers/os/device -I /home/kallisti5/Code/haiku/headers/os/drivers -I /home/kallisti5/Code/haiku/headers/os/game -I /home/kallisti5/Code/haiku/headers/os/interface -I /home/kallisti5/Code/haiku/headers/os/kernel -I /home/kallisti5/Code/haiku/headers/os/locale -I /home/kallisti5/Code/haiku/headers/os/media -I /home/kallisti5/Code/haiku/headers/os/mail -I /home/kallisti5/Code/haiku/headers/os/midi -I /home/kallisti5/Code/haiku/headers/os/midi2 -I /home/kallisti5/Code/haiku/headers/os/net -I /home/kallisti5/Code/haiku/headers/os/storage -I /home/kallisti5/Code/haiku/headers/os/support -I /home/kallisti5/Code/haiku/headers/os/translation -I /home/kallisti5/Code/haiku/headers/private/. -o "/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/system/boot/platform/openfirmware/console.o" ;

...failed C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/system/boot/platform/openfirmware/console.o ...

BUILD FAILURE:
...failed updating 1 target(s)...
...skipped 3 target(s)...

comment:9 Changed 8 months ago by waddlesplash

Resolution: fixed
Status: assignedclosed

The ppc build gets much farther now; all the way to the same errors it did pre-PM. So this is "fixed."

Note: See TracTickets for help on using tickets.