-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed legacy toolchain from default devshell #55
Conversation
The lowrisc-it legacy toolchain only supports linux so removed it from the default environment so macos users can use default environment. Made a new `env-with-everything` environment that includes everything (and therefore only supports linux).
You will now have to build the legacy component seperately with: ```sh xmake -P examples/automotive/legacy ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am now able to enter the nix build environment on my Intel Mac!
Before merging this PR can you fix the automotive build? I'm not able to reproduce this on my Linux machine.
This is the error I see:
error: ld.lld: error: undefined symbol: __export_mem_pwm
>>> referenced by __cpp_automotive_common.c.c
>>> ../build/cheriot/cheriot/release/automotive_receive.compartment:()
>>> referenced by __cpp_automotive_common.c.c
>>> ../build/cheriot/cheriot/release/automotive_receive.compartment:()
ld.lld: error: undefined symbol: __export_mem_pwm_end
>>> referenced by __cpp_automotive_common.c.c
>>> ../build/cheriot/cheriot/release/automotive_receive.compartment:()
On Linux, the LD that is available in the Nix store is GNU ld version 2.41. On Macos it also has an LD in the Nix store but I think it's a Mac specific one, it states it's ld64-609 and supports lots of arm and X86 architectures including one labelled as tvOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Git clean fixed the issue I mentioned earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work well, just a couple of comments (albeit it's already merged, so maybe address in a separate PR if you agree?)
## Building | ||
|
||
The cheriot componenents of this demo are built along with the rest of the examples. | ||
However, the legacy component needs to be build seperately. | ||
|
||
```sh | ||
xmake -P examples | ||
xmake -P examples/automotive/legacy/ | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is merged already so it is fine, but I would like to see a comment here mentioning that the xmake -P examples/automotive/legacy
command needs to be run in the .#env-with-everything
Nix environment, as otherwise unsuspecting users who try and build the demo will get errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point thanks alex
env-with-everything = pkgs.mkShell { | ||
name = "sonata-sw-with-everything"; | ||
packages = env-with-sim.nativeBuildInputs ++ [lrPkgs.lowrisc-toolchain-gcc-rv32imcb]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me, but would it be possible to just have a legacy
environment or equivalent that does not include the simulator build? It its quite a lengthy process to build the sim, and as far as I'm aware this isn't needed to build legacy baremetal software.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to avoid having too many environments, so I thought I'd make a catchall everything environment. But I suppose people can always overlay environments, open to changing
The lowrisc-nix legacy toolchain only supports linux so removed it from the default environment so macos users can use default environment. Made a new
env-with-everything
environment that includes everything (and therefore only supports linux).legacy toolchain added in 12c4b69#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0L41