-
Notifications
You must be signed in to change notification settings - Fork 84
LLVM error on High Sierra #74
Comments
Are you compiling the If that's the case we can drop the link_section when compiling for mac; trying to link a cortex-m program compiled for the host (mac / Linux) is going to fail anyway. |
I'm so sorry for wasting your time, I'm the biggest idiot. I forgot to set the default target in |
The cortex-m crate goes out of its way to build at least on Linux, would be nice if all the core crates consistently built on Linux, macOS, and Windows |
we ran into a similar issue in the |
Indeed, I've encountered it frequently. |
What does this fix do? It replaces section name with exactly the same but taking half a kilobyte more space in source code; am I missing something there? |
@berkus Not sure what you mean. What are you seeing and on which system? This is changing the section names for macOS only because it has a weird length restriction. It should not affect anything except to prevent linker errors on macOS. |
@therealprof ok, lets go with the way of example, shall we.
On macOS the section name would be So now you've reduced readability, understandability and maintainability of the code to provide exactly the same section names for every system out there. What am I missing? I could have missed something, to be precise am looking at this commit. Here it is, condensed:
|
Ahha, now I see the comma vs period, my bad! |
@therealprof btw, could it be using the comma on all systems, not only macos? |
Not sure sorry, I'm actually curious why this is supposed to work on macOS (NB: I haven't actually tested it myself). Maybe some internal linker magic to substitute the "." back? |
@therealprof on mac this is two names, ".vector_table" for the segment and "reset_vector" for the section name. I will test on linux if a section name with comma works, the ELF file format spec says why not so the only limiting factor would be linker's parser. |
We could probably just remove the |
310: Only emit link_section for cortex-m r=jonas-schievink a=adamgreig Previously we always emitted `link_section`, even though it only had an effect when our linker script was being used (and only made sense on cortex-m targets). This breaks building the code for a MacOS target, which is occasionally useful for running `cargo check` etc. In the macros crate we don't have the target information available, so instead we continue to emit `link_section` except specifically on MacOS. This keeps the fix from #306 but hopefully resolves the confusion in #74 (comment). Co-authored-by: Adam Greig <adam@adamgreig.com>
310: Only emit link_section for cortex-m r=jonas-schievink a=adamgreig Previously we always emitted `link_section`, even though it only had an effect when our linker script was being used (and only made sense on cortex-m targets). This breaks building the code for a MacOS target, which is occasionally useful for running `cargo check` etc. In the macros crate we don't have the target information available, so instead we continue to emit `link_section` except specifically on MacOS. This keeps the fix from #306 but hopefully resolves the confusion in rust-embedded/cortex-m-rt#74 (comment). Co-authored-by: Adam Greig <adam@adamgreig.com>
Building
cortex-m-rt
onnightly
,beta
andstable
in Mac OS High Sierra (tested on two machines) results in the following error:It build correctly on my Ubuntu 18.04 machine.
The text was updated successfully, but these errors were encountered: