Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
esp-idf-nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mr. Snow Ball / projects
esp-idf-nix
Commits
12450142
Commit
12450142
authored
4 years ago
by
test_nonet
Browse files
Options
Downloads
Patches
Plain Diff
clean up and add config for canadian cross builds
parent
4abbc8e6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
canadian.txt
+0
-15
0 additions, 15 deletions
canadian.txt
esp32-tools.nix
+21
-9
21 additions, 9 deletions
esp32-tools.nix
with
21 additions
and
24 deletions
canadian.txt
deleted
100644 → 0
+
0
−
15
View file @
4abbc8e6
CT_TOOLCHAIN_TYPE="canadian"
CT_BUILD="x86_64-unknown-linux-gnu"
#CT_BUILD_PREFIX="x86_64-unknown-linux-gnu-"
CT_BUILD_PREFIX="x86_64-unknown-linux-gnu-wrapped-"
CT_HOST="aarch64-unknown-linux-gnu"
CT_HOST_PREFIX="aarch64-unknown-linux-gnu-"
unset CT_CROSS
CT_CANADIAN=y
CT_HOST_SUFFIX=
#CT_CC_CORE_PASSES_NEEDED=y
#CT_CC_CORE_PASS_1_NEEDED=y
#CT_CC_GCC_STATIC_LIBSTDCXX=y
This diff is collapsed.
Click to expand it.
esp32-tools.nix
+
21
−
9
View file @
12450142
...
...
@@ -8,6 +8,14 @@ let
ln -s
${
pkg
}
/bin/gcc $out/bin/
${
pkg
.
stdenv
.
targetPlatform
.
config
}
-gcc
ln -s
${
pkg
}
/bin/gcc $out/bin/
${
pkg
.
stdenv
.
targetPlatform
.
config
}
-wrapped-gcc
''
;
# If Nix is cross-compiling this package, we have build!=host!=target (but Nix doesn't know about target, which is ESP32).
# This is called "canadian cross" for GCC builds and it needs some special care with crosstool-NG:
# 1. We need a working compiler for build-build. We cannot simply use the prefixed gcc name because that would
# directly go to the gcc binary and skip the wrapper script. We create a prefixed variant of the wrapper script
# with `wrapIt` and add this to depsBuildBuild.
# 2. We must tell crosstool-NG that we are building a canadian cross.
canadian
=
stdenv
.
buildPlatform
!=
stdenv
.
hostPlatform
;
in
stdenv
.
mkDerivation
{
pname
=
"espressif-esp32-tools"
;
inherit
(
srcs
)
version
srcs
;
...
...
@@ -16,10 +24,9 @@ in stdenv.mkDerivation {
(
lib
.
attrsets
.
mapAttrsToList
(
name
:
drv
:
if
drv
?
outPath
then
"
${
name
}
${
drv
.
outPath
}
"
else
""
)
srcs2
);
buildInputs
=
[
ncurses
python3
];
depsBuildBuild
=
[
gcc
binutils
(
wrapIt
gcc
.
__spliced
.
buildBuild
)
];
depsBuildBuild
=
if
canadian
then
[
gcc
binutils
(
wrapIt
gcc
.
__spliced
.
buildBuild
)
]
else
[
];
nativeBuildInputs
=
[
espressif-crosstool-ng
autoconf
automake
bison
flex
unzip
help2man
libtool
which
texinfo
file
wget
gnum4
perl
python3
]
++
[
breakpointHook
];
# ++ [ (wrapIt gcc.__spliced.buildTarget) ];
hardeningDisable
=
[
"format"
"pie"
];
...
...
@@ -45,13 +52,18 @@ in stdenv.mkDerivation {
echo "CT_LOCAL_TARBALLS_DIR=$PWD/tarballs" >>.config
echo "CT_FORBID_DOWNLOAD=y" >>.config
sed -nE 's/^(.*-)g?cc$/CT_BUILD_PREFIX="\1"/p' <<<"$OLD_CC" >>.config
''
;
#FIXME for cross-compiling
# cat ../../canadian.txt >>.config
# yes "" | ct-ng oldconfig
''
+
(
if
!
canadian
then
""
else
''
cat >>.config <<EOF
CT_TOOLCHAIN_TYPE="canadian"
unset CT_CROSS
CT_CANADIAN=y
CT_BUILD="
${
stdenv
.
buildPlatform
.
config
}
"
CT_BUILD_PREFIX="
${
stdenv
.
buildPlatform
.
config
}
-wrapped-"
CT_HOST="
${
stdenv
.
hostPlatform
.
config
}
"
CT_HOST_PREFIX="
${
stdenv
.
hostPlatform
.
config
}
-"
EOF
( yes "" || true ) | ct-ng oldconfig
''
);
buildPhase
=
''
export CT_USE_SOURCES_FROM_NIXOS=y
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment