# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: architecture/powerpc64/parse-config # Copyright (C) 2004 - 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # Note: this is a copy of sparc64/parse-config alter_arch() { echo_status "Altering arch_{machine,target} to powerpc" # tweak target and other defines atstage native && arch_build=${arch_build/64/} arch_machine=${arch_machine/64/} arch_target=${arch_target/64/} arch_sizeof_long=4 arch_sizeof_char_p=4 } powerpc64_build32() { # fork, make a copy of all variables, so we fully restore to normal ( alter_arch arch_sizeof_long=4 arch_sizeof_char_p=4 var_append GCC_WRAPPER_INSERT ' ' '-m32' var_append CPP_WRAPPER_INSERT ' ' '-m32' function set_confopt () { : ; } # do not reset the confopt, ... build_package $pkg $pkg.conf ) # let it continue to build just normal, as if "nothing" happened make distclean } # add elf abi patches, e.g. for clang, rustc, ... var_append patchfiles ' ' "`ls $confdir/*.patch.$arch.$SDECFG_POWERPC64_ELF_ABI 2> /dev/null | tr '\n' ' '`" # default to 32-bit? if [ "$SDECFG_POWERPC64_32" = 1 ]; then # dietlibc? x="${pkg//-/_}" ; x="${x//+/_}" eval x=\$SDECFG_DIETLIBC_$x if [ $pkg = "dietlibc" -o "$x" = 1 ]; then echo_status "Building package for 64bit" var_append GCC_WRAPPER_INSERT ' ' '-m64' else case $pkg in glibc32|linux-header|linux|kmod|module-init-tools|yaboot|grub2) # usually nothing, except: [ $pkg = kmod ] && hook_add preconf 5 'libdir=${libdir%64}' ;; glibc|kexec-tools) # as we otherwise default to 32-bit var_append GCC_WRAPPER_INSERT ' ' '-m64' ;; binutils|gcc|gcc-spe) # gdb #alter_arch # to 32-bit "powerpc" #arch_target=${arch_target/powerpc/powerpc64} ;; *) alter_arch # to 32-bit "powerpc" ;; esac fi elif [ "$SDECFG_MULTILIB" = 1 ]; then case $pkg in util-linux|e2fsprogs) # we need a 32bit lib for yaboot :-( pkginstalled yaboot && hook_add preconf 1 "powerpc64_build32" ;; esac fi