below/HelloSilicon

Linking failing after installing Big Sur 11.0.1

jrosengarden opened this issue · 5 comments

Well...I'm back.....this time with a problem (self-inflicted wound?)

I've been moving merrily along through your "Hello Silicon" project...learning tons (and having a blast).
Along the way I've been keeping my "MWMNSA" up-to-date with the OS betas and the Xcode betas.

My problem started this morning when I (foolishly?) installed the publicly available version of Big Sur - 11.0.1

Now all my projects fail to compile/link successfully (actually the failure is during the link phase).
Here is a sample of the error I'm getting

jeffrosengarden@MacMiniDTK Chapter 4 % make case
ld -o case -lSystem -syslibroot xcrun -sdk macosx --show-sdk-path -e _start -arch arm64 case.o
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
ld: dynamic main executables must link with libSystem.dylib for architecture arm64
make: *** [case] Error 1

I'm not sure what to do here. Any help/advice would be greatly appreciated.

Thanks much!

below commented

I try to check all my files with new releases, and everything works as of 11.0.1 (20B29).

Something is weird in your output: The directory /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/ does not exist on my machine, here the it is /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk (Isn't it funny how Apple could not decide on a number for Big Sur?)

What does xcodebuild -version say for you?

The output from xcodebuild -version is:
Xcode 12.1.1
Build version 12A7605b

Not sure it matters but; I have both the "production" and the beta Xcode on my the "MWMNSA".
PRODUCTION: Build 12A7605B (v12.1.1)
BETA: Build 12C5020F (v12.3 beta)

The OS is (as I stated in the original text) is the production version of Big Sur (11.0.1). After the installation of the production version of Big Sur is when my problem began.

I've had both versions of Xcode installed all along so I'm not sure if this is relevant information.

Also - since I figured you'd eventually ask - here is the information on the version of the OS deployed:

System Software Overview:

System Version: macOS 11.0.1 (20B29)
Kernel Version: Darwin 20.1.0
Boot Volume: System
Boot Mode: Normal
Computer Name: MacMiniDTK
User Name: Jeff Rosengarden (jeffrosengarden)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 23:03

Thanks for responding...much appreciated!!!!

Aha! I've solved the issue:

For some reason the production Xcode (12.1.1, Build version 12A7605B) is missing the ARM64 architecture in libSystem.tbd.

But if I issue this command at the terminal:
sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

My system is now "pointing" to the Xcode-beta app (12.3, Build version 12C5020F).

The link command, in the various makefiles I've built while working with your HelloSilicon project, are all working again and building runnable executables.

So, bottom line: I think there is something wrong with the production version of Xcode (12.1.1, Build version 12A7605B). That's what my pea-brain is telling me!!!

Thanks again for responding to my communication. You are an ARM64 rock star!!!!!!

below commented

I am pretty sure it has nothing to do with the macOS version. As pointed out in my main text, you need Xcode 12.2 for all of the samples to work. Xcode 12.1 does not support the DTK.

You can keep both versions on your machine. But when building for the DTK, you need to tell the system that you want to use Xcode 12.2 in the command line. The way to do that is:

sudo xcode-select ${fullPathToXcode12}

By the way, Xcode 12.2 is out of Beta, so you might want to remove Xcode 12.1.

Let me know if that works

below commented

The answers overlapped apparently, glad you figured it out!

There is nothing "wrong" with Xcode 12.1: It simply does not support the ARM architecture on the Mac.

Thank you for your kind words, I am glad I can help someone!