Opened 20 months ago
Last modified 16 months ago
#66926 assigned defect
mold uses wrong flags with GCC, breaks the build
Reported by: | barracuda156 | Owned by: | crowell (Jeffrey Crowell) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.8.1 |
Keywords: | powerpc, leopard, snowleopard | Cc: | |
Port: | mold |
Description
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
- S. Why does it use internal
tbb
instead of Macports one?
Change History (3)
comment:1 follow-up: 2 Changed 20 months ago by barracuda156
comment:2 follow-up: 3 Changed 16 months ago by aeiouaeiouaeiouaeiouaeiouaeiou
Replying to barracuda156:
Okay, those
-mrtm
are an effect of using bundledtbb
.
-DMOLD_USE_SYSTEM_TBB=ON
will solve the problem, once my PR is merged: https://github.com/macports/macports-ports/pull/14780
This seems to have been fixed a long time ago, can you check the build again?
comment:3 Changed 16 months ago by barracuda156
Replying to aeiouaeiouaeiouaeiouaeiouaeiou:
Replying to barracuda156:
Okay, those
-mrtm
are an effect of using bundledtbb
.
-DMOLD_USE_SYSTEM_TBB=ON
will solve the problem, once my PR is merged: https://github.com/macports/macports-ports/pull/14780This seems to have been fixed a long time ago, can you check the build again?
Do you mean mold
? As broken as ever:
---> Extracting mold-1.7.1.tar.gz Executing: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mold/mold/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/mold/mold-1.7.1.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - ---> 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.26/Modules/CMakeTestCXXCompiler.cmake:60 (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-Mnf6L9 Run Build Command(s):/opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_1c507/fast && /usr/bin/make -f CMakeFiles/cmTC_1c507.dir/build.make CMakeFiles/cmTC_1c507.dir/build Building CXX object CMakeFiles/cmTC_1c507.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_1c507.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-Mnf6L9/testCXXCompiler.cxx g++-mp-12: error: unrecognized command-line option '-fno-aligned-allocation'; did you mean '-fno-sized-deallocation'? make[1]: *** [CMakeFiles/cmTC_1c507.dir/testCXXCompiler.cxx.o] Error 1 make: *** [cmTC_1c507/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!
Okay, those
-mrtm
are an effect of using bundledtbb
.-DMOLD_USE_SYSTEM_TBB=ON
will solve the problem, once my PR is merged: https://github.com/macports/macports-ports/pull/14780