Skip to content
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

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

HU90m
Copy link
Member

@HU90m HU90m commented Oct 17, 2024

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

HU90m added 4 commits October 17, 2024 06:12
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
```
Copy link
Contributor

@marnovandermaas marnovandermaas left a 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.

Copy link
Contributor

@marnovandermaas marnovandermaas left a 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.

@marnovandermaas marnovandermaas merged commit 813f291 into lowRISC:main Oct 17, 2024
1 check passed
Copy link
Contributor

@AlexJones0 AlexJones0 left a 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?)

Comment on lines +36 to +44
## 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/
```
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point thanks alex

Comment on lines +193 to +196
env-with-everything = pkgs.mkShell {
name = "sonata-sw-with-everything";
packages = env-with-sim.nativeBuildInputs ++ [lrPkgs.lowrisc-toolchain-gcc-rv32imcb];
};
Copy link
Contributor

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.

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants