Opened 10 years ago

Last modified 6 years ago

#10240 assigned bug

PowerPC build broken after PM

Reported by: kallisti5 Owned by: mmu_man
Priority: normal Milestone: Unscheduled
Component: Build System Version: R1/Development
Keywords: ppc bootstrap Cc:
Blocked By: Blocking:
Platform: PowerPC

Description

Crosstools work...

../configure -j8 --build-cross-tools ppc ../../buildtools --bootstrap /home/kallisti5/Code/haikuporter /home/kallisti5/Code/haikuports.cross /home/kallisti5/Code/haikuports

Bootstrap build fails...

jam -j4 -q @bootstrap-raw
.
.
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/PromptWindow.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/QueryFile.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/RegExp.o 
Link /home/kallisti5/Code/haiku/generated.ppc/objects/linux/x86_64/release/tools/keymap/keymap 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/RWLockManager.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/SHA256.o 
Chmod1 /home/kallisti5/Code/haiku/generated.ppc/objects/linux/x86_64/release/tools/keymap/keymap 
MkKeymapHeader1 /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/common/servers/input/SystemKeymap.h 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/ShakeTrackingFilter.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/StringForRate.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/Keymap.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/StringForSize.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/Thread.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/Variant.o 
MkDir1 /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale/cat.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale/Catalog.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale/CatalogData.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale/Collator.o 
C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale/Country.o 
/home/kallisti5/Code/haiku/src/kits/locale/Collator.cpp:19:26: fatal error: unicode/coll.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/kits/locale/Collator.cpp" -O -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -Werror -Wno-error=uninitialized -Wno-unused-but-set-variable -fno-strict-aliasing -fno-tree-vrp -Wno-array-bounds -nostdinc -Wno-deprecated -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 -iquote /home/kallisti5/Code/haiku/build/user_config_headers -iquote /home/kallisti5/Code/haiku/build/config_headers -iquote /home/kallisti5/Code/haiku/src/kits/locale -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/common/kits/locale -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/linux/x86_64/common/kits/locale -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/common/kits/locale -I /home/kallisti5/Code/haiku/headers/private/locale -I /home/kallisti5/Code/haiku/headers/private/shared -I /home/kallisti5/Code/haiku/headers/os/locale -I /home/kallisti5/Code/haiku/headers/os/storage -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3 -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3/powerpc-apple-haiku -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3/backward -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3/ext -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/include -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/include-fixed -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/opengl -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/kits/locale/Collator.o" ;

...failed C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale/Collator.o ...
/home/kallisti5/Code/haiku/src/kits/locale/Country.cpp:18:27: fatal error: unicode/locid.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/kits/locale/Country.cpp" -O -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -Werror -Wno-error=uninitialized -Wno-unused-but-set-variable -fno-strict-aliasing -fno-tree-vrp -Wno-array-bounds -nostdinc -Wno-deprecated -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 -iquote /home/kallisti5/Code/haiku/build/user_config_headers -iquote /home/kallisti5/Code/haiku/build/config_headers -iquote /home/kallisti5/Code/haiku/src/kits/locale -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/common/kits/locale -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/linux/x86_64/common/kits/locale -iquote /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/common/kits/locale -I /home/kallisti5/Code/haiku/headers/private/locale -I /home/kallisti5/Code/haiku/headers/private/shared -I /home/kallisti5/Code/haiku/headers/os/locale -I /home/kallisti5/Code/haiku/headers/os/storage -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3 -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3/powerpc-apple-haiku -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3/backward -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/../../../../powerpc-apple-haiku/include/c++/4.7.3/ext -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/include -I /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.7.3/include-fixed -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/opengl -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/kits/locale/Country.o" ;

...failed C++ /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/locale/Country.o ...
Archive /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/libshared.a 
Ranlib /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/shared/libshared.a 
MergeObjectFromObjects1 /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/kits/interface/interface_kit.o 

BUILD FAILURE:
...failed updating 2 target(s)...
...skipped 13 target(s)...
...updated 1894 target(s)...

Attachments (4)

ppc-build-hrev46759.log (341.1 KB ) - added by kallisti5 10 years ago.
complete jam -q @bootstrap-raw uild log
buildtools-ppc-got-workaround.diff (3.0 KB ) - added by mmu_man 9 years ago.
ppc-bootstrap-hrev51240.txt (405.4 KB ) - added by kallisti5 7 years ago.
bootstrap ppc hrev51240
gcc_bootstrap-5.4.0_2016_06_04-1-ppc.hpkg.txt (69.2 KB ) - added by kallisti5 7 years ago.

Download all attachments as: .zip

Change History (33)

comment:1 by bonefish, 10 years ago

Similar to #10241. The ICU dependency and header directory are declared correctly in the Jamfile, but the header directory doesn't appear on the command line. This points to an earlier problem.

by kallisti5, 10 years ago

Attachment: ppc-build-hrev46759.log added

complete jam -q @bootstrap-raw uild log

comment:2 by kallisti5, 10 years ago

After fixing some build issues due to scheduler, back to this stage. Attached a complete build log from a fresh generated.ppc directory.

kallisti5@machine haiku :) $ find generated.x86_gcc2/ -name coll.h
generated.x86_gcc2/build_packages/icu-4.8.1.1-4-x86_gcc2/develop/headers/unicode/coll.h
kallisti5@machine haiku :( $ find generated.ppc/ -name coll.h
kallisti5@machine haiku :) $ ls generated.ppc/build_packages/
kallisti5@machine haiku :) $ 

comment:3 by kallisti5, 10 years ago

hmm.. build/jam/repositories/HaikuPortsCross/ppc looks oddly empty. Going to try adding icu there.

comment:4 by kallisti5, 10 years ago

adding icu fixed that issue. It looks like the bootstrap needs curl and friends now (meaning it looks broken for all architectures at the moment as curl doesn't exist in the cross repo)

See http://www.freelists.org/post/haiku-development/Will-haikuportscross-ever-go-away

comment:5 by kallisti5, 10 years ago

current bootstrap issue:

	  cc1-checksum.o libbackend.a main.o  libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -L/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/./gmp/.libs -L/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/./mpfr/src/.libs -L/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/./mpc/src/.libs -lmpc -lmpfr -lgmp   -L../zlib -lz
/home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.8.2/crtbegin.o: In function `__do_global_dtors_aux':
crtstuff.c:(.text+0x3e): relocation truncated to fit: R_PPC_GOT16 against symbol `__DTOR_END__' defined in .dtors section in /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.8.2/crtend.o
crtstuff.c:(.text+0x82): relocation truncated to fit: R_PPC_GOT16 against symbol `__deregister_frame_info' defined in .text section in /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/sysroot/boot/system/develop/lib/libroot.so
/home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.8.2/crtbegin.o: In function `frame_dummy':
crtstuff.c:(.text+0xf6): relocation truncated to fit: R_PPC_GOT16 against symbol `__register_frame_info' defined in .text section in /home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/sysroot/boot/system/develop/lib/libroot.so
/home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/lib/gcc/powerpc-apple-haiku/4.8.2/crtend.o: In function `__do_global_ctors_aux':
crtstuff.c:(.text+0x1e): relocation truncated to fit: R_PPC_GOT16 against `__CTOR_END__'
c/c-typeck.o: In function `c_common_type(tree_node*, tree_node*)':
c-typeck.c:(.text+0x1e): relocation truncated to fit: R_PPC_GOT16 against symbol `global_trees' defined in .bss section in libbackend.a(tree.o)
c-typeck.c:(.text+0x192): relocation truncated to fit: R_PPC_GOT16 against symbol `integer_types' defined in .bss section in libbackend.a(tree.o)
c-typeck.c:(.text+0x29e): relocation truncated to fit: R_PPC_GOT16 against symbol `mode_class' defined in .rodata section in libbackend.a(insn-modes.o)
c-typeck.c:(.text+0x346): relocation truncated to fit: R_PPC_GOT16 against symbol `mode_class' defined in .rodata section in libbackend.a(insn-modes.o)
c-typeck.c:(.text+0x53a): relocation truncated to fit: R_PPC_GOT16 against symbol `mode_fbit' defined in .rodata section in libbackend.a(insn-modes.o)
c-typeck.c:(.text+0x53e): relocation truncated to fit: R_PPC_GOT16 against symbol `mode_ibit' defined in .rodata section in libbackend.a(insn-modes.o)
c-typeck.c:(.text+0x55e): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make[2]: *** [cc1] Error 1
make[2]: Leaving directory `/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj'
make: *** [all] Error 2
Command '['/bin/bash', '-c', '. /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/wrapper-script']' returned non-zero exit status 2

comment:6 by korli, 10 years ago

Same issue after binutils 2.24 update.

comment:7 by kallisti5, 10 years ago

EDIT: Ignore. False positive failure.

Last edited 9 years ago by kallisti5 (previous) (diff)

comment:8 by kallisti5, 9 years ago

jam -q @bootstrap-raw

Ld /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/system/libroot/stubbed/libroot.so 
AddVariableToScript1 /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-init-vars 
InitScript1 /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-make-dirs 
CreateContainerMakeDirectoriesScript1 /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-make-dirs 
InitScript1 /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/packaging/packages_build/bootstrap/hpkg_-haiku_cross_devel_sysroot_stage1_ppc.hpkg/scripts/haiku.package-copy-files 
/home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
/home/kallisti5/Code/haiku/generated.ppc/cross-tools-ppc/bin/powerpc-apple-haiku-ld: final link failed: Bad value

by mmu_man, 9 years ago

comment:9 by mmu_man, 9 years ago

I worked around the last issue with the attached patch, but I'm not yet sure why it works, and why it got broken in the first place. It looked like https://sourceware.org/ml/binutils/2008-09/msg00122.html (and I suspect the vxworks target is broken again too)

comment:10 by bonefish, 9 years ago

Owner: changed from bonefish to nobody
Status: newassigned

comment:11 by bonefish, 9 years ago

Priority: highnormal

comment:12 by mmu_man, 9 years ago

Ok I fixed the last 2 issues (GOT thing and truncated reloc) in btrev43099.

Now it fails bootstrapping gcc at:

powerpc-apple-haiku-gcc --sysroot=/home/revol/devel/haiku/trunk/generated-ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.3_2014_08_03/boot/cross-sysroot/ppc/   -O2  -g -O2 -U_FORTIFY_SOURCE -DIN_GCC   -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -U_FORTIFY_SOURCE -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _floatunditf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a  && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/home/revol/devel/haiku/trunk/generated-ppc/objects/haiku/ppc/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.3_2014_08_03/boot/cross-sysroot/ppc/boot/system/develop/lib/init_term_dyn.o: In function `__haiku_init_before':
init_term_dyn.c:(.text+0x38): undefined reference to `get_image_symbol'

comment:13 by mmu_man, 9 years ago

Ok this looke like the same issue as #11144 for ARM.

Version 0, edited 9 years ago by mmu_man (next)

comment:14 by mmu_man, 9 years ago

Fixed the gcc bootstrap in btrev43100. Let's see where it stops now…

comment:15 by mmu_man, 9 years ago

Ok we're back into business:

C++ /home/revol/devel/haiku/trunk/generated-ppc/objects/haiku/ppc/release/system/kernel/arch/ppc/arch_int.o 
/home/revol/devel/haiku/trunk/src/system/kernel/arch/ppc/arch_int.cpp: In function 'void ppc_exception_entry(int, iframe*)':
/home/revol/devel/haiku/trunk/src/system/kernel/arch/ppc/arch_int.cpp:138:19: error: invalid conversion from 'void (*)()' to 'uint32 {aka long unsigned int}' [-fpermissive]
      iframe->srr0 = thread->fault_handler;
                   ^

comment:16 by mmu_man, 9 years ago

Handler type cast fixed in hrev49060.

Now: error: redefinition of 'atomic_set64'

comment:17 by mmu_man, 9 years ago

As of hrev49061 I've made all atomic ops to use the gcc4 inline versions for now, although I don't know if the 64bit ones are really implemented…

comment:18 by mmu_man, 9 years ago

Now jam @bootstrap-raw complains of missing cmd:python. And jam -sHAIKU_BUILD_TYPE=bootstrap haiku-boot-cd-ppc.iso is still broken as well:

C++ /home/revol/devel/haiku/trunk/generated-ppc/objects/haiku/ppc/release/system/boot/platform/openfirmware/console.o 
In file included from /home/revol/devel/haiku/trunk/headers/posix/sys/types.h:120:0,
                 from /home/revol/devel/haiku/trunk/headers/posix/dirent.h:9,
                 from /home/revol/devel/haiku/trunk/headers/private/kernel/boot/vfs.h:9,
                 from /home/revol/devel/haiku/trunk/headers/private/kernel/boot/platform/generic/text_console.h:9,
                 from /home/revol/devel/haiku/trunk/src/system/boot/platform/openfirmware/console.h:8,
                 from /home/revol/devel/haiku/trunk/src/system/boot/platform/openfirmware/console.cpp:8:
/home/revol/devel/haiku/trunk/headers/posix/size_t.h:9:20: fatal error: stddef.h: No such file or directory
 #include <stddef.h>
                    ^

comment:19 by mmu_man, 9 years ago

Ok, jam @bootstrap-raw haiku-boot-cd-ppc.iso seems to work now, at least compile.

Last edited 9 years ago by mmu_man (previous) (diff)

comment:20 by mmu_man, 9 years ago

Owner: changed from nobody to mmu_man

comment:21 by pulkomandy, 9 years ago

Now that you have the bootstrap packages, you can use the "unbootstrap" script (in src/3rdparty/pulkomandy) to convert them to non-bootstrap ones. The resulting packages can be uploaded to the PPC repository, making it possible to build a boot image without bootstrapping.

This will make it possible for the buildbot to start building things further again. We can also set the buildbot to build a smaller target (haiku-boot-cd-ppc.iso sounds like a good choice) so we can use it to detect new build failures.

comment:22 by mmu_man, 9 years ago

I don't remember if it needs to be run on Haiku or not...

Btw, I have an attempt at working around QEMU's OpenBIOS bugs here: https://github.com/mmuman/haiku/tree/rebasing-ppc-qemu-openbios It goes past the mmu init but hangs a little further.

comment:23 by pulkomandy, 9 years ago

unbootstrap needs the "package" tool so it should be run inside Haiku, or on linux with trick to set the path and library path so the "package" tool from the cross tools can be used (maybe it could use "jam run" if that till works).

comment:24 by mmu_man, 9 years ago

Btw I fixed a bug on the COFF loader creation, no wonder it never really worked, this ugly format's concept of "entry point" is a pointer to the actual entry code, so it always started with a bad address. Now it starts on my Performa 5400/180, although it complains that CLAIM fails.

For those wanting to try on old Macs, the same notes as for NetBSD apply (about device paths, screen output…): http://www.netbsd.org/ports/macppc/models.html Also remember the FAT implementation in OF only seems to know about 8.3 names, so better rename the loader as "haiku.xcf" or something if using a floppy.

by kallisti5, 7 years ago

Attachment: ppc-bootstrap-hrev51240.txt added

bootstrap ppc hrev51240

comment:25 by kallisti5, 7 years ago

patch: 01

comment:26 by kallisti5, 7 years ago

the issues above are resolved. Now dealing with atomic issues under powerpc.

I opened a gcc bug around it: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81283

I (incorrectly) worked around one of these dynamic atomic failovers... but now running into a bunch:

diff --git a/src/system/libroot/os/arch/ppc/atomic.S b/src/system/libroot/os/arch/ppc/atomic.S
index d0c2a27379..540bf3dda3 100644
--- a/src/system/libroot/os/arch/ppc/atomic.S
+++ b/src/system/libroot/os/arch/ppc/atomic.S
@@ -83,3 +83,13 @@ lost6:       lwarx   %r5, 0, %r3
                mr              %r3, %r5
                blr
 FUNCTION_END(atomic_get)
+
+/* If GCC emits this, it means
+   the target architecture doesn't
+   support 64-bit atomics.
+   Just do a sync, and return
+*/
+FUNCTION(__atomic_fetch_add_8):
+       sync
+       blr
+FUNCTION_END(__atomic_fetch_add_8)
Link /home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/servers/app/app_server 
/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/servers/app/DelayedMessage.o: In function `DelayedMessageSender::CountSentMessages() const':
DelayedMessage.cpp:(.text+0xd38): undefined reference to `__atomic_load_8'
/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/servers/app/DelayedMessage.o: In function `DelayedMessageSender::_SendDelayedMessages()':
DelayedMessage.cpp:(.text+0x1078): undefined reference to `__atomic_store_8'
DelayedMessage.cpp:(.text+0x11e8): undefined reference to `__atomic_store_8'
DelayedMessage.cpp:(.text+0x127c): undefined reference to `__atomic_load_8'
DelayedMessage.cpp:(.text+0x12cc): undefined reference to `__atomic_store_8'
/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/servers/app/DelayedMessage.o: In function `DelayedMessageSender::_MessageLoop()':
DelayedMessage.cpp:(.text+0x1394): undefined reference to `__atomic_load_8'
DelayedMessage.cpp:(.text+0x13d0): undefined reference to `__atomic_load_8'
/home/kallisti5/Code/haiku/generated.ppc/objects/haiku/ppc/release/servers/app/DelayedMessage.o: In function `DelayedMessageSender::_Wakeup(long long)':
DelayedMessage.cpp:(.text+0x1500): undefined reference to `__atomic_load_8'
DelayedMessage.cpp:(.text+0x1524): undefined reference to `__atomic_store_8'
collect2: error: ld returned 1 exit status

comment:27 by pulkomandy, 7 years ago

Does not look like a gcc bug to me. When there is no dedicated CPU instruction for an atomic operation, GCC will call an helper routine, which the OS should implement. That routine can do anything that's needed to emulate the behavior: do a syscall, disable interrupts, acquire some global mutex, ...

On ARM this is the reason we've gone with ARMv7 first (it avoids us the boring task of implementing these). If you want PPC32 to run, you will need to implement them all.

comment:28 by kallisti5, 7 years ago

Lame. Would I be correct that src/system/libroot/os/arch/ppc/atomic.S is a good spot to implement this? I think the rest of those calls are no longer used (will confim though)

The gcc guys said to just include libatomic.. but not sure this is the right solution.

comment:29 by pulkomandy, 6 years ago

patch: 10
Note: See TracTickets for help on using tickets.