Skip to content

Conversation

@spookyvision
Copy link
Contributor

No description provided.

Copy link
Owner

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

It feels quite weird to me that we have to do this, since this code should never actually be built for a MacOS target: the decl_test! macro is only used in code that goes into the Mycelium kernel, which should always be built with target_os = "none".

So, perhaps we could simplify this to just:

#[cfg_attr(target_os = "none", link_section = "MyceliumTests")]

to avoid emitting the attribute at all when not building a Mycelium kernel image?

With that said, if the current code fixes the build on MacOS dev machines, I'm fine with it either way!

BTW, I believe this fixes issue #393, so let's add that to the commit message before merging!

@hawkw
Copy link
Owner

hawkw commented Aug 11, 2024

So, perhaps we could simplify this to just:

#[cfg_attr(target_os = "none", link_section = "MyceliumTests")]

to avoid emitting the attribute at all when not building a Mycelium kernel image?

I don't actually know whether this will work or not, FWIW. If the macOS linker is involved even when linking cross-compiled builds for x86_64-unknown-none, we might have to placate it like this anyway? Up to you if you want to investigate whether we can get away with just not having the attribute.

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.

2 participants