Skip to content

Commit

Permalink
Merge branch 'master' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Oct 8, 2024
2 parents 8acbd2f + c43de0b commit 18197b8
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 34 deletions.
1 change: 1 addition & 0 deletions build/allcross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions build/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions build/korg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN apt-get -q -y update && \
dwarves \
file \
flex \
gawk \
gcc \
git \
kmod \
Expand Down
14 changes: 8 additions & 6 deletions build/scripts/image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions build/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN apt-get -q -y update && \
dwarves \
file \
flex \
gawk \
gcc \
gcc-powerpc-linux-gnu \
g++-powerpc-linux-gnu \
Expand Down
2 changes: 2 additions & 0 deletions etc/configs/elf-abi-v2-n.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_EXPERT=y
CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2=n
12 changes: 12 additions & 0 deletions etc/configs/hpt-mmu-n.config
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions etc/configs/opt-for-size-y.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=n
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
3 changes: 3 additions & 0 deletions etc/configs/pcrel-y.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_POWERPC64_CPU=n
CONFIG_POWER10_CPU=y
CONFIG_PPC_KERNEL_PCREL=y
126 changes: 101 additions & 25 deletions etc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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 != "[email protected]":
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', '[email protected]']):
# The 85xx builds hit gcc segfaults with earlier compilers, so use 8.5.0
ppc85xx_image = '[email protected]'

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)
Expand All @@ -102,22 +139,29 @@ 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)
b('qemu-powernv+p10+tcg', 'ppc64le_guest_defconfig+lockdep', image)
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 ['[email protected]', 'ubuntu']:
Expand Down Expand Up @@ -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', '[email protected]']):
# The 85xx builds hit gcc segfaults with earlier compilers, so use 8.5.0
ppc85xx_image = '[email protected]'

# 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'])
Expand All @@ -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('[email protected]', '[email protected]')
allyesmod_image = image
if not image_at_least(image, ['fedora@31', '[email protected]']):
# GCC 5.5.0 fails on various things for allyes/allmod
allyesmod_image = '[email protected]'

# 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
Expand Down Expand Up @@ -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', '[email protected]']):
# Only GCC >= 12 can build pcrel because it needs -mcpu=power10
pcrel_image = '[email protected]'

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', '[email protected]']):
# Only GCC >= 12 can build HPT=n because it needs -mcpu=power10
feat_image = '[email protected]'

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('[email protected]', '[email protected]'), merge_config=['randomize-base-y'])

#########################################
# selftests
#########################################
Expand Down
8 changes: 5 additions & 3 deletions external/korg-toolchains/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 18197b8

Please sign in to comment.