Skip to content

arm64e-apple-* target are producing "arm64e.old" objects, per Xcode's ld #80200

Closed
@glandium

Description

@glandium
% echo "int main() { return 0; }" > foo.c
% ./clang -o foo.o -c foo.c --target=arm64e-apple-darwin
% ./clang -o foo foo.o --target=arm64e-apple-darwin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-macosx_version_min has been renamed to -macos_version_min
ld: warning: ignoring file 'foo.o': found architecture 'arm64e.old', required architecture 'arm64e'
ld: Undefined symbols:
  _main, referenced from:
      <initial-undefines>
clang: error: linker command failed with exit code 1 (use -v to see invocation)

% otool -h foo.o
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedfacf 16777228          2  0x00           1     4        360 0x00002000
% /usr/bin/clang -o foo.o -c foo.c --target=arm64e-apple-darwin
% otool -h foo.o
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedfacf 16777228          2  0x80           1     4        360 0x00002000

I suppose the 0x80 caps is what indicates what Xcode clang produces is what ld calls "arm64e" vs. 0x00 indicating "arm64e.old".

Metadata

Metadata

Assignees

No one assigned

    Labels

    mcMachine (object) code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions