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
87e570ce
Commit
87e570ce
authored
4 years ago
by
test_nonet
Browse files
Options
Downloads
Patches
Plain Diff
try using wrapped gcc without prefix
parent
12450142
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
esp32-tools.nix
+4
-10
4 additions, 10 deletions
esp32-tools.nix
with
4 additions
and
10 deletions
esp32-tools.nix
+
4
−
10
View file @
87e570ce
...
...
@@ -3,17 +3,11 @@
let
srcs
=
import
./sources.nix
{
inherit
fetchFromGitHub
;
};
srcs2
=
import
./sources2.nix
{
inherit
fetchurl
fetchgit
fetchFromGitHub
;
};
wrapIt
=
pkg
:
runCommandLocal
"wrapped-gcc"
{
preferLocalBuild
=
true
;
allowSubstitutes
=
false
;
}
''
mkdir -p $out/bin
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.
# 1. We need a working compiler for build-build so we have to add it to depsBuildBuild and make sure that we are using it
# without prefix (because the one with prefix doesn't go through the wrapper script).
# 2. We must tell crosstool-NG that we are building a canadian cross.
canadian
=
stdenv
.
buildPlatform
!=
stdenv
.
hostPlatform
;
in
stdenv
.
mkDerivation
{
...
...
@@ -24,7 +18,7 @@ in stdenv.mkDerivation {
(
lib
.
attrsets
.
mapAttrsToList
(
name
:
drv
:
if
drv
?
outPath
then
"
${
name
}
${
drv
.
outPath
}
"
else
""
)
srcs2
);
buildInputs
=
[
ncurses
python3
];
depsBuildBuild
=
if
canadian
then
[
gcc
binutils
(
wrapIt
gcc
.
__spliced
.
buildBuild
)
]
else
[
];
depsBuildBuild
=
if
canadian
then
[
gcc
binutils
]
else
[
];
nativeBuildInputs
=
[
espressif-crosstool-ng
autoconf
automake
bison
flex
unzip
help2man
libtool
which
texinfo
file
wget
gnum4
perl
python3
]
++
[
breakpointHook
];
...
...
@@ -58,7 +52,7 @@ in stdenv.mkDerivation {
unset CT_CROSS
CT_CANADIAN=y
CT_BUILD="
${
stdenv
.
buildPlatform
.
config
}
"
CT_BUILD_PREFIX="
${
stdenv
.
buildPlatform
.
config
}
-wrapped-
"
CT_BUILD_PREFIX=""
CT_HOST="
${
stdenv
.
hostPlatform
.
config
}
"
CT_HOST_PREFIX="
${
stdenv
.
hostPlatform
.
config
}
-"
EOF
...
...
This diff is collapsed.
Click to expand it.
Mr. Snow Ball / projects
@snowball
mentioned in commit
1cfe804a
·
4 years ago
mentioned in commit
1cfe804a
mentioned in commit 1cfe804acf3d5034234bc13b64a40adf6fdc4746
Toggle commit list
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