Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

"The native link step failed" error. Can't build on any platforms.

Discussion in 'Editor & General Support' started by modestfool, Feb 8, 2021.

  1. modestfool

    modestfool

    Joined:
    Aug 14, 2016
    Posts:
    11
    So I've downloaded a project from a repo but I can't build it. I get a Burst error but I think it's related to X code:

    Code (CSharp):
    1. BuildFailedException: Burst compiler (1.2.3) failed running
    2.  
    3. stdout:
    4. The native link step failed. Check previous exception in the log - linker command line : "xcrun --sdk macosx ld -macosx_version_min 10.8 -o "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated.bundle" -dylib "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_1.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_3.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_2.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_0.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_5.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_7.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_4.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_6.o" "/var/folders/q7/rx2yvsj93h97jtfn40w9ykh80000gn/T/burst-aotg4msfkr9.gvu/lib_burst_generated_part_8.o" -lc -lm"
    5. stderr:
    6. ld: library not found for -lc
    I'm working on a Mac with Big Sur 11.1. I recently reinstalled Xcode and Command Line Tools and made sure they were located in the Developers folder following this thread: https://apple.stackexchange.com/que...e-developer-path-when-attempting-to-use-git-a

    I'm on Unity 3.14 and Burst 1.2.3. Other projects build just fine, but there's something in this one mucking things up. I've tried some of the Burst suggestions and clicked and unchecked the External Tools boxes. I've reinstalled and restarted everything multiple times. I even had my friend try building it on a Mac without Big Sur and it went fine.

    Please help. Thanks!
     
  2. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    111
    Burst 1.2.3 is no longer supported (and is from before Big Sur was released). Fortunately, burst can be upgraded to 1.4.4 via the package manager and this should should fix the issue.
     
  3. modestfool

    modestfool

    Joined:
    Aug 14, 2016
    Posts:
    11
    Thanks for writing back Lee! I did try using that version but it ended up giving me even more errors. As follows:

    Code (CSharp):
    1. /bin/sh: /Users/jonathanahern/Desktop/ABCD-word-game-master/Library/PackageCache/com.unity.burst@1.4.4/.Runtime/hostlin/lld: cannot execute binary file
    2.  
    Code (CSharp):
    1. Burst.Compiler.IL.Aot.AotLinkerException: The native link step failed. Check previous exception in the log - linker command line : "/Users/jonathanahern/Desktop/ABCD-word-game-master/Library/PackageCache/com.unity.burst@1.4.4/.Runtime/hostlin/lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -sdk_version 10.9 -r -dylib -o "/Users/jonathanahern/Desktop/ABCD-word-game-master/Temp/Burst/burst-aothyv4magb.4pz/lib_burst_generated.bundle" "/Users/jonathanahern/Desktop/ABCD-word-game-master/Library/PackageCache/com.unity.burst@1.4.4/.Runtime/libs/burstRTL_m64.a
    2.  
    Code (CSharp):
    1. [ERROR] FATAL UNHANDLED EXCEPTION: Burst.Compiler.IL.Aot.AotLinkerException: The native link step failed. Check previous exception in the log - linker command line : "/Users/jonathanahern/Desktop/ABCD-word-game-master/Library/PackageCache/com.unity.burst@1.4.4/.Runtime/hostlin/lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -sdk_version 10.9 -r -dylib -o "/Users/jonathanahern/Desktop/ABCD-word-game-master/Temp/Burst/burst-aothyv4magb.4pz/lib_burst_generated.bundle" "/Users/jonathanahern/Desktop/ABCD-word-game-master/Library/PackageCache/com.unity.burst@1.4.4/.Runtime/libs/burstRTL_m64.a" "/Users/jonathanahern/Desktop/ABCD-word-game-master/Temp/Burst/burst-aothyv4magb.4pz/lib_burst_generated_part_1.o"
    Code (CSharp):
    1. BuildFailedException: Burst compiler (1.4.4) failed running
    2.  
    3. stdout:
    4. stderr:
    5. /bin/sh: /Users/jonathanahern/Desktop/ABCD-word-game-master/Library/PackageCache/com.unity.burst@1.4.4/.Runtime/hostlin/lld: cannot execute binary file
    6.  
    7. Unhandled Exception:
    8. Burst.Compiler.IL.Aot.AotLinkerException: The native link step failed. Check previous exception in the log - linker command line : "/Users/jonathanahern/Desktop/ABCD-word-game-master/Library/PackageCache/com.unity.burst@1.4.4/.Runtime/hostlin/lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -sdk_version 10.9 -r -dylib -o "/Users/jonathanahern/Desktop/ABCD-word-game-master/Temp/Burst/burst-aothyv4magb.4pz/lib_burst_generated.bundle"
    Any help is greatly appreciated!
     
  4. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    111
    Ah, this is a bug in the Unity Editor with Big Sur which causes burst to think its running on Linux rather than Mac OS.

    You will need to upgrade your unity version to 2019.4.19f1 LTS as the issue was resolved at some point, but I can't remember the exact 2019.4 that contains the fix.
     
  5. modestfool

    modestfool

    Joined:
    Aug 14, 2016
    Posts:
    11
    The good news is that it worked! The bad news is that it made the IAP inoperable. Thank you.
     
  6. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    43
    @Lee_Hammerton do you know of any workarounds for this issue in Unity 2019.2? The thing is that we (like many others) are stuck on Unity 2019.2 since we're doing kids games and about 10% of our user base are stil using older iOS9 devices like the iPad2, so we cannot really update to anything higher than Unity 2019.2.21f1 at the moment.
     
  7. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    111
    Unfortunately the bug here is in the Unity application, (where it thinks its running on linux).

    You could try setting the environment variable :

    UNITY_BURST_USE_DESKTOP_NATIVE_LINKERS = 1

    then restart unity with that environment variable in place.. though this is untested and might not work.

    otherwise (slightly hackier way) :

    The other unsupported suggestion I can make :
    close unity.
    MOVE the burst package folder from the package cache to the Packages folder. (this is so modifications can be made without unity restoring them on restart). Then rename the hostlin folder to hostlin_ , then rename the hostmac folder to hostlin.
     
  8. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    43
    Thanks for the suggestions! The first one didn't work unfortunately. As for the second suggestion, it fails at another stage where the NDK is failing to find the correct linker
    Unable to find valid linker at '/Users/Shared/Android/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang'
    . So I guess there are more places in the build process that fails due to the fact that the editor thinks it's running on Linux.
     
  9. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,165
    Yeah as a next step you could swap the linux-x86_64 and darwin-x86_64 directories in the NDK, and there are likely few more in the NDK. (As Lee said, it's unsupported anyway, just trying to unblock you)