-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add llvm-xtensa and ldc-xtensa images
- Loading branch information
1 parent
debcade
commit bab85d5
Showing
5 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{{< ldc/ldc-variables.php }} | ||
################### | ||
# imported images # | ||
################### | ||
|
||
FROM {{ $container_namespace }}/llvm-xtensa:{{ $dependencies['llvm-xtensa'] }}-{{ $base_image_alias }} AS llvm-imported | ||
{{# if ($isBootstrappedByLDC): }} | ||
FROM {{ $container_namespace }}/ldc:{{ $dependencies['ldc'] }}-{{ $base_image_alias }} AS ldc-bootstrap-imported | ||
{{# endif }} | ||
|
||
############### | ||
# build stage # | ||
############### | ||
|
||
{{< ldc/ldc-image-build-stage.containerfile }} | ||
|
||
{{# if ($isBootstrappedByLDC): }} | ||
|
||
################## | ||
# self bootstrap # | ||
################## | ||
|
||
{{< ldc/ldc-image-build-stage.containerfile }} | ||
{{# endif }} | ||
|
||
{{< common/make-dub.containerfile }} | ||
|
||
{{< common/make-d-tools.containerfile }} | ||
|
||
################ | ||
# export stage # | ||
################ | ||
|
||
{{# $buildStage = "build-stage-{$buildStageCounter}"; }} | ||
FROM {{ $base_image }} AS export-stage | ||
|
||
{{< common/prepare-runtime-environment.containerfile }} | ||
|
||
COPY --from={{ $buildStage }} /opt/ldc /opt/ldc | ||
|
||
{{< d-tools/install-d-tools.containerfile }} | ||
|
||
# Self-test | ||
COPY ./resources/helloworld.d /opt/helloworld.d | ||
RUN /opt/ldc/bin/ldmd2 -run /opt/helloworld.d | ||
RUN rm /opt/helloworld.d | ||
|
||
{{# if (isset($extras['dub'])): }} | ||
COPY --from={{ $buildStage }} /opt/build/dub/bin/dub /usr/bin/dub | ||
{{# endif }} | ||
|
||
{{< d-tools/install-d-tools.containerfile }} | ||
|
||
COPY ./templates/scripts/entrypoint-ldc.sh /usr/bin/entrypoint | ||
|
||
ENTRYPOINT [ "/usr/bin/entrypoint" ] | ||
CMD [ "/opt/ldc/bin/ldc2" ] |
7 changes: 7 additions & 0 deletions
7
templates/llvm-xtensa/download-llvm-xtensa-source.containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Download LLVM source | ||
|
||
{{# if (!isset($GIT_TAG)): }} | ||
!!! Error: $GIT_TAG is not set !!! | ||
{{# else: }} | ||
RUN curl -fLsSo llvm.tar.gz "https://github.com/espressif/llvm-project/archive/refs/tags/{{ $GIT_TAG }}.tar.gz" | ||
{{# endif }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
$LLVM_EXPERIMENTAL_TARGETS_TO_BUILD = "Xtensa" | ||
?> | ||
|
||
############### | ||
# build stage # | ||
############### | ||
|
||
FROM {{ $base_image }} AS build-stage | ||
|
||
WORKDIR /opt/build | ||
|
||
# Install dependencies | ||
{{< common/install-common-system-tools.containerfile }} | ||
{{< llvm/install-llvm-build-deps.containerfile }} | ||
|
||
# Download, build and install LLVM | ||
{{< llvm-xtensa/download-llvm-xtensa-source.containerfile }} | ||
{{< llvm/build-llvm.containerfile }} | ||
|
||
################ | ||
# export stage # | ||
################ | ||
|
||
FROM {{ $base_image }} AS export-stage | ||
|
||
COPY --from=build-stage /opt/llvm/ /opt/llvm/ | ||
|
||
CMD ["echo", "This image is not meant to be run. It only provides files located in /opt/llvm."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters