Closed autoantwort closed 3 years ago
Does the Apple M1 platform use arm64 arch?
If yes, I think that's very reasonable, and the default triplet should be arm64-windows
.
x86_64-apple-darwin-gcc, gcc? Should it be using gcc at all?
Does the Apple M1 platform use arm64 arch?
Yes, uname -m
returns arm64
If yes, I think that's very reasonable, and the default triplet should be
arm64-windows
.
Huh? On mac the triplet should be windows?
x86_64-apple-darwin-gcc, gcc? Should it be using gcc at all?
gcc is an alias to clang on mac to not break unix programs
➜ vcpkg git:(qt6-base) ✗ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@autoantwort Sorry, should be arm64-osx
.
Since Apple has changed the architecture of hardware such as imac, we are considering arm64-osx
or x64-osx
as the default triplet based on its architecture.
@autoantwort Sorry, should be
arm64-osx
.
Yeah the default triplet is now arm64-osx
after microsoft/vcpkg-tool#23, but I wan't to build for x64-osx
. That also works for every port is build except libb2
@autoantwort I am not sure if it is possible to build x64 successfully under the arm architecture. @strega-nil @strega-nil-ms Can you please take a look?
Thanks.
@autoantwort I am not sure if it is possible to build x64 successfully under the arm architecture.
It is. Apple writes this on their webpage and is already works for most of the ports in vcpkg (e.g. Qt6 and all of its dependencies, except this one). But some ports are buggy and don't support it yet therefore I have created this Bug Report.
@autoantwort You explicitly run with --triplet=x64-osx --host-triplet=x64-osx
. Do you intentionally disable cross-compiling while building for x64 on arm?
@autoantwort You explicitly run with
--triplet=x64-osx --host-triplet=x64-osx
. Do you intentionally disable cross-compiling while building for x64 on arm?
No, but ./vcpkg install --triplet=x64-osx
yields the same result.
I had set --host-triplet=x64-osx
to prevent doubled builds of host dependencies because it is possible to run x64 software on arm64 and I save time.
I had set --host-triplet=x64-osx to prevent doubled builds of host dependencies because it is possible to run x64 software on arm64 and I save time.
But in some vcpkg scripts behaviour changes when cross compiling is detected.
In the last day I spent some time looking at config.log in the build directory. There must be a hint why it doesn't target the desired CPU when the compiler defaults to this CPU.
But in some vcpkg scripts behaviour changes when cross compiling is detected.
Yeah, but it uses the host cpu type for that and not the host triplet because the host triplet is not accessible in the vcpkg_configure_make
function
In the last day I spent some time looking at config.log in the build directory. There must be a hint why it doesn't target the desired CPU when the compiler defaults to this CPU.
From the config.log:
checking for x86_64-apple-darwin-gcc... no
checking for gcc... gcc
From the config.log:
This is stdout as recorded by vcpkg. It was in your first post. I refer to the ~status.log~config.log
file in the actual build directory (or moved to the other logs by vcpkg). It records tests and variables, even the PATH.
Ah ok
So in ac_cv_env_CFLAGS_value
there is -arch x86_64
but later in CFLAGS
it is missing. And while running the configure tests it is also used.
Offending line in configure.ac
:
AX_CHECK_COMPILE_FLAG([-O3], [CFLAGS=-O3])
:boom:
Cool that you have found it! I have no idea about autoconf/configure. Do you know how to fix that?
Cool that you have found it! I have no idea about autoconf/configure.
Neither did I, until I started working on the GDAL port some weeks ago ;-)
Do you know how to fix that?
Just remove that line. It activates the -O3 optimization flag if supported, regardless of build type. This is already handled by the CFLAGS passed from vcpkg toolchain.
Host Environment
To Reproduce Steps to reproduce the behavior:
./vcpkg install libb2
Failure logs
/Users/leanderSchulten/git_projekte/Lichtsteuerung/vcpkg/buildtrees/libb2/config-x64-osx-dbg-out.log
``` checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for x86_64-apple-darwin-strip... no checking for strip... strip checking for a race-free mkdir -p... ./../src/6f75badf85-b3a5d32c8d.clean/install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for x86_64-apple-darwin-gcc... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... none needed checking whether gcc understands -c and -o together... yes checking whether make supports the include directive... yes (GNU style) checking dependency style of gcc... gcc3 checking for explicit_bzero... no checking for explicit_memset... no checking for memset_s... yes checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for gcc option to support OpenMP... unsupported checking whether byte ordering is bigendian... no checking for inline... inline checking for size_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for memset... yes checking build system type... aarch64-apple-darwin20.4.0 checking host system type... x86_64-apple-darwin checking how to print strings... printf checking for a sed that does not truncate output... /usr/local/bin/gsed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... no checking for x86_64-apple-darwin-dumpbin... no checking for x86_64-apple-darwin-link... no checking for dumpbin... no checking for link... link -dump checking the name lister (nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 786432 checking how to convert aarch64-apple-darwin20.4.0 file names to x86_64-apple-darwin format... func_convert_file_noop checking how to convert aarch64-apple-darwin20.4.0 file names to toolchain format... func_convert_file_noop checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r checking for x86_64-apple-darwin-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for x86_64-apple-darwin-dlltool... no checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for x86_64-apple-darwin-ar... no checking for ar... ar checking for archiver @FILE support... no checking for x86_64-apple-darwin-strip... strip checking for x86_64-apple-darwin-ranlib... no checking for ranlib... ranlib checking command to parse nm output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for x86_64-apple-darwin-mt... no checking for mt... no checking if : is a manifest tool... no checking for x86_64-apple-darwin-dsymutil... no checking for dsymutil... dsymutil checking for x86_64-apple-darwin-nmedit... no checking for nmedit... nmedit checking for x86_64-apple-darwin-lipo... no checking for lipo... lipo checking for x86_64-apple-darwin-otool... no checking for otool... otool checking for x86_64-apple-darwin-otool64... no checking for otool64... no checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking for -force_load linker flag... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking whether C compiler accepts -O3... yes checking whether C compiler accepts -march=native... no checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libb2.pc config.status: creating src/config.h config.status: executing depfiles commands config.status: executing libtool commands ```