diff --git a/build/allcross/Dockerfile b/build/allcross/Dockerfile index 658482f..08a61c3 100644 --- a/build/allcross/Dockerfile +++ b/build/allcross/Dockerfile @@ -17,6 +17,7 @@ RUN apt-get -q -y update && \ dwarves \ file \ flex \ + gawk \ gcc \ gcc-powerpc-linux-gnu g++-powerpc-linux-gnu \ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \ diff --git a/build/fedora/Dockerfile b/build/fedora/Dockerfile index d8f09b3..a0836b2 100644 --- a/build/fedora/Dockerfile +++ b/build/fedora/Dockerfile @@ -13,6 +13,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \ elfutils-libelf-devel \ findutils \ flex \ + gawk \ gcc \ gcc-powerpc64le-linux-gnu \ gcc-powerpc64-linux-gnu \ diff --git a/build/korg/Dockerfile b/build/korg/Dockerfile index c7724a9..6318e46 100644 --- a/build/korg/Dockerfile +++ b/build/korg/Dockerfile @@ -18,6 +18,7 @@ RUN apt-get -q -y update && \ dwarves \ file \ flex \ + gawk \ gcc \ git \ kmod \ diff --git a/build/scripts/image.sh b/build/scripts/image.sh index abab418..9375623 100755 --- a/build/scripts/image.sh +++ b/build/scripts/image.sh @@ -20,20 +20,22 @@ image="linuxppc/build:$distro-$version" if [[ "$distro" == "fedora" ]]; then from="registry.fedoraproject.org/$distro:$version" elif [[ "$distro" == "docs" ]]; then - from="docker.io/ubuntu:$version" + from="public.ecr.aws/ubuntu/ubuntu:$version" elif [[ "$distro" == "allcross" ]]; then - from="docker.io/debian:$version" + from="public.ecr.aws/debian/debian:$version" elif [[ "$distro" == "korg" ]]; then # Use an older distro for the 5.x toolchains. if [[ "$version" == 5.* ]]; then - from="docker.io/ubuntu:16.04" + from="public.ecr.aws/docker/library/ubuntu:16.04" elif [[ "$version" == 13.* ]]; then - from="docker.io/ubuntu:23.04" + from="public.ecr.aws/ubuntu/ubuntu:23.04" else - from="docker.io/ubuntu:20.04" + from="public.ecr.aws/ubuntu/ubuntu:20.04" fi +elif [[ "$distro" == "ubuntu" && "$version" == 16.* ]]; then + from="public.ecr.aws/docker/library/ubuntu:16.04" else - from="docker.io/$distro:$version" + from="public.ecr.aws/$distro/$distro:$version" fi if [[ "$task" == "image" ]]; then diff --git a/build/ubuntu/Dockerfile b/build/ubuntu/Dockerfile index 2ae5dbb..6d34556 100644 --- a/build/ubuntu/Dockerfile +++ b/build/ubuntu/Dockerfile @@ -26,6 +26,7 @@ RUN apt-get -q -y update && \ dwarves \ file \ flex \ + gawk \ gcc \ gcc-powerpc-linux-gnu \ g++-powerpc-linux-gnu \ diff --git a/etc/configs/elf-abi-v2-n.config b/etc/configs/elf-abi-v2-n.config new file mode 100644 index 0000000..0a07690 --- /dev/null +++ b/etc/configs/elf-abi-v2-n.config @@ -0,0 +1,2 @@ +CONFIG_EXPERT=y +CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2=n diff --git a/etc/configs/hpt-mmu-n.config b/etc/configs/hpt-mmu-n.config new file mode 100644 index 0000000..50e7fd8 --- /dev/null +++ b/etc/configs/hpt-mmu-n.config @@ -0,0 +1,12 @@ +CONFIG_POWERPC64_CPU=n +CONFIG_POWER10_CPU=y +CONFIG_KVM_BOOK3S_64=n +CONFIG_CXL=n +CONFIG_PPC_PASEMI=n +CONFIG_PPC_CELL=n +CONFIG_PPC_IBM_CELL_BLADE=n +CONFIG_PPC_PS3=n +CONFIG_PPC_PMAC=n +CONFIG_PPC_MAPLE=n +CONFIG_PPC_RADIX_MMU=y +CONFIG_PPC_64S_HASH_MMU=n diff --git a/etc/configs/opt-for-size-y.config b/etc/configs/opt-for-size-y.config new file mode 100644 index 0000000..d5baa81 --- /dev/null +++ b/etc/configs/opt-for-size-y.config @@ -0,0 +1,2 @@ +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=n +CONFIG_CC_OPTIMIZE_FOR_SIZE=y diff --git a/etc/configs/pcrel-y.config b/etc/configs/pcrel-y.config new file mode 100644 index 0000000..7301cfe --- /dev/null +++ b/etc/configs/pcrel-y.config @@ -0,0 +1,3 @@ +CONFIG_POWERPC64_CPU=n +CONFIG_POWER10_CPU=y +CONFIG_PPC_KERNEL_PCREL=y diff --git a/etc/tests.py b/etc/tests.py index 4782ecf..df20000 100644 --- a/etc/tests.py +++ b/etc/tests.py @@ -25,6 +25,37 @@ def clang_image(images): return None +# Check that `image` is at least as new as one of the images +# in the `versions` list. +def image_at_least(image, versions): + # Split the image into the name and optional version number + parts = image.split('@') + iname = parts[0] + if len(parts) == 2: + iversion = int(parts[1].replace('.', '')) + else: + iversion = None + + for version in versions: + vname, vver = version.split('@') + + # If the names don't match continue + if iname != vname: + continue + + # If the input image has no version it's implicitly the latest, so + # assume it's sufficiently new. + if iversion is None: + return True + + # Compare the version numbers + vver = int(vver.replace('.', '')) + if iversion >= vver: + return True + + return False + + def qemu_coverage(args, suite=None): images = std_images(args) if suite is None: @@ -69,9 +100,6 @@ def qemu_coverage(args, suite=None): # BOOK3S64 && BIG_ENDIAN # PSERIES, POWERNV, CELL, PS3, PMAC && PMAC64, PASEMI, MAPLE k('ppc64_guest_defconfig+lockdep', image, merge_config=guest_configs + ['lockdep-y']) - # As above with 4K page size - k('ppc64le_guest_defconfig+4k', image, merge_config=guest_configs_4k) - k('ppc64_guest_defconfig+4k', image, merge_config=guest_configs_4k) # G5 k('g5_defconfig', image, merge_config=g5_configs) # BOOK3E_64 @@ -84,10 +112,19 @@ def qemu_coverage(args, suite=None): # 8xx k('mpc885_ads_defconfig', image) + # 4K PAGE_SIZE builds, default builds are 64K + k('ppc64le_guest_defconfig+4k', image, merge_config=guest_configs_4k) + k('ppc64_guest_defconfig+4k', image, merge_config=guest_configs_4k) + k('g5_defconfig+4k', image, merge_config=g5_configs + ['4k-pages']) + # PPC_85xx - if image != "korg@5.5.0": - k('corenet32_smp_defconfig', image, merge_config=['debug-info-n']) - b('qemu-e500mc', 'corenet32_smp_defconfig', image) + ppc85xx_image = image + if not image_at_least(image, ['fedora@31', 'korg@8.5.0']): + # The 85xx builds hit gcc segfaults with earlier compilers, so use 8.5.0 + ppc85xx_image = 'korg@8.5.0' + + k('corenet32_smp_defconfig', ppc85xx_image, merge_config=['debug-info-n']) + b('qemu-e500mc', 'corenet32_smp_defconfig', ppc85xx_image) # PPC_BOOK3S_32 b('qemu-mac99', 'pmac32_defconfig', image) @@ -102,15 +139,21 @@ def qemu_coverage(args, suite=None): # G5 b('qemu-g5', 'g5_defconfig', image) b('qemu-g5+compat', 'g5_defconfig', image) + b('qemu-g5', 'g5_defconfig+4k', image) + b('qemu-g5+compat', 'g5_defconfig+4k', image) + # pseries boots b('qemu-pseries+p10+tcg', 'ppc64le_guest_defconfig+lockdep', image) b('qemu-pseries+p10+tcg', 'ppc64_guest_defconfig+lockdep', image) + b('qemu-pseries+p10+tcg', 'ppc64le_guest_defconfig+4k', image) b(f'qemu-pseries+p8+{accel}', 'ppc64le_guest_defconfig+lockdep', image) b(f'qemu-pseries+p9+{accel}', 'ppc64le_guest_defconfig+lockdep', image) b(f'qemu-pseries+p8+{accel}', 'ppc64_guest_defconfig+lockdep', image) b(f'qemu-pseries+p9+{accel}', 'ppc64_guest_defconfig+lockdep', image) b(f'qemu-pseries+p9+{accel}+fedora39', 'ppc64le_guest_defconfig+lockdep', image) + b(f'qemu-pseries+p9+{accel}+fedora39', 'ppc64le_guest_defconfig+4k', image) + # powernv boots b('qemu-powernv+p8+tcg', 'ppc64le_guest_defconfig+lockdep', image) b('qemu-powernv+p9+tcg', 'ppc64le_guest_defconfig+lockdep', image) @@ -118,6 +161,7 @@ def qemu_coverage(args, suite=None): b('qemu-powernv+p8+tcg', 'ppc64_guest_defconfig+lockdep', image) b('qemu-powernv+p9+tcg', 'ppc64_guest_defconfig+lockdep', image) b('qemu-powernv+p10+tcg', 'ppc64_guest_defconfig+lockdep', image) + b('qemu-powernv+p10+tcg', 'ppc64_guest_defconfig+4k', image) for image in ['ubuntu@16.04', 'ubuntu']: @@ -171,19 +215,25 @@ def full_compile_test(args, suite=None): # BOOK3S64 && BIG_ENDIAN # PSERIES, POWERNV, CELL, PS3, PMAC && PMAC64, PASEMI, MAPLE k('ppc64_guest_defconfig', image, merge_config=guest_configs) - # As above with 4K page size - k('ppc64le_guest_defconfig+4k', image, merge_config=guest_configs_4k) - k('ppc64_guest_defconfig+4k', image, merge_config=guest_configs_4k) # PMAC && PMAC64 k('g5_defconfig', image, merge_config=g5_configs) # BOOK3E_64 k('corenet64_smp_defconfig', image, merge_config=corenet64_configs) + + ppc85xx_image = image + if not image_at_least(image, ['fedora@31', 'korg@8.5.0']): + # The 85xx builds hit gcc segfaults with earlier compilers, so use 8.5.0 + ppc85xx_image = 'korg@8.5.0' + # PPC_85xx, PPC_E500MC - k('corenet32_smp_defconfig', image, merge_config=['debug-info-n']) + k('corenet32_smp_defconfig', ppc85xx_image, merge_config=['debug-info-n']) # PPC_85xx, SMP=y, PPC_E500MC=n - k('mpc85xx_smp_defconfig', image) + k('mpc85xx_smp_defconfig', ppc85xx_image) # PPC_85xx, SMP=n - k('mpc85xx_defconfig', image) + k('mpc85xx_defconfig', ppc85xx_image) + # PPC_85xx + RANDOMIZE_BASE + k('mpc85xx_smp_defconfig+kaslr', ppc85xx_image, merge_config=['randomize-base-y']) + # PPC_BOOK3S_32 k('pmac32_defconfig', image, merge_config=pmac32_configs) k('pmac32_defconfig+smp', image, merge_config=pmac32_configs + ['smp-y']) @@ -206,19 +256,22 @@ def full_compile_test(args, suite=None): # Doesn't exist #k('ppc64le_allyesconfig', image) - # GCC 5.5.0 fails on various things for allyes/allmod - tmp_image = image.replace('korg@5.5.0', 'korg@8.5.0') + allyesmod_image = image + if not image_at_least(image, ['fedora@31', 'korg@8.5.0']): + # GCC 5.5.0 fails on various things for allyes/allmod + allyesmod_image = 'korg@8.5.0' + # 64-bit Book3S BE - k('allyesconfig', tmp_image, merge_config=no_gcc_plugins) + k('allyesconfig', allyesmod_image, merge_config=no_gcc_plugins) # 64-bit Book3S BE - k('allmodconfig', tmp_image, merge_config=no_gcc_plugins) + k('allmodconfig', allyesmod_image, merge_config=no_gcc_plugins) # 64-bit Book3S LE - k('ppc64le_allmodconfig', tmp_image, merge_config=no_gcc_plugins) + k('ppc64le_allmodconfig', allyesmod_image, merge_config=no_gcc_plugins) # 32-bit Book3S BE (korg 5.5.0 doesn't build) - k('ppc32_allmodconfig', tmp_image, merge_config=no_gcc_plugins) + k('ppc32_allmodconfig', allyesmod_image, merge_config=no_gcc_plugins) # 64-bit BOOK3E BE (korg 5.5.0 doesn't build) # FIXME Broken due to start_text_address problems - # k('ppc64_book3e_allmodconfig', tmp_image, merge_config=no_gcc_plugins) + # k('ppc64_book3e_allmodconfig', allyesmod_image, merge_config=no_gcc_plugins) ######################################### # specific machine/platform configs @@ -248,24 +301,47 @@ def full_compile_test(args, suite=None): # PPC_8xx + PPC16K_PAGES k('mpc885_ads_defconfig+16k', image, merge_config=['16k-pages']) + # 4K PAGE_SIZE builds, default builds are 64K + k('ppc64le_guest_defconfig+4k', image, merge_config=guest_configs_4k) + k('ppc64_guest_defconfig+4k', image, merge_config=guest_configs_4k) + k('g5_defconfig+4k', image, merge_config=g5_configs + ['4k-pages']) + ######################################### # specific enabled features ######################################### - for feature in ['preempt', 'compat', 'lockdep', 'reltest']: + for feature in ['preempt', 'compat', 'lockdep', 'reltest', 'opt-for-size']: k(f'ppc64_defconfig+{feature}', image, merge_config=[f'{feature}-y']) k(f'ppc64le_defconfig+{feature}', image, merge_config=[f'{feature}-y']) + pcrel_image = image + if not image_at_least(image, ['fedora@36', 'korg@12.1.0']): + # Only GCC >= 12 can build pcrel because it needs -mcpu=power10 + pcrel_image = 'korg@12.1.0' + + k('ppc64le_defconfig+pcrel', pcrel_image, merge_config=['pcrel-y']) + # FIXME doesn't build + # k('ppc64_defconfig+pcrel', pcrel_image, merge_config=['pcrel-y']) + ######################################### # specific disabled features ######################################### - for feature in ['radix', 'modules']: + for feature in ['radix', 'hpt-mmu']: + feat_image = image + if feature == 'hpt-mmu' and not image_at_least(image, ['fedora@36', 'korg@12.1.0']): + # Only GCC >= 12 can build HPT=n because it needs -mcpu=power10 + feat_image = 'korg@12.1.0' + + k(f'ppc64_defconfig+no{feature}', feat_image, merge_config=[f'{feature}-n']) + k(f'ppc64le_defconfig+no{feature}', feat_image, merge_config=[f'{feature}-n']) + k(f'ppc64_defconfig+no{feature}+4k', feat_image, merge_config=[f'{feature}-n', '4k-pages']) + k(f'ppc64le_defconfig+no{feature}+4k', feat_image, merge_config=[f'{feature}-n', '4k-pages']) + + k('ppc64_defconfig+noelf-abi-v2', image, merge_config=['elf-abi-v2-n']) + + for feature in ['modules']: k(f'ppc64_defconfig+no{feature}', image, merge_config=[f'{feature}-n']) k(f'ppc64le_defconfig+no{feature}', image, merge_config=[f'{feature}-n']) - # PPC_85xx + RANDOMIZE_BASE - # This hits gcc segfaults with earlier compilers, so use 8.5.0 - k('mpc85xx_smp_defconfig+kaslr', image.replace('korg@5.5.0', 'korg@8.5.0'), merge_config=['randomize-base-y']) - ######################################### # selftests ######################################### diff --git a/external/korg-toolchains/Makefile b/external/korg-toolchains/Makefile index 4cbf59e..37671b1 100644 --- a/external/korg-toolchains/Makefile +++ b/external/korg-toolchains/Makefile @@ -50,7 +50,9 @@ ARCHES := alpha \ x86_64 \ xtensa -VERSIONS := 13.2.0 \ +VERSIONS := 14.2.0 \ + 14.1.0 \ + 13.2.0 \ 13.1.0 \ 12.3.0 \ 12.2.0 \ @@ -94,8 +96,8 @@ download-all: $(ALL_TARGETS) CLEAN_DIRS := $(patsubst %,gcc-%-nolibc,$(VERSIONS)) -# Only download powerpc 13.2.0 & 5.5.0 by default -download: gcc-13.2.0-nolibc/powerpc64-linux gcc-5.5.0-nolibc/powerpc64-linux +# Only download powerpc 14.2.0 & 5.5.0 by default +download: gcc-14.2.0-nolibc/powerpc64-linux gcc-5.5.0-nolibc/powerpc64-linux prepare: download