[MacPorts] #66926: mold uses wrong flags with GCC, breaks the build
MacPorts
noreply at macports.org
Tue Feb 14 21:43:46 UTC 2023
#66926: mold uses wrong flags with GCC, breaks the build
-------------------------------------------+----------------------
Reporter: barracuda156 | Owner: crowell
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.8.1
Keywords: powerpc, leopard, snowleopard | Port: mold
-------------------------------------------+----------------------
To begin with, `-fno-aligned-allocation` should not be used with GCC,
otherwise configure fails:
{{{
---> Configuring mold
Executing: cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mold/mold/work/build"
&& /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles"
-DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local"
-DCMAKE_INSTALL_NAME_DIR="/opt/local/lib"
-DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC"
-DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC"
-DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW
-DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make
-DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules"
-DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules"
-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON
-DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev
-DCMAKE_OSX_ARCHITECTURES="ppc" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6"
-DCMAKE_OSX_SYSROOT="/"
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mold/mold/work/mold-1.7.1
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/local/bin/gcc-mp-12 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /opt/local/bin/g++-mp-12
-- Check for working CXX compiler: /opt/local/bin/g++-mp-12 - broken
CMake Error at
/opt/local/share/cmake-3.25/Modules/CMakeTestCXXCompiler.cmake:63
(message):
The C++ compiler
"/opt/local/bin/g++-mp-12"
is not able to compile a simple test program.
It fails with the following output:
Change Dir:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mold/mold/work/build/CMakeFiles/CMakeScratch
/TryCompile-f22Gtl
Run Build Command(s):/usr/bin/make -f Makefile cmTC_3f844/fast &&
/usr/bin/make -f CMakeFiles/cmTC_3f844.dir/build.make
CMakeFiles/cmTC_3f844.dir/build
Building CXX object CMakeFiles/cmTC_3f844.dir/testCXXCompiler.cxx.o
/opt/local/bin/g++-mp-12 -pipe -Os -fno-aligned-allocation -DNDEBUG
-isystem/opt/local/include/LegacySupport -I/opt/local/include
-D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -o
CMakeFiles/cmTC_3f844.dir/testCXXCompiler.cxx.o -c
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mold/mold/work/build/CMakeFiles/CMakeScratch
/TryCompile-f22Gtl/testCXXCompiler.cxx
g++-mp-12: error: unrecognized command-line option '-fno-aligned-
allocation'; did you mean '-fno-sized-deallocation'?
make[1]: *** [CMakeFiles/cmTC_3f844.dir/testCXXCompiler.cxx.o] Error 1
make: *** [cmTC_3f844/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:47 (project)
-- Configuring incomplete, errors occurred!
}}}
Once removed, it fails a bit further again on wrong flags:
{{{
g++-mp-12: error: unrecognized command-line option '-mrtm'; did you mean
'-mhtm'?
g++-mp-12: error: unrecognized command-line option '-mrtm'; did you mean
'-mhtm'?
g++-mp-12: error: unrecognized command-line option '-mrtm'; did you mean
'-mhtm'?
g++-mp-12: error: unrecognized command-line option '-mrtm'; did you mean
'-mhtm'?
g++-mp-12: error: unrecognized command-line option '-mwaitpkg'
g++-mp-12: error: unrecognized command-line option '-mrtm'; did you mean
'-mhtm'?
g++-mp-12: error: unrecognized command-line option '-mrtm'; did you mean
'-mhtm'?
g++-mp-12: error: unrecognized command-line option '-mrtm'; did you mean
'-mhtm'?
make[2]: *** [third-
party/tbb/src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
g++-mp-12: error: unrecognized command-line option '-mwaitpkg'
g++-mp-12: error: unrecognized command-line option '-mwaitpkg'
g++-mp-12: error: unrecognized command-line option '-mwaitpkg'
g++-mp-12: error: unrecognized command-line option '-mwaitpkg'
g++-mp-12: error: unrecognized command-line option '-mwaitpkg'
g++-mp-12: error: unrecognized command-line option '-mwaitpkg'
make[2]: *** [third-party/tbb/src/tbb/CMakeFiles/tbb.dir/arena.cpp.o]
Error 1
make[2]: *** [third-
party/tbb/src/tbb/CMakeFiles/tbb.dir/dynamic_link.cpp.o] Error 1
make[2]: *** [third-party/tbb/src/tbb/CMakeFiles/tbb.dir/arena_slot.cpp.o]
Error 1
make[2]: *** [third-
party/tbb/src/tbb/CMakeFiles/tbb.dir/concurrent_bounded_queue.cpp.o] Error
1
make[2]: *** [third-party/tbb/src/tbb/CMakeFiles/tbb.dir/allocator.cpp.o]
Error 1
make[2]: *** [third-party/tbb/src/tbb/CMakeFiles/tbb.dir/exception.cpp.o]
Error 1
}}}
P. S. Why does it use internal `tbb` instead of Macports one?
--
Ticket URL: <https://trac.macports.org/ticket/66926>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list