[MacPorts] #69812: /usr/bin/clang++ cannot compile anything when trying to compile as x86_64 on a current arm system against the MacOSX10.13.sdk
MacPorts
noreply at macports.org
Sun Jun 9 23:10:43 UTC 2024
#69812: /usr/bin/clang++ cannot compile anything when trying to compile as x86_64
on a current arm system against the MacOSX10.13.sdk
---------------------+--------------------
Reporter: lukaso | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: |
---------------------+--------------------
Comment (by kencu):
So it works to build and x86_64 binary building against the current SDK
and setting the deployment target to 10.13, but not when building against
the 10.13 SDK -- it is not finding the symbols in the libc++.tbd file in
the 10.13 SDK, for whatever reason I don't current get.
{{{
% MACOSX_DEPLOYMENT_TARGET=10.13 /usr/bin/clang++ -v -Wl,-v -pipe -Os
-target x86_64-apple-darwin17 hello.cpp
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin17
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
-cc1 -triple x86_64-apple-macosx10.13.0 -Wundef-prefix=TARGET_OS_
-Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror
=implicit-function-declaration -emit-obj --mrelax-relocations -disable-
free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names
-main-file-name hello.cpp -mrelocation-model pic -pic-level 2 -mframe-
pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math
-funwind-tables=2 -target-sdk-version=14.5 -fvisibility-inlines-hidden-
static-local-var -target-cpu penryn -tune-cpu generic -debugger-
tuning=lldb -target-linker-version 1053.12 -v -fcoverage-compilation-
dir=/Users/cunningh -resource-dir
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-I/usr/local/include -internal-isystem
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
-internal-isystem
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include
-internal-isystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include
-internal-externc-isystem
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-internal-externc-isystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
-Os -Wno-reorder-init-list -Wno-implicit-int-float-conversion
-Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt
-Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-
implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion
-Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-
constant -fdeprecated-macro -fdebug-compilation-dir=/Users/cunningh
-ferror-limit 19 -stack-protector 1 -mdarwin-stkchk-strong-link -fblocks
-fencode-extended-block-signature -fregister-global-dtors-with-atexit
-fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-
type-align=16 -fcommon -fcolor-diagnostics -vectorize-loops -vectorize-slp
-clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation
-fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding
-clang-vendor-feature=+revert09abecef7bbf -clang-vendor-
feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm
-disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o
/var/folders/97/nn3swcb52bg003_4bctdbyd80000gn/T/hello-38a142.o -x c++
hello.cpp
clang -cc1 version 15.0.0 (clang-1500.3.9.4) default target arm64-apple-
darwin23.5.0
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
(framework directory)
End of search list.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
-demangle -lto_library
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib
-dynamic -arch x86_64 -platform_version macos 10.13.0 14.5 -syslibroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-Os -o a.out -L/usr/local/lib -v
/var/folders/97/nn3swcb52bg003_4bctdbyd80000gn/T/hello-38a142.o -lc++
-lSystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld PROJECT:ld-1053.12
BUILD 10:15:51 Mar 29 2024
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386
x86_64 x86_64h armv6m armv7k armv7m armv7em
will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k
armv7m armv7em
LTO support using: LLVM version 15.0.0 (static support for 29, runtime is
29)
TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.3.2.2)
Library search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift
Framework search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
}}}
{{{
% MACOSX_DEPLOYMENT_TARGET=10.13 /usr/bin/clang++ -v -Wl,-v -pipe -Os
-target x86_64-apple-darwin17 -isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk hello.cpp
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin17
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
-cc1 -triple x86_64-apple-macosx10.13.0 -Wundef-prefix=TARGET_OS_
-Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror
=implicit-function-declaration -emit-obj --mrelax-relocations -disable-
free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names
-main-file-name hello.cpp -mrelocation-model pic -pic-level 2 -mframe-
pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math
-funwind-tables=2 -fcompatibility-qualified-id-block-type-checking
-fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu
generic -debugger-tuning=lldb -target-linker-version 1053.12 -v
-fcoverage-compilation-dir=/Users/cunningh -resource-dir
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk
-internal-isystem
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/include/c++/v1
-internal-isystem
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/local/include
-internal-isystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include
-internal-externc-isystem
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/include
-internal-externc-isystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
-Os -Wno-reorder-init-list -Wno-implicit-int-float-conversion
-Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt
-Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-
implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion
-Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-
constant -fdeprecated-macro -fdebug-compilation-dir=/Users/cunningh
-ferror-limit 19 -stack-protector 1 -mdarwin-stkchk-strong-link -fblocks
-fencode-extended-block-signature -fregister-global-dtors-with-atexit
-fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-
type-align=16 -fcommon -fcolor-diagnostics -vectorize-loops -vectorize-slp
-clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation
-fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding
-clang-vendor-feature=+revert09abecef7bbf -clang-vendor-
feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm
-disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o
/var/folders/97/nn3swcb52bg003_4bctdbyd80000gn/T/hello-e3c9c1.o -x c++
hello.cpp
clang -cc1 version 15.0.0 (clang-1500.3.9.4) default target arm64-apple-
darwin23.5.0
ignoring nonexistent directory
"/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/local/include"
ignoring nonexistent directory
"/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
(framework directory)
End of search list.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
-demangle -lto_library
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib
-dynamic -arch x86_64 -platform_version macos 10.13.0 10.13.0 -syslibroot
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -Os -o a.out -v
/var/folders/97/nn3swcb52bg003_4bctdbyd80000gn/T/hello-e3c9c1.o -lc++
-lSystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld PROJECT:ld-1053.12
BUILD 10:15:51 Mar 29 2024
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386
x86_64 x86_64h armv6m armv7k armv7m armv7em
will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k
armv7m armv7em
LTO support using: LLVM version 15.0.0 (static support for 29, runtime is
29)
TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.3.2.2)
Library search paths:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/lib
Framework search paths:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
Undefined symbols for architecture x86_64:
"std::ios_base::Init::Init()", referenced from:
__GLOBAL__sub_I_hello.cpp in hello-e3c9c1.o
"std::ios_base::Init::~Init()", referenced from:
__GLOBAL__sub_I_hello.cpp in hello-e3c9c1.o
"std::basic_ostream<char, std::char_traits<char>>&
std::__ostream_insert<char,
std::char_traits<char>>(std::basic_ostream<char, std::char_traits<char>>&,
char const*, long)", referenced from:
_main in hello-e3c9c1.o
"std::cout", referenced from:
_main in hello-e3c9c1.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
}}}
--
Ticket URL: <https://trac.macports.org/ticket/69812#comment:26>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list