-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Arduino IDE doesn't Compile on MacBook Pro M1 Pro #6269
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
Comments
Does the current release (v2.0.2) compile? |
Same error message with 2.0.0-rc3-nightly-20220212 |
I have the identical problem. Same macOS build. V 2 ide doesn’t work for me either. Tested with Blink sketch to troubleshoot and same error |
I am also on M1 Mac and have no issues with either IDE. Please do not report issues for 1.0.6 anymore. We have moved away from that and support 2.0.2 or higher. Als o the error above mentions |
Getting more complex than me! Does this mean reinstalling my macOS? Already uninstalled and reinstalled both versions of the Arduino IDE to no avail |
Sorry - you're right, thank you! Just installed ver 2 IDE on my MacBook (old silicon but same os), worked perfectly, if you have no problems on M1 then i need to reinstall my OS that's all that's left I guess. Appreciate the push in the right direction. |
maybe just remove |
I don't even have the folder |
I'm in just the same place, same nonexistent file and directories. I'm told they're ghost files (but not by anyone reliable) I've gone into the hidden directories and folders, and code right out again none the wiser. But - it ran right away on my MacBook (exactly the same build of OS but old silicon, me-no-dev is saying his runs on silicon, nothing else left than a messed up environment I think. - So, rather than understand the incomprehensible I''m going to do a reinstall, just waiting for it to back up. I can do primitive linux for a raspeberry pi, but this looks way more difficult to me. If you have the luxury of a reinstall maybe try it? |
generally I do not expect something on the host to be able mess up the compilation. @igrr any clues? Could |
Overconfident, a simple reinstall made no difference. The delete and install option is going to take too much out that I want to keep. Maybe I'll just use my MacBook, frustrating though,, better to understand. |
Jumping in, is https://github.com/tpoechtrager/osxcross related to this
problem?
David
…On Tue, Feb 15, 2022 at 10:21 AM philat7 ***@***.***> wrote:
Overconfident, a simple reinstall made no difference. The delete and
install option is going to take too much out that I want to keep. Maybe
I'll just use my MacBook, frustrating though,, better to understand.
—
Reply to this email directly, view it on GitHub
<#6269 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEDQSVX2YWWU7TRF4FKSMDU3KKQVANCNFSM5OG6NM7Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
That looks like the problem exactly. The fix looks a bit complex for those like me not very used to Terminal emulator but from a quick read instructions appear very precise and full. Will look properly in next day or two and try it. |
I have this same issue on a x86 MacOS 12.3 Beta (21E5206e). Running otool over liblto_plugin.0.so shows that it explicitly links to osxcross for whatever reason:
Theoretically the missing library should have always made it fail so it seems like something is triggering the lto plugin to be used when it wasn't previously. A workaround that seems to work fine for me is installing gcc from Homebrew, creating the osxcross path and copying libstdc++.6.dylib:
Edit: I should also add that libstdc++.6.dylib didn't already exist anywhere else on the filesystem. |
If lto is generating the problem you have to use a ar and ranlib which has lto plugin supplied. This is achieved easiest by using the gcc-* equivalents (included in the provided espressif toolchains) |
After I did that, the error message is now
|
@Jason2866 In my case, I'm using PlatformIO to build so have limited control over the build process. This previously worked fine until something changed, trying to work out if it's MacOS, PIO or arduino-esp32 related - guessing MacOS. @kilian0304 Ah, Homebrew gcc must be x86 only then, you'll need a arm64 gcc package. |
I can reproduce this with the Arduino IDE as well. Another workaround that works for both x86 and M1/arm64 is to edit platform.txt ( Note that I have no idea what the impact of not using the LTO plugin has on runtime/performance/stability/etc. but it seems to work fine for me. You'll also need to follow #4717 if you haven't already done so to move from python2 to python3. |
@llamaonaskateboard For Platformio it is even easier. Just do as described here platformio/platform-espressif32#702
|
Ah ha, The same applies to the Arduino IDE as I just noticed my Boards Manager URL was set to https://dl.espressif.com/dl/package_esp32_index.json which only has up to 1.0.6. @Jason2866 I just tried your platform package and although I got a tonne of ranlib warnings with the same liblto_plugin/libstdc++ message, it built successfully.
|
@llamaonaskateboard the thing is that I am using M1 Max machine (and M1 before that) and do not have any issues compiling for any of our chips. All flags that you see in PIO's scripts or platform.txt are automatically extracted from ESP-IDF's build. |
@llamaonaskateboard i will not upgrade to MacOS 12.3 as long it is beta. |
Just running the xtensa-esp32-elf-g++ linker produces the error:
As a test, I tried changing the dylib path inside the LTO plugin from absolute to relative using I found this - https://openradar.appspot.com/FB9725981 - which might be related and sounds like maybe 12.3 beta "fixed" the behaviour or did something else entirely that's not mentioned in release notes relating to dlopen/dylibs and paths. Side note, libstdc++ is actually deprecated and replaced with libc++ on MacOS as per https://developer.apple.com/forums/thread/113746 so it might be worth looking at updating the toolchain build process regardless. |
After I uninstalled the "normal" gcc and installed the gcc-arm-embedded my error message is:
I have no clue |
same here.
true, but |
@kilian0304 @gretel I think I misread your error message and got it around the wrong way, you want an x86 libstdc++ not arm64. I don't have a M1 so can't test. If homebrew won't provide it then search around or copy off a x86 Mac. See my other comments above, there's other options:
@gretel Fair but it probably makes sense for packages for multiple platforms to utilise the available libraries for the platform. Edit: Added PIO platform option |
@llamaonaskateboard thanks! but..
extra_scripts =
pre:disable_lto.py
Import("env")
env.Append(
LINKFLAGS=[
"-fno-use-linker-plugin",
]
) |
@gretel That also works. In another of my comments above there’s a |
thanks again; working on an upstream so trying to be less intrusive as possible - keep the |
Updated to release MacOS 12.3 and it compiles without any error with my custom Platformio setup for Tasmota
|
Thanks. Compiled successfully |
I'm closing this issue as you found a solution, labelling to be used For reference. |
I can also confirm that everything is fine on the release MacOS 12.3 after reversing the workarounds. |
Board
ESP32 Dev Module; all from Espressif
Device Description
Nothing, just the Dev Module
Hardware Configuration
Nothing, just the Dev Module
Version
v1.8.19
IDE Name
Arduino IDE
Operating System
macOS 12.3 Beta
Flash frequency
80Mhz
PSRAM enabled
no
Upload speed
11520
Description
It doesn't Compile for my ESP32 Dev Module. For the official integrated boards from Arduino it compiles normal
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: