GithubHelp home page GithubHelp logo

toolchains's Introduction

Nerves Toolchains

This is an umbrella project for all of the Nerves toolchains.

See the subdirectories for the actual toolchains and the nerves_toolchain_ctng directory for the build scripts.

Installation

See nerves_toolchain_ctng/README.md for preparing your system for building the toolchains.

Building

The normal procedure is to run ./build_release.sh to build everything or go to one of the toolchain subdirectories to build the toolchain. This process uses mix. Sometimes bringing in Elixir obfuscates the build process. To build manually, run something like:

./nerves_toolchain_ctng/build.sh nerves_toolchain_arm_nerves_linux_gnueabihf/defconfig work

This will build the toolchain in the work directory. If you want to modify the configuration, you can do it via Crosstool-ng's menuconfig:

<CTRL-C> out of a running build or "killall make", etc.

$ cd work/build
$ ../usr/bin/ct-ng menuconfig

# make modifications

$ ../usr/bin/ct-ng savedefconfig

# merge defconfig changes over to
# nerves_toolchain_arm_nerves_linux_gnueabihf/defconfig or whatever you're
# building. Some configuration options are platform-specific and should be put
# in nerves_toolchain_ctng/defaults/<platform>

64-bit ARM Builds

It's possible to create cross-compilers for 64-bit ARM machines (aarch64) by building the toolchains on a 64-bit ARM machine. Canadian cross builds don't seem to work. Build as you would on an x86_64 Linux machine.

NOTE: "aarch64 for Darwin" is called arm64. They're slightly different. See the gcc arm64 port.

Canadian cross builds for Raspberry Pi (arm)

It's possible to build a toolchain that runs on the Raspberry Pi on x86 Linux. This is called a Canadian-cross. To do so, first clone the Raspberry Pi cross-toolchain:

git clone git://github.com/raspberrypi/tools.git

Then run a toolchain build as follows:

export HOST_OS=linux
export HOST_ARCH=arm
export PATH=<path to tools>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
./nerves_toolchain_ctng/build.sh <toolchain/defconfig> <build_dir>

Canadian cross builds for Windows

sudo apt install g++-mingw-w64-x86-64

Then

export HOST_OS=mingw32
./nerves_toolchain_ctng/build.sh <toolchain/defconfig> <build_dir>

toolchains's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

toolchains's Issues

Build Linux aarch64 toolchains on CI

We currently manually build them. It looks like the toolchain Dockerfile works find on arm64, so it seems like it should be possible to get these to run on CircleCI.

Add documentation for how to create and use a custom toolchain

Currently, you need to be familiar with crosstool-ng and skim our build scripts to understand what happens to build a toolchain. It's not that complicated, but we should document our process so that others can create custom toolchains and submit improvements back to us.

Known use cases for people creating their own toolchains:

  1. Supporting a platform that we don't
  2. Switching C libraries (most of our toolchains use glibc, but musl is desirable for many people)
  3. Bumping the Linux kernel header version (some tools require headers from recent kernels)
  4. Bumping gcc (this is useful for C++ users, but can break old Linux kernels)

Remove toolchains for building on 32-bit ARM hosts

These were originally built to support people building Nerves firmware on the Raspberry Pi 3. I don't believe it was ever a good development experience since those machines were slow.

If you really want us to continue creating these, please let us know.

Support toolchains that run on Linux AARCH64

This would allow people with 64-bit ARM Linux machines to build natively. While we currently distribute toolchains for Apple M1 users, this would also allow them to build inside Docker.

aarch64 toolchain name is incorrect

Environment

  • Elixir version (elixir -v): not necessary
  • Nerves environment: not necessary

Current behavior

Inside the shell opened by mix nerves.system.shell and make

>>> toolchain-external-custom  Patching
>>> toolchain-external-custom  Configuring
Cannot execute cross-compiler '/home/.../custom_system/.nerves/artifacts/custom_system-portable-1.6.3/host/opt/ext-toolchain/bin/aarch64-unknown-linux-gnueabi-gcc'
package/pkg-generic.mk:219: recipe for target '/home/.../custom_system/.nerves/artifacts/custom_system-portable-1.6.3/build/toolchain-external-custom/.stamp_configured' failed
make[1]: *** [/home/.../custom_system/.nerves/artifacts/custom_system-portable-1.6.3/build/toolchain-external-custom/.stamp_configured] Error 1
Makefile:23: recipe for target '_all' failed
make: *** [_all] Error 2

Expected behavior

No errors when using the cross compiler

Notes

Seems that some toolchains have broken folder name nerves_toolchain_aarch64_unknown_linux_gnu instead of nerves_toolchain_aarch64_unknown_linux_gnueabi after renaming the bins mentioned in the error section all work ok! So... the problem is very simple I think but I am not sure if only rename the folder is sufficient to solve the problem so instead of open a pull-request I open this issue.

Name toolchains 'nerves' rather than 'unknown'

All of the toolchains are currently named <arch>_unknown_linux_<abi>. This is consistent with a lot of toolchains across the web, but doesn't indicate that we're the maintainers of them. Let's consider changing the unknown to nerves.

The ramifications of doing this is that we need to create new hex packages and update every Nerves system with the change. The system updates aren't particularly painful since the old version will continue to exist.

Please add gfortran for SciPy installation

Environment

  • Elixir version (elixir -v): 1.8.2
  • Nerves environment: (mix nerves.env --info)
|nerves_bootstrap| Environment Package List

  Pkg:         custom_rpi3
  Vsn:         1.7.2
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_system_br
  Vsn:         1.7.2
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_toolchain_arm_unknown_linux_gnueabihf
  Vsn:         1.1.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.5.0
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   target
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     target
  toolchain:  /home/johnbat26/.nerves/artifacts/nerves_toolchain_arm_unknown_linux_gnueabihf-linux_x86_64-1.1.0
  system:     /home/johnbat26/.nerves/artifacts/custom_rpi3-portable-1.7.2
  app:        /home/johnbat26/kingston/projects/IoT/custom_rpi3

I need gfortran for compile Scipy packages for RPI. Please add support for it to nerves toolchain.

>>> toolchain-external-custom  Configuring
/bin/sh: /home/johnbat26/kingston/projects/IoT/custom_rpi3/.nerves/artifacts/custom_rpi3-portable-1.7.2/host/opt/ext-toolchain/bin/arm-unknown-linux-gnueabihf-gfortran: There is no such file or directory.
Fortran support is selected but is not available in external toolchain

Cached toolchain depends on homebrew

Environment

  • Elixir version (elixir -v):
elixir -v
Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Elixir 1.13.3 (compiled with Erlang/OTP 24)
  • Nerves environment: (mix nerves.env --info)
|nerves_bootstrap| Environment Variable List
  target:     rpi3
  toolchain:  /Users/mathew.prokos/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_arm-1.5.0
  system:     /Users/mathew.prokos/.nerves/artifacts/nerves_system_rpi3-portable-1.18.4
  app:        .

|nerves_bootstrap| Loadpaths End
  • Additional information about your host
    Using nix on an aarch64-darwin machine to build a rpi3

Current behavior

Fails to run MIX_TARGET=rpi3 mix firmware

nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_arm-1.5.0/bin/armv7-nerves-linux-gnueabihf-gcc -c -I/Users/mathew.prokos/.nerves/artifacts/nerves_system_rpi3-portable-1.18.4/staging/usr/lib/erlang/erts-12.3/include -I/Users/mathew.prokos/.nerves/artifacts/nerves_system_rpi3-portable-1.18.4/staging/usr/lib/erlang/lib/erl_interface-5.2.1/include -mabi=aapcs-linux -mfpu=neon-vfpv4 -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=cortex-a53 -fPIE -pie -Wl,-z,now -Wl,-z,relro-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -O2 -I/Users/mathew.prokos/.nerves/artifacts/nerves_system_rpi3-portable-1.18.4/staging/usr/include -std=gnu99 -o /Users/mathew.prokos/projects/nerves/hello_nerves/_build/rpi3_dev/lib/nerves_runtime/obj/nerves_runtime.o src/nerves_runtime.c
dyld: Library not loaded: /opt/homebrew/opt/zstd/lib/libzstd.1.dylib
  Referenced from: /Users/mathew.prokos/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_arm-1.5.0/bin/../libexec/gcc/armv7-nerves-linux-gnueabihf/10.3.0/cc1

Using otool you can see the cached toolchain depends on homebrew. Ideally the build would either trigger a rebuild if the environment changes or it would be self contained to maximize reproducibility.

otool -L /Users/mathew.prokos/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_arm-1.5.0/bin/../libexec/gcc/armv7-nerves-linux-gnueabihf/10.3.0/cc1

/Users/mathew.prokos/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_arm-1.5.0/bin/../libexec/gcc/armv7-nerves-linux-gnueabihf/10.3.0/cc1:
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1853.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
	/opt/homebrew/opt/zstd/lib/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.0)

Expected behavior

nerves fimware is built

Support NVidia CUDA compilation with nvcc

Pelemay uses nvcc to generate CUDA code and would require it when targeting devices with NVidia GPUs (like the Jetson Nano)

The path to nvcc should be set in the NVCC environment variable.

Bump Linux kernel headers to 4.19

They're currently on Linux 4.14. As systems move to 5.4 and 5.10, Linux 4.14 is seeming old and it feels like time to bump them to the next LTS release.

I don't believe this affects any official Nerves systems.

Needs FreeBSD support

Let's use this issue to track support for my favorite unix-like OS. Many Linux distros are a pain in the butt to get modern versions of Erlang and Elixir. With FreeBSD ports system, it's a damned dream. Currently the build.sh script fails when invoked on a FreeBSD machine, let's fix it!

Back off Linux kernel header version to 4.4

Some devices run old Linux kernels and the version of the kernel used to build glibc here can its use.

One example is the NVIDIA Jetson. It runs a heavily patched version of Linux 4.9 which does not look productive to update. As such, it can't used the newer toolchains built here which include Linux 4.14 headers.

A less problematic issue is that crosstool-ng uses the latest 4.14 headers and they are almost always newer than what devices running 4.14 use. This means that to use a new toolchain on a 4.14 device, one first has to upgrade the Linux kernel to the latest patch release.

Including Linux kernel headers in toolchain releases seems wrong. I don't know the history. While it's clear that the kernel headers are needed for building the C library, it seems like any programs including kernel headers should match them to the kernel that's in use if at all possible.

At any rate, backing the kernel header version used to build the C library off to Linux 4.4 is what Bootlin does. That would fix the issue with the Jetson build. I'm not sure what's lost by going from 4.14 to 4.4. I can't imagine that it's much.

nerves_toolchain_armv6_nerves_linux_gnueabihf fails to build with lmsgpackc error

Environment

  • Elixir version: Elixir 1.16.1 (compiled with Erlang/OTP 26)
  • Nerves environment: fails to compile, never outputs
  • Additional information about your host, target hardware or environment that
    may help

Running on EndeavourOS (Arch-based) on Linux 6.8.5.

Current behavior

Changed the deps to feature:

      {:nerves_system_rpi0, "~> 1.24", runtime: false, targets: :rpi0, nerves: [compile: true]},
      {:nerves_toolchain_armv6_nerves_linux_gnueabihf, "~> 13.2.0", nerves: [compile: true]},

As I want to deploy to a Pi Zero. mix deps.get works, and then when I do

MIX_TARGET=rpi0 mix firmware

The toolchain build start and then fails with:

[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing binutils for host'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@377]
[ERROR]  >>        called from: do_binutils_backend[scripts/build/binutils/binutils.sh@218]
[ERROR]  >>        called from: do_binutils_for_host[scripts/build/binutils/binutils.sh@70]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@708]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      https://crosstool-ng.github.io/docs/known-issues/
[ERROR]  >>
[ERROR]  >> NOTE: Your configuration includes features marked EXPERIMENTAL.
[ERROR]  >> Before submitting a bug report, try to reproduce it without enabling
[ERROR]  >> any experimental features. Otherwise, you'll need to debug it
[ERROR]  >> and present an explanation why it is a bug in crosstool-NG - or
[ERROR]  >> preferably, a fix.
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]  
[ERROR]  (elapsed: 2:13.72)

The build log shows:


(lots of other lines...)

[ALL  ]      CCLD     nm-new
[ALL  ]    /usr/bin/ld: ../bfd/.libs/libbfd.a(plugin.o): in function `try_load_plugin':
[ALL  ]    /tmp/ctng-work/armv6-nerves-linux-gnueabihf/src/binutils/bfd/plugin.c:355:(.text+0x7bb): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
[ALL  ]      CCLD     objcopy
[ALL  ]      CCLD     strip-new
[ALL  ]    /usr/bin/ld: /usr/bin/ld: ../bfd/.libs/libbfd.a(plugin.o): in function `try_load_plugin':
[ALL  ]    /tmp/ctng-work/armv6-nerves-linux-gnueabihf/src/binutils/bfd/plugin.c:355:(.text+0x7bb): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking../bfd/.libs/libbfd.a(plugin.o)
[ALL  ]    : in function `try_load_plugin':
[ALL  ]    /tmp/ctng-work/armv6-nerves-linux-gnueabihf/src/binutils/bfd/plugin.c:355:(.text+0x7bb): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
[ALL  ]      CCLD     objdump
[ALL  ]    /usr/bin/ld: /tmp/ctng-work/armv6-nerves-linux-gnueabihf/build/build-binutils-host-x86_64-build_pc-linux-gnu/bfd/.libs/libbfd.a(plugin.o): in function `try_load_plugin':
[ALL  ]    /tmp/ctng-work/armv6-nerves-linux-gnueabihf/src/binutils/bfd/plugin.c:355:(.text+0x7bb): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
[ALL  ]      CCLD     readelf
[ALL  ]    /usr/bin/ld: cannot find -lmsgpackc: No such file or directory
[ERROR]    collect2: error: ld returned 1 exit status
[ERROR]    make[5]: *** [Makefile:1055: readelf] Error 1

Expected behavior

Toolchain completes installation.

Thanks for any help

Improve architecture naming

The arm toolchain name here is the worst offender. It compiles for ARM v7 cores, but it's just called "arm".

If we get an opportunity to rename toolchains, fixing the ARM toolchain's name and any others would be good. The Bootlin toolchains at https://toolchains.bootlin.com/ have pretty good names and consistency with them would be nice.

version `CXXABI_1.3.9' not found

tried with ubuntu 14,16 and debian hm :(
happens when it compiles the dependencies
Raspberry PI 1
LOG:

/root/.nerves/artifacts/nerves_toolchain_armv6_rpi_linux_gnueabi-linux_x86_64-0.13.0/bin/armv6-rpi-linux-gnueabi-gcc -c -I/root/.nerves/artifacts/nerves_system_rpi-portable-0.20.0/staging/usr/lib/erlang/erts-9.2/include -I/root/.nerves/artifacts/nerves_system_rpi-portable-0.20.0/staging/usr/lib/erlang/lib/erl_interface-3.10.1/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -I/root/.nerves/artifacts/nerves_system_rpi-portable-0.20.0/staging/usr/include -std=gnu99 -o src/uevent.o src/uevent.c
/root/.nerves/artifacts/nerves_toolchain_armv6_rpi_linux_gnueabi-linux_x86_64-0.13.0/bin/armv6-rpi-linux-gnueabi-gcc: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /root/.nerves/artifacts/nerves_toolchain_armv6_rpi_linux_gnueabi-linux_x86_64-0.13.0/bin/armv6-rpi-linux-gnueabi-gcc)
Makefile:66: recipe for target 'src/uevent.o' faile

An error when Apple Silicon M1 Mac ARM mode

Environment

  • Elixir version (elixir -v):
% elixir -v
Erlang/OTP 23 [erts-11.1.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Elixir 1.11.2 (compiled with Erlang/OTP 23)
  • Nerves environment: (mix nerves.env --info)
% mix nerves.env --info 
==> nerves
==> hello_nerves
|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_br
  Vsn:         1.13.4
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_system_rpi3
  Vsn:         1.13.1
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Docker, []}

  Pkg:         nerves_toolchain_arm_unknown_linux_gnueabihf
  Vsn:         1.3.2
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.7.2
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   rpi3
  MIX_ENV:      dev

NERVES_TOOLCHAIN is set to a path which does not exist:
/Users/zacky/.nerves/artifacts/nerves_toolchain_arm_unknown_linux_gnueabihf-darwin_arm-1.3.2

Try running `mix deps.get` to see if this resolves the issue by
downloading the missing artifact.
  • Additional information about your host, target hardware or environment that
    may help
% mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  dns 2.2.0
  elixir_make 0.6.1 RETIRED!
    (invalid) Wrong permissions on the mix.exs file
  gen_state_machine 2.1.0
  mdns_lite 0.6.6
  muontrap 0.6.0
  nerves 1.7.0
  nerves_pack 0.4.1
  nerves_runtime 0.11.3
  nerves_ssh 0.2.1
  nerves_system_bbb 2.8.1
  nerves_system_br 1.13.4
  nerves_system_osd32mp1 0.4.1
  nerves_system_rpi 1.13.1
  nerves_system_rpi0 1.13.1
  nerves_system_rpi2 1.13.1
  nerves_system_rpi3 1.13.1
  nerves_system_rpi3a 1.13.1
  nerves_system_rpi4 1.13.1
  nerves_system_x86_64 1.13.2
  nerves_time 0.4.2
  nerves_toolchain_aarch64_unknown_linux_gnu 1.3.2
  nerves_toolchain_arm_unknown_linux_gnueabihf 1.3.2
  nerves_toolchain_armv6_rpi_linux_gnueabi 1.3.2
  nerves_toolchain_ctng 1.7.2
  nerves_toolchain_x86_64_unknown_linux_musl 1.3.2
  one_dhcpd 0.2.5
  ring_logger 0.8.1
  shoehorn 0.7.0
  socket 0.3.13
  ssh_subsystem_fwup 0.5.1
  system_registry 0.8.2
  toolshed 0.2.17
  uboot_env 0.3.0
  vintage_net 0.9.2
  vintage_net_direct 0.9.0
  vintage_net_ethernet 0.9.0
  vintage_net_wifi 0.9.1
All dependencies are up to date

Nerves environment
  MIX_TARGET:   rpi3
  MIX_ENV:      dev

==> nerves
==> hello_nerves
Resolving Nerves artifacts...
  Cached nerves_system_rpi3
  Resolving nerves_toolchain_arm_unknown_linux_gnueabihf
  => Trying https://github.com/nerves-project/toolchains/releases/download/v1.3.2/nerves_toolchain_arm_unknown_linux_gnueabihf-darwin_arm-1.3.2-E31F29C.tar.xz
     Status 404 Not Found
  => Trying https://github.com/nerves-project/toolchains/releases/download/v1.3.2/nerves_toolchain_arm_unknown_linux_gnueabihf-darwin_arm-1.3.2-E31F29C118CD1588D6601EC53198E1D06324B68A563B5886D6989B66E6C408EC.tar.xz
     Status 404 Not Found
  => no_result

Current behavior

Include errors, stacktraces, screenshots or code that may help us reproduce the
issue.

When mix deps.get:

% mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  dns 2.2.0
  elixir_make 0.6.1 RETIRED!
    (invalid) Wrong permissions on the mix.exs file
  gen_state_machine 2.1.0
  mdns_lite 0.6.6
  muontrap 0.6.0
  nerves 1.7.0
  nerves_pack 0.4.1
  nerves_runtime 0.11.3
  nerves_ssh 0.2.1
  nerves_system_bbb 2.8.1
  nerves_system_br 1.13.4
  nerves_system_osd32mp1 0.4.1
  nerves_system_rpi 1.13.1
  nerves_system_rpi0 1.13.1
  nerves_system_rpi2 1.13.1
  nerves_system_rpi3 1.13.1
  nerves_system_rpi3a 1.13.1
  nerves_system_rpi4 1.13.1
  nerves_system_x86_64 1.13.2
  nerves_time 0.4.2
  nerves_toolchain_aarch64_unknown_linux_gnu 1.3.2
  nerves_toolchain_arm_unknown_linux_gnueabihf 1.3.2
  nerves_toolchain_armv6_rpi_linux_gnueabi 1.3.2
  nerves_toolchain_ctng 1.7.2
  nerves_toolchain_x86_64_unknown_linux_musl 1.3.2
  one_dhcpd 0.2.5
  ring_logger 0.8.1
  shoehorn 0.7.0
  socket 0.3.13
  ssh_subsystem_fwup 0.5.1
  system_registry 0.8.2
  toolshed 0.2.17
  uboot_env 0.3.0
  vintage_net 0.9.2
  vintage_net_direct 0.9.0
  vintage_net_ethernet 0.9.0
  vintage_net_wifi 0.9.1
All dependencies are up to date

Nerves environment
  MIX_TARGET:   rpi3
  MIX_ENV:      dev

==> nerves
==> hello_nerves
Resolving Nerves artifacts...
  Cached nerves_system_rpi3
  Resolving nerves_toolchain_arm_unknown_linux_gnueabihf
  => Trying https://github.com/nerves-project/toolchains/releases/download/v1.3.2/nerves_toolchain_arm_unknown_linux_gnueabihf-darwin_arm-1.3.2-E31F29C.tar.xz
     Status 404 Not Found
  => Trying https://github.com/nerves-project/toolchains/releases/download/v1.3.2/nerves_toolchain_arm_unknown_linux_gnueabihf-darwin_arm-1.3.2-E31F29C118CD1588D6601EC53198E1D06324B68A563B5886D6989B66E6C408EC.tar.xz
     Status 404 Not Found
  => no_result

Expected behavior

No error occurs.

OS X Toolchain no longer works on High Sierra

After upgrading to latest nerves I can no longer compile on my OS X host.

Environment

$ elixir -v
Erlang/OTP 22 [erts-10.7] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.10.2 (compiled with Erlang/OTP 22)

$ mix nerves.env --info
|nerves_bootstrap| Environment Package List

No packages found
|nerves_bootstrap| Loadpaths Start

Nerves environment
MIX_TARGET: host
MIX_ENV: dev

NERVES_SYSTEM is unset
NERVES_TOOLCHAIN is unset
|nerves_bootstrap| Environment Variable List
target: host
toolchain: unset
system: unset
app: /Users/jbf/src/minimal_nerves

|nerves_bootstrap| Loadpaths End

  • Additional information about your host, target hardware or environment that
    may help

$ uname -a
Darwin Joels-iMac 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

High Sierra 10.13.6

Current behavior

$ MIX_TARGET=rpi0 mix firmware

Nerves environment
MIX_TARGET: rpi0
MIX_ENV: dev

==> nerves_runtime
mkdir -p /Users/jbf/src/minimal_nerves/_build/rpi0_dev/lib/nerves_runtime/obj
mkdir -p /Users/jbf/src/minimal_nerves/_build/rpi0_dev/lib/nerves_runtime/priv
/Users/jbf/.nerves/artifacts/nerves_toolchain_armv6_rpi_linux_gnueabi-darwin_x86_64-1.3.1/bin/armv6-rpi-linux-gnueabi-gcc -c -I/Users/jbf/.nerves/artifacts/nerves_system_rpi0-portable-1.11.0/staging/usr/lib/erlang/erts-10.6.4/include -I/Users/jbf/.nerves/artifacts/nerves_system_rpi0-portable-1.11.0/staging/usr/lib/erlang/lib/erl_interface-3.13.1/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -I/Users/jbf/.nerves/artifacts/nerves_system_rpi0-portable-1.11.0/staging/usr/include -std=gnu99 -o /Users/jbf/src/minimal_nerves/_build/rpi0_dev/lib/nerves_runtime/obj/nerves_runtime.o src/nerves_runtime.c
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from: /Users/jbf/.nerves/artifacts/nerves_toolchain_armv6_rpi_linux_gnueabi-darwin_x86_64-1.3.1/bin/armv6-rpi-linux-gnueabi-gcc (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ____chkstk_darwin
Referenced from: /Users/jbf/.nerves/artifacts/nerves_toolchain_armv6_rpi_linux_gnueabi-darwin_x86_64-1.3.1/bin/armv6-rpi-linux-gnueabi-gcc (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib

make: *** [/Users/jbf/src/minimal_nerves/_build/rpi0_dev/lib/nerves_runtime/obj/nerves_runtime.o] Abort trap: 6
could not compile dependency :nerves_runtime, "mix compile" failed. You can recompile this dependency with "mix deps.compile nerves_runtime", update it with "mix deps.update nerves_runtime" or clean it with "mix deps.clean nerves_runtime"
==> minimal_nerves
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.

Expected behavior

A compiled project

`mix firmware` fails on Nix due to hardcoded lib paths

Environment

  • Elixir version (elixir -v):
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]

Elixir 1.14.4 (compiled with Erlang/OTP 25)
  • Nerves environment: (mix nerves.env --info)
==> nerves
==> hello_nerves
|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_br
  Vsn:         1.22.5
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_system_x86_64
  Vsn:         1.22.2
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Docker, [make_args: ["source", "all", "legal-info"]]}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.9.3
  Type:        toolchain_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_toolchain_x86_64_nerves_linux_musl
  Vsn:         1.8.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

|nerves_bootstrap| Loadpaths Start

|nerves_bootstrap| Precompile Start

==> nerves_toolchain_x86_64_nerves_linux_musl
|nerves_bootstrap| Compile.NervesPackage start

|nerves_bootstrap| Compile.NervesPackage end

==> nerves_system_x86_64
|nerves_bootstrap| Compile.NervesPackage start

|nerves_bootstrap| Compile.NervesPackage end

==> hello_nerves
|nerves_bootstrap| Precompile End


Nerves environment
  MIX_TARGET:   x86_64
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     x86_64
  toolchain:  /Users/d/.nerves/artifacts/nerves_toolchain_x86_64_nerves_linux_musl-darwin_x86_64-1.8.0
  system:     /Users/d/.nerves/artifacts/nerves_system_x86_64-portable-1.22.2
  app:        .

|nerves_bootstrap| Loadpaths End
  • Additional information about your host, target hardware or environment that
    may help
    macOS 11.7.7 using nix 2.13.3 for package management

Current behavior

CT_EXTRA_LDFLAGS_FOR_BUILD and CT_EXTRA_CFLAGS_FOR_BUILD are currently set to /usr/local/opt/... which might be incorrect, depending on user setup, e.g. on Nix. See

CT_EXTRA_LDFLAGS_FOR_BUILD="-L/usr/local/opt/gettext/lib -lintl"

Of course it could be hardcoded in other places as well.

This results in mix firmware being unable to compile dependencies, due to libraries being searched in an incorrect location

==> one_dhcpd
 CC arp_set.o
dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib

Expected behaviour

Buildscripts detect the correct location and firmware is built correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.