Skip to content

Commit 1abd887

Browse files
committed
Updated kos-toolchain for multi-arch
1 parent 38b2ce4 commit 1abd887

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

gcc-base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# `docker build -t einsteinx2/dcdev-gcc-base:latest .`
1313

1414

15-
FROM --platform=$TARGETPLATFORM alpine:latest
15+
FROM alpine:latest
1616
LABEL maintainer "Ben Baron <ben@einsteinx2.com>"
1717

1818
# Download all necessary dependencies needed to build the KOS GCC cross-compiler toolchain

gcc-toolchain/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ARG KOS_BRANCH="master"
3939
# First stage: Alpine-based builder image to compile the GCC toolchain
4040
#
4141

42-
FROM --platform=$TARGETPLATFORM einsteinx2/dcdev-gcc-base:latest as builder
42+
FROM einsteinx2/dcdev-gcc-base:latest as builder
4343
LABEL maintainer "Ben Baron <ben@einsteinx2.com>"
4444

4545
# Choose GCC major version. Supported values are 9 (SH4 9.3/ARM 8.4), 4 (both 4.7.4)

kos-toolchain/Dockerfile

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
# To debug build problems, add the flag `--build-arg VERBOSE=true` when building the image to
4848
# have it print all output from each download and compilation step.
4949
# NOTE: If you are using the latest Docker versions with buildx, you'll also need to increase
50-
# the log limit (https://github.com/docker/buildx/issues/484) and add the flag `--progress=plain`
50+
# the log limit (https://github.com/docker/buildx/issues/484) and add optionally include
51+
# the flag `--progress=plain` if you want to see the full output.
5152
ARG VERBOSE=false
5253

5354
# For maximum speed, set this to the number of CPU threads you have
@@ -108,65 +109,65 @@ RUN if [ "$THREADS" -eq 0 ] 2>/dev/null; then \
108109
printf "export DOCKER_THREADS=$(getconf _NPROCESSORS_ONLN)\n" >> /tmp/dockerenv.sh; \
109110
elif ! [[ -z "${THREADS//[0-9]}" ]]; then \
110111
# If THREADS is a negative number or any non-integer, print an error and exit
111-
printf "Invalid THREADS specified, please enter a positive integer value\n"; >&2; \
112+
printf "Invalid THREADS specified, please enter a positive integer value\n"; \
112113
exit 1; \
113114
else \
114115
# If THREADS is a positive integer, use that value
115116
printf "export DOCKER_THREADS=$THREADS\n" >> /tmp/dockerenv.sh; \
116117
fi \
117118
&& . /tmp/dockerenv.sh \
118-
&& printf "Building using $DOCKER_THREADS threads\n" >&2
119+
&& printf "Building using $DOCKER_THREADS threads\n"
119120

120121
# Build KOS and patched GCC cross-compiler toolchain for SH4 (Main CPU) and ARM7DI (AICA Control CPU)
121122
RUN \
122123
# Clone repositories
123124
. /tmp/dockerenv.sh \
124-
&& printf "Cloning latest mainline KOS...$NL" >&2 \
125+
&& printf "Cloning latest mainline KOS...$NL" \
125126
&& git clone --single-branch --branch $KOS_BRANCH $KOS_REPO $KOS &> $REDIRECT \
126-
&& printf "Done.\nCloning latest mainline KOS PORTS...$NL" >&2 \
127+
&& printf "Done.\nCloning latest mainline KOS PORTS...$NL" \
127128
&& git clone --single-branch --branch $PORTS_BRANCH $PORTS_REPO $PORTS &> $REDIRECT \
128-
&& printf "Done.\n" >&2
129+
&& printf "Done.\n"
129130
RUN \
130131
# Configure environment
131132
. /tmp/dockerenv.sh \
132-
&& printf "Configuring environment...$NL" >&2 \
133+
&& printf "Configuring environment...$NL" \
133134
&& cp $KOS/doc/environ.sh.sample $KOS/environ.sh \
134135
# NOTE: This is in single quotes on purpose so that ${KOS_BASE} is not evaluated
135136
&& printf '. ${KOS_BASE}/environ_dreamcast.sh' >> $KOS/environ.sh \
136137
# NOTE: This is in double quotes on purpose so that $KOS is evaluated
137138
&& printf ". /etc/profile\n. $KOS/environ.sh\n" > /root/.bashrc \
138-
&& printf "Done.\n" >&2
139+
&& printf "Done.\n"
139140
RUN \
140141
# Build KOS
141142
. /tmp/dockerenv.sh && . $KOS/environ.sh \
142-
&& printf "Building KOS...$NL" >&2 \
143+
&& printf "Building KOS...$NL" \
143144
&& make -j$DOCKER_THREADS -C $KOS &> $REDIRECT \
144-
&& printf "Done.\nCleaning KOS...$NL" >&2 \
145+
&& printf "Done.\nCleaning KOS...$NL" \
145146
&& make -j$DOCKER_THREADS -C $KOS clean &> $REDIRECT \
146-
&& printf "Done.\n" >&2
147+
&& printf "Done.\n"
147148
RUN \
148149
# Build KOS Ports
149150
. /tmp/dockerenv.sh && . $KOS/environ.sh \
150-
&& printf "Building KOS Ports...$NL" >&2 \
151+
&& printf "Building KOS Ports...$NL" \
151152
&& make -C $KOS kos-ports_all &> $REDIRECT \
152-
&& printf "Done.\nCleaning KOS Ports...$NL" >&2 \
153+
&& printf "Done.\nCleaning KOS Ports...$NL" \
153154
&& make -C $KOS kos-ports_clean &> $REDIRECT \
154-
&& printf "Done.\n" >&2
155+
&& printf "Done.\n"
155156
RUN \
156157
# Build KOS addons
157158
. /tmp/dockerenv.sh && . $KOS/environ.sh \
158-
&& printf "Building KOS addons...$NL" >&2 \
159+
&& printf "Building KOS addons...$NL" \
159160
&& make -j$DOCKER_THREADS -C $KOS/addons &> $REDIRECT \
160-
&& printf "Done.\nCleaning KOS addons...$NL" >&2 \
161+
&& printf "Done.\nCleaning KOS addons...$NL" \
161162
&& find $KOS/addons -name "*.o" -delete \
162-
&& printf "Done.\n" >&2
163+
&& printf "Done.\n"
163164
RUN \
164165
# Build extra included utilities
165166
. /tmp/dockerenv.sh && . $KOS/environ.sh \
166-
&& printf "Building extra included utilities...$NL" >&2 \
167+
&& printf "Building extra included utilities...$NL" \
167168
&& sed -i 's/^DIRS.*/DIRS = bin2c bincnv dcbumpgen genromfs isotest kmgenc makejitter rdtest scramble vqenc wav2adpcm/' $KOS/utils/Makefile \
168169
&& make -j$DOCKER_THREADS -C $KOS/utils &> $REDIRECT \
169-
&& printf "Done.\nSymlinking extra utilities to $DCTOOLCHAIN/bin so they're in the PATH...$NL" >&2 \
170+
&& printf "Done.\nSymlinking extra utilities to $DCTOOLCHAIN/bin so they're in the PATH...$NL" \
170171
&& mkdir -p $DCTOOLCHAIN/bin \
171172
&& ln -s $KOS/utils/bin2c/bin2c $DCTOOLCHAIN/bin/bin2c \
172173
&& ln -s $KOS/utils/bin2o/bin2o $DCTOOLCHAIN/bin/bin2o \
@@ -182,13 +183,13 @@ RUN \
182183
&& ln -s $KOS/utils/scramble/scramble $DCTOOLCHAIN/bin/scramble \
183184
&& ln -s $KOS/utils/vqenc/vqenc $DCTOOLCHAIN/bin/vqenc \
184185
&& ln -s $KOS/utils/wav2adpcm/wav2adpcm $DCTOOLCHAIN/bin/wav2adpcm \
185-
&& printf "Done.\nCleaning extra included utilities...$NL" >&2 \
186+
&& printf "Done.\nCleaning extra included utilities...$NL" \
186187
&& find $KOS/utils -name "*.o" -delete \
187-
&& printf "Done.\n" >&2
188+
&& printf "Done.\n"
188189
RUN \
189190
# Build extra external utilities
190191
. /tmp/dockerenv.sh && . $KOS/environ.sh \
191-
&& printf "Building extra external utilities...$NL" >&2 \
192+
&& printf "Building extra external utilities...$NL" \
192193
&& mkdir -p $KOS/utils/makeip \
193194
&& cd $KOS/utils/makeip \
194195
&& curl --progress-bar -O http://www.boob.co.uk/files/makeip.tar.gz &> $REDIRECT \
@@ -197,25 +198,24 @@ RUN \
197198
&& gcc makeip.c -o makeip &> $REDIRECT \
198199
&& ln -s $KOS/utils/makeip/makeip $DCTOOLCHAIN/bin/makeip \
199200
&& cd $KOS/utils \
200-
&& git clone https://github.com/Kazade/img4dc.git &> $REDIRECT \
201+
&& git clone https://github.com/einsteinx2/img4dc.git &> $REDIRECT \
201202
&& cd $KOS/utils/img4dc \
202203
&& cmake . &> $REDIRECT \
203-
&& make BUMP=9 &> $REDIRECT \
204+
&& make cdi4dc &> $REDIRECT \
204205
&& ln -s $KOS/utils/img4dc/cdi4dc/cdi4dc $DCTOOLCHAIN/bin/cdi4dc \
205-
&& ln -s $KOS/utils/img4dc/mds4dc/mds4dc $DCTOOLCHAIN/bin/mds4dc \
206206
&& cd $KOS/utils \
207207
&& git clone https://github.com/sizious/dcload-ip.git &> $REDIRECT \
208208
&& cd $KOS/utils/dcload-ip \
209209
&& make install \
210-
&& printf "Done.\n" >&2
210+
&& printf "Done.\n"
211211
RUN \
212212
# Prepare files to copy in next stage
213213
. /tmp/dockerenv.sh \
214-
&& printf "Preparing files to copy to next stage...$NL" >&2 \
214+
&& printf "Preparing files to copy to next stage...$NL" \
215215
&& mkdir /tmp/copy \
216216
&& mv $DCTOOLCHAIN/sh-elf $DCTOOLCHAIN/arm-eabi $DCTOOLCHAIN/kos $DCTOOLCHAIN/kos-ports $DCTOOLCHAIN/bin /tmp/copy \
217217
&& mv /tmp/dockerenv.sh /root/.bashrc /tmp/copy \
218-
&& printf "Done.\n" >&2
218+
&& printf "Done.\n"
219219

220220
#
221221
# Second stage: Final Alpine image with the GCC cross-compiler toolchain, KOS, KOS-PORTS, Addons, Utils, and some other useful stuff
@@ -241,19 +241,19 @@ RUN \
241241
&& mv $DCTOOLCHAIN/.bashrc /root/.bashrc \
242242
\
243243
# Install useful tools for building Dreamcast projects
244-
&& printf "Installing useful tools for building Dreamcast projects...$NL" >&2 \
244+
&& printf "Installing useful tools for building Dreamcast projects...$NL" \
245245
&& apk --update add --no-cache \
246-
bash bison bzip2 cdrkit cmake colordiff curl flex gawk git linux-headers \
246+
bash bison bzip2 cdrkit cmake colordiff coreutils curl flex gawk git linux-headers \
247247
musl-dev make patch python2 sed subversion tar texinfo tree vim wget &> $REDIRECT \
248248
&& apk --update add --no-cache libelf-dev --repository=http://dl-cdn.alpinelinux.org/alpine/v3.9/main \
249249
&& rm -rf /var/cache/apk/* \
250-
&& printf "Done.\n" >&2 \
250+
&& printf "Done.\n" \
251251
\
252252
# Create entry point script to automatically load KOS environment
253-
&& printf "Create entry point script to automatically load KOS environment...$NL" >&2 \
253+
&& printf "Create entry point script to automatically load KOS environment...$NL" \
254254
&& printf '#!/bin/bash\n. /opt/toolchains/dc/kos/environ.sh\nexec "$@"' > /usr/local/bin/entry.sh \
255255
&& chmod a+x /usr/local/bin/entry.sh \
256-
&& printf "Done.\n" >&2
256+
&& printf "Done.\n"
257257

258258
# Default to /src directory
259259
WORKDIR /src

0 commit comments

Comments
 (0)