Opened 4 years ago

Closed 4 years ago

#59832 closed defect (fixed)

cmake 3.16.0: does not build on PPC Mac OS X 10.5.8, "Bus Error"

Reported by: timishimuni Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: leopard Cc: fvaccari, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), udbraumann
Port: cmake

Description (last modified by timishimuni)

Description

Building cmake fails with an apparent bus error at:

:info:configure cmake(21293) malloc: *** error for object 0xa01be3dc: Non-aligned pointer being freed
:info:configure *** set a breakpoint in malloc_error_break to debug

Environment

Power Mac G5 running OS X 10.5.8, 8G RAM, Xcode 3.1.4 From the top of the build log:

:debug:sysinfo Mac OS X 10.5 (darwin/9.8.0) arch powerpc
:debug:sysinfo MacPorts 2.6.2
:debug:sysinfo Xcode 3.1.4
:debug:sysinfo SDK 10.5
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.5

Log

More context from the end of /opt/local/var/macports/logs/_opt_..._ports_devel_cmake/cmake/main.log:

:info:configure ld: warning: direct access in TargetPolicyNode::Evaluate(std::vector<std::basic_string<char,std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, cmGeneratorExpressionContext*, GeneratorExpressionContent const*, cmGeneratorExpressionDAGChecker*) const to global weak symbol TargetPolicyNode::Evaluate(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>,
 std::allocator<char> > > > const&, cmGeneratorExpressionContext*, GeneratorExpressionContent const*, cmGeneratorExpressionDAGChecker*) const means the weak symbol cannot be overriden at runtime. This was likely caused by different translation units being compiled with different visiblity settings.
:info:configure cmake(21293) malloc: *** error for object 0xa01be3dc: Non-aligned pointer being freed
:info:configure *** set a breakpoint in malloc_error_break to debug
:info:configure cmake(21293) malloc: *** error for object 0xa01be36c: Non-aligned pointer being freed
:info:configure *** set a breakpoint in malloc_error_break to debug
:info:configure loading initial cache file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.0/Bootstrap.cmk/InitialCacheFlags.cmake
:info:configure ./bootstrap: line 1675: 21293 Bus error  "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
:info:configure ---------------------------------------------
:info:configure Error when bootstrapping CMake:
:info:configure Problem while running initial CMake
:info:configure ---------------------------------------------
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.0" && ./bootstrap --prefix=/opt/local --docdir=share/doc/cmake --parallel=2 --init=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.0/macports.cmake --system-libs --no-system-jsoncpp --no-system-librhash --no-qt-gui --
:info:configure Exit code: 11
:error:configure Failed to configure cmake: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
:debug:configure     while executing
:debug:configure "$procedure $targetname"
:error:configure See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_
cmake/cmake/main.log for details.

Change History (35)

comment:1 Changed 4 years ago by timishimuni

Description: modified (diff)

comment:2 Changed 4 years ago by timishimuni

Per the helpful suggestion to set a breakpoint in malloc_error_break to debug:

$ gdb cmake
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:15:14 UTC 2009)
...

(gdb) b malloc_error_break
Breakpoint 1 at 0x97c8fe68
(gdb) run
Starting program: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.0/Bootstrap.cmk/cmake 
unable to read unknown load command 0x24
unable to read unknown load command 0x26
unable to read unknown load command 0x24
unable to read unknown load command 0x26
unable to read unknown load command 0x24
unable to read unknown load command 0x26
Reading symbols for shared libraries . done
cmake(23064) malloc: *** error for object 0xa01be3dc: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug

Breakpoint 1, 0x97c8fe68 in malloc_error_break ()
(gdb) bt
#0  0x97c8fe68 in malloc_error_break ()
#1  0x97c8aad0 in szone_error ()
#2  0x90e22fdc in std::locale::_Impl::_M_install_facet ()
#3  0x90e23498 in std::locale::_Impl::_Impl ()
#4  0x90e23b0c in std::locale::_Impl::_Impl ()
#5  0x97b8bbc8 in pthread_once ()
#6  0x90e23b74 in std::locale::_Impl::_Impl ()
#7  0x90e23cf4 in std::locale::locale ()
#8  0x90e224a0 in std::ios_base::_M_init ()
#9  0x90e2e210 in std::basic_ios<char, std::char_traits<char> >::init ()
#10 0x0033117c in std::ios_base::Init::Init ()
#11 0x00191968 in _GLOBAL__sub_I_cmCommandArgumentParserHelper.cxx ()
#12 0x8fe13834 in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
#13 0x8fe0f248 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#14 0x8fe0f36c in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#15 0x8fe03848 in __dyld__ZN4dyld24initializeMainExecutableEv ()
#16 0x8fe08144 in __dyld__ZN4dyld5_mainEPK11mach_headermiPPKcS5_S5_ ()
#17 0x8fe01774 in __dyld__ZN13dyldbootstrap5startEPK11mach_headeriPPKcl ()
#18 0x8fe01048 in __dyld__dyld_start ()
(gdb) 

comment:3 Changed 4 years ago by jmroot (Joshua Root)

Keywords: leopard added; cmake removed
Owner: set to michaelld
Status: newassigned

comment:4 Changed 4 years ago by kencu (Ken)

we've been working on this issue in this ticket #59706 as well. For now, all I have for you is to roll back to libgcc7 7.4.x by activating that version like this:

sudo port activate libgcc7

and pick the previous one.

The gcc7/libgcc7 update to 7.5.0 has been very problematic so far, and we may need to roll this back. It has nothing to do with cmake I believe, as the same error occurs with other software, eg. dvisvgm.

I think it has something to do with damaged locale support in darwin, as this has been known to be problem for a long time, but I don't have a fix for it.

Interestingly, it is not occurring on Tiger for me....

comment:5 Changed 4 years ago by kencu (Ken)

To get this resolved, we'll need to:

  1. come up with a very simple reproducer case
  2. figure out which commit in the libgcc7 code base broke it

comment:6 Changed 4 years ago by kencu (Ken)

For anyone else stumbling across gcc7/libgcc7 errors == there is presently no fix available. Just roll back to the 7.4.x version until this gets sorted out eventually.

comment:7 Changed 4 years ago by fvaccari

Cc: fvaccari added

comment:8 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:9 Changed 4 years ago by udbraumann

Cc: udbraumann added

comment:10 Changed 4 years ago by ggaussling (Gerhard Gaußling)

Hi, I got a similiar issue, but no fallback gcc7.4.x, because I just installed macports 2.6.2 on a 10.5.8 powerbook G4 12".

I try to install macosxfuse and encfs.I eventually need exfat for an external wd book hdd.

I didn't do anything with macports for years, and I'm only a user.

Here is my output:

ggaussling-Computer:~ ggaussling$ sudo port activate libgcc7
Password:
--->  Computing dependencies for libgcc7
--->  Cleaning libgcc7
ggaussling-Computer:~ ggaussling$ sudo port install -d encfs--->  Computing dependencies for encfsThe following dependencies will be installed: 
 cmake
 osxfuse
 rlog
Continue? [Y/n]: 
--->  Fetching archive for cmake
--->  Attempting to fetch cmake-3.16.5_0.darwin_9.ppc.tbz2 from http://packages.macports.org/cmake
--->  Attempting to fetch cmake-3.16.5_0.darwin_9.ppc.tbz2 from http://lil.fr.packages.macports.org/cmake
--->  Attempting to fetch cmake-3.16.5_0.darwin_9.ppc.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/cmake
--->  Configuring cmake                                                      
Error: Failed to configure cmake: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port encfs failed
ggaussling-Computer:~ ggaussling$ tail -n30 /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log
:info:configure ---------------------------------------------
:info:configure CMake 3.16.5, Copyright 2000-2019 Kitware, Inc. and Contributors
:info:configure C compiler on this system is: /opt/local/bin/gcc-mp-7 -pipe -Os -I/opt/local/include/LegacySupport -arch ppc  
:info:configure C++ compiler on this system is: /opt/local/bin/g++-mp-7 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc   
:info:configure Makefile processor on this system is: make
:info:configure /opt/local/bin/g++-mp-7 has setenv
:info:configure /opt/local/bin/g++-mp-7 has unsetenv
:info:configure /opt/local/bin/g++-mp-7 does not have environ in stdlib.h
:info:configure /opt/local/bin/g++-mp-7 has stl wstring
:info:configure /opt/local/bin/g++-mp-7 has <ext/stdio_filebuf.h>
:info:configure ---------------------------------------------
:info:configure make: `cmake' is up to date.
:info:configure cmake(96461) malloc: *** error for object 0xa0a653dc: Non-aligned pointer being freed
:info:configure *** set a breakpoint in malloc_error_break to debug
:info:configure cmake(96461) malloc: *** error for object 0xa0a6536c: Non-aligned pointer being freed
:info:configure *** set a breakpoint in malloc_error_break to debug
:info:configure loading initial cache file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/InitialCacheFlags.cmake
:info:configure ./bootstrap: line 1676: 96461 Bus error               "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
:info:configure ---------------------------------------------
:info:configure Error when bootstrapping CMake:
:info:configure Problem while running initial CMake
:info:configure ---------------------------------------------
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5" && ./bootstrap --prefix=/opt/local --docdir=share/doc/cmake --parallel=1 --init=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/macports.cmake --system-libs --no-system-jsoncpp --no-system-librhash --no-qt-gui -- 
:info:configure Exit code: 11
:error:configure Failed to configure cmake: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
:debug:configure     while executing
:debug:configure "$procedure $targetname"
:error:configure See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log for details.
ggaussling-Computer:~ ggaussling$
ggausslings-Computer:cmake-3.16.5 ggaussling$ cat -n ./bootstrap | grep -C10 1676
  1666	export MAKE
  1667	export CFLAGS
  1668	export CXXFLAGS
  1669	export LDFLAGS
  1670	
  1671	# Run bootstrap CMake to configure real CMake
  1672	cmake_options="-DCMAKE_BOOTSTRAP=1"
  1673	if [ -n "${cmake_verbose}" ]; then
  1674	  cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
  1675	fi
  1676	"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
  1677	RES=$?
  1678	if [ "${RES}" -ne "0" ]; then
  1679	  cmake_error 11 "Problem while running initial CMake"
  1680	fi
  1681	
  1682	echo "---------------------------------------------"
  1683	
  1684	# And we are done. Now just run make
  1685	echo "CMake has bootstrapped.  Now run ${cmake_make_processor}."
ggausslings-Computer:cmake-3.16.5 ggaussling$ head  ./bootstrap #!/bin/sh
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

die() {
  echo "$@" 1>&2 ; exit 1
}

# Compile flag extraction function.

ggausslings-Computer:cmake-3.16.5 ggaussling$ sudo cp -p  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap.log /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap_bak.log



ggausslings-Computer:cmake-3.16.5 ggaussling$ sudo ./bootstrap
---------------------------------------------
CMake 3.16.5, Copyright 2000-2019 Kitware, Inc. and ContributorsFound GNU toolchainC compiler on this system is: gcc   ---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------




ggausslings-Computer:cmake-3.16.5 ggaussling$ sudo bash -x  ./bootstrap
+ LC_NUMERIC=C
+ LC_COLLATE=C
+ export 'PS4=\010$(printf "% 4d" $LINENO)\011-> '
+ PS4='\010$(printf "% 4d" $LINENO)\011-> '
  17	-> Ldbg=true
  67	-> uname
  67	-> cmake_system=Darwin
  68	-> dirname ./bootstrap
  68	-> cd .
  68	-> pwd
  68	-> cmake_source_dir=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5
  69	-> pwd
  69	-> cmake_binary_dir=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5
  72	-> cmake_version_component MAJOR
  41	-> sed -n '
/^set(CMake_VERSION_MAJOR/ {s/set(CMake_VERSION_MAJOR *\([0-9]*\))/\1/;p;}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeVersion.cmake
  72	-> cmake_version_major=3
  73	-> cmake_version_component MINOR
  41	-> sed -n '
/^set(CMake_VERSION_MINOR/ {s/set(CMake_VERSION_MINOR *\([0-9]*\))/\1/;p;}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeVersion.cmake
  73	-> cmake_version_minor=16
  74	-> cmake_version_component PATCH
  41	-> sed -n '
/^set(CMake_VERSION_PATCH/ {s/set(CMake_VERSION_PATCH *\([0-9]*\))/\1/;p;}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeVersion.cmake
  74	-> cmake_version_patch=5
  75	-> cmake_version=3.16.5
  76	-> cmake_version_component RC
  41	-> sed -n '
/^set(CMake_VERSION_RC/ {s/set(CMake_VERSION_RC *\([0-9]*\))/\1/;p;}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeVersion.cmake
  76	-> cmake_version_rc=
  77	-> '[' '' '!=' '' ']'
  81	-> grep '^Copyright .* Kitware' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Copyright.txt
  81	-> cmake_copyright='Copyright 2000-2019 Kitware, Inc. and Contributors'
  83	-> cmake_bin_dir_keyword=OTHER
  84	-> cmake_data_dir_keyword=OTHER
  85	-> cmake_doc_dir_keyword=OTHER
  86	-> cmake_man_dir_keyword=OTHER
  87	-> cmake_xdgdata_dir_keyword=OTHER
  88	-> cmake_bin_dir=
  89	-> cmake_data_dir=
  90	-> cmake_doc_dir=
  91	-> cmake_man_dir=
  92	-> cmake_xdgdata_dir=
  93	-> cmake_init_file=
  94	-> cmake_bootstrap_system_libs=
  95	-> cmake_bootstrap_qt_gui=
  96	-> cmake_bootstrap_qt_qmake=
  97	-> cmake_sphinx_info=
  98	-> cmake_sphinx_man=
  99	-> cmake_sphinx_html=
 100	-> cmake_sphinx_qthelp=
 101	-> cmake_sphinx_build=
 102	-> cmake_sphinx_flags=
 105	-> echo Darwin
 105	-> grep CYGWIN
 110	-> cmake_system_cygwin=false
 114	-> echo Darwin
 114	-> grep 'MINGW\|MSYS'
 117	-> cmake_system_mingw=false
 121	-> echo Darwin
 121	-> grep Darwin
 122	-> cmake_system_darwin=true
 128	-> echo Darwin
 128	-> grep BeOS
 133	-> cmake_system_beos=false
 137	-> echo Darwin
 137	-> grep Haiku
 142	-> cmake_system_haiku=false
 146	-> echo Darwin
 146	-> grep OpenVMS
 149	-> cmake_system_openvms=false
 153	-> echo Darwin
 153	-> grep HP-UX
 161	-> cmake_system_hpux=false
 165	-> echo Darwin
 165	-> grep Linux
 168	-> cmake_system_linux=false
 174	-> cmake_machine_parisc=false
 175	-> false
 179	-> false
 186	-> false
 191	-> cmake_bootstrap_generator='Unix Makefiles'
 195	-> false
 200	-> _tmp=.tmp
 201	-> _cmk=.cmk
 202	-> _diff=diff
 206	-> cmake_bootstrap_dir=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk
 209	-> case "${cmake_system}" in
 225	-> false
 237	-> false
 240	-> cmake_default_prefix=/usr/local
 244	-> cmake_install_dest_default BIN OTHER
  49	-> sed -n '
/^ *set(CMAKE_BIN_DIR_DEFAULT.*) # OTHER$/ {
  s/^ *set(CMAKE_BIN_DIR_DEFAULT *"\([^"]*\)").*$/\1/
  s/${CMake_VERSION_MAJOR}/3/
  s/${CMake_VERSION_MINOR}/16/
  s/${CMake_VERSION_PATCH}/5/
  p
  q
}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeInstallDestinations.cmake
 244	-> cmake_bin_dir_default=bin
 245	-> cmake_install_dest_default DATA OTHER
  49	-> sed -n '
/^ *set(CMAKE_DATA_DIR_DEFAULT.*) # OTHER$/ {
  s/^ *set(CMAKE_DATA_DIR_DEFAULT *"\([^"]*\)").*$/\1/
  s/${CMake_VERSION_MAJOR}/3/
  s/${CMake_VERSION_MINOR}/16/
  s/${CMake_VERSION_PATCH}/5/
  p
  q
}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeInstallDestinations.cmake
 245	-> cmake_data_dir_default=share/cmake-3.16
 246	-> cmake_install_dest_default DOC OTHER
  49	-> sed -n '
/^ *set(CMAKE_DOC_DIR_DEFAULT.*) # OTHER$/ {
  s/^ *set(CMAKE_DOC_DIR_DEFAULT *"\([^"]*\)").*$/\1/
  s/${CMake_VERSION_MAJOR}/3/
  s/${CMake_VERSION_MINOR}/16/
  s/${CMake_VERSION_PATCH}/5/
  p
  q
}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeInstallDestinations.cmake
 246	-> cmake_doc_dir_default=doc/cmake-3.16
 247	-> cmake_install_dest_default MAN OTHER
  49	-> sed -n '
/^ *set(CMAKE_MAN_DIR_DEFAULT.*) # OTHER$/ {
  s/^ *set(CMAKE_MAN_DIR_DEFAULT *"\([^"]*\)").*$/\1/
  s/${CMake_VERSION_MAJOR}/3/
  s/${CMake_VERSION_MINOR}/16/
  s/${CMake_VERSION_PATCH}/5/
  p
  q
}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeInstallDestinations.cmake
 247	-> cmake_man_dir_default=man
 248	-> cmake_install_dest_default XDGDATA OTHER
  49	-> sed -n '
/^ *set(CMAKE_XDGDATA_DIR_DEFAULT.*) # OTHER$/ {
  s/^ *set(CMAKE_XDGDATA_DIR_DEFAULT *"\([^"]*\)").*$/\1/
  s/${CMake_VERSION_MAJOR}/3/
  s/${CMake_VERSION_MINOR}/16/
  s/${CMake_VERSION_PATCH}/5/
  p
  q
}
' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/CMakeInstallDestinations.cmake
 248	-> cmake_xdgdata_dir_default=share
 250	-> CMAKE_KNOWN_C_COMPILERS='cc gcc clang xlc icc tcc'
 251	-> CMAKE_KNOWN_CXX_COMPILERS='aCC xlC CC g++ clang++ c++ icc como '
 252	-> CMAKE_KNOWN_MAKE_PROCESSORS='gmake make'
 266	-> CMAKE_PROBLEMATIC_FILES='  CMakeCache.txt   CMakeSystem.cmake   CMakeCCompiler.cmake   CMakeCXXCompiler.cmake   */CMakeSystem.cmake   */CMakeCCompiler.cmake   */CMakeCXXCompiler.cmake   Source/cmConfigure.h   Source/CTest/Curl/config.h   Utilities/cmexpat/expatConfig.h   Utilities/cmexpat/expatDllConfig.h   '
 274	-> CMAKE_UNUSED_SOURCES='  cmGlobalXCodeGenerator   cmLocalXCodeGenerator   cmXCodeObject   cmXCode21Object   cmSourceGroup '
 479	-> CMAKE_CXX_SOURCES='  cmAddCustomCommandCommand   cmAddCustomTargetCommand   cmAddDefinitionsCommand   cmAddDependenciesCommand   cmAddExecutableCommand   cmAddLibraryCommand   cmAddSubDirectoryCommand   cmAddTestCommand   cmArgumentParser   cmBinUtilsLinker   cmBinUtilsLinuxELFGetRuntimeDependenciesTool   cmBinUtilsLinuxELFLinker   cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool   cmBinUtilsMacOSMachOGetRuntimeDependenciesTool   cmBinUtilsMacOSMachOLinker   cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool   cmBinUtilsWindowsPEGetRuntimeDependenciesTool   cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool   cmBinUtilsWindowsPELinker   cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool   cmBreakCommand   cmBuildCommand   cmCMakeMinimumRequired   cmCMakePolicyCommand   cmCPackPropertiesGenerator   cmCacheManager   cmCheckCustomOutputs   cmCommand   cmCommandArgumentParserHelper   cmCommands   cmCommonTargetGenerator   cmComputeComponentGraph   cmComputeLinkDepends   cmComputeLinkInformation   cmComputeTargetDepends   cmConditionEvaluator   cmConfigureFileCommand   cmContinueCommand   cmCoreTryCompile   cmCreateTestSourceList   cmCustomCommand   cmCustomCommandGenerator   cmDefinePropertyCommand   cmDefinitions   cmDepends   cmDependsC   cmDocumentationFormatter   cmEnableLanguageCommand   cmEnableTestingCommand   cmExecProgramCommand   cmExecuteProcessCommand   cmExpandedCommandArgument   cmExportBuildFileGenerator   cmExportFileGenerator   cmExportInstallFileGenerator   cmExportSet   cmExportTryCompileFileGenerator   cmExprParserHelper   cmExternalMakefileProjectGenerator   cmFileCommand   cmFileCopier   cmFileInstaller   cmFileTime   cmFileTimeCache   cmFileTimes   cmFindBase   cmFindCommon   cmFindFileCommand   cmFindLibraryCommand   cmFindPackageCommand   cmFindPathCommand   cmFindProgramCommand   cmForEachCommand   cmFunctionBlocker   cmFunctionCommand   cmFSPermissions   cmGeneratedFileStream   cmGeneratorExpression   cmGeneratorExpressionContext   cmGeneratorExpressionDAGChecker   cmGeneratorExpressionEvaluationFile   cmGeneratorExpressionEvaluator   cmGeneratorExpressionLexer   cmGeneratorExpressionNode   cmGeneratorExpressionParser   cmGeneratorTarget   cmGetCMakePropertyCommand   cmGetDirectoryPropertyCommand   cmGetFilenameComponentCommand   cmGetPipes   cmGetPropertyCommand   cmGetSourceFilePropertyCommand   cmGetTargetPropertyCommand   cmGetTestPropertyCommand   cmGlobalCommonGenerator   cmGlobalGenerator   cmGlobalUnixMakefileGenerator3   cmGlobVerificationManager   cmHexFileConverter   cmIfCommand   cmIncludeCommand   cmIncludeGuardCommand   cmIncludeDirectoryCommand   cmIncludeRegularExpressionCommand   cmInstallCommand   cmInstallCommandArguments   cmInstallDirectoryGenerator   cmInstallExportGenerator   cmInstallFilesCommand   cmInstallFilesGenerator   cmInstallGenerator   cmInstallScriptGenerator   cmInstallSubdirectoryGenerator   cmInstallTargetGenerator   cmInstallTargetsCommand   cmInstalledFile   cmLDConfigLDConfigTool   cmLDConfigTool   cmLinkDirectoriesCommand   cmLinkItem   cmLinkLineComputer   cmLinkLineDeviceComputer   cmListCommand   cmListFileCache   cmLocalCommonGenerator   cmLocalGenerator   cmLocalUnixMakefileGenerator3   cmMSVC60LinkLineComputer   cmMacroCommand   cmMakeDirectoryCommand   cmMakefile   cmMakefileExecutableTargetGenerator   cmMakefileLibraryTargetGenerator   cmMakefileTargetGenerator   cmMakefileUtilityTargetGenerator   cmMarkAsAdvancedCommand   cmMathCommand   cmMessageCommand   cmMessenger   cmNewLineStyle   cmOSXBundleGenerator   cmOptionCommand   cmOrderDirectories   cmOutputConverter   cmParseArgumentsCommand   cmPathLabel   cmPolicies   cmProcessOutput   cmProjectCommand   cmPropertyDefinition   cmPropertyDefinitionMap   cmPropertyMap   cmReturnCommand   cmRulePlaceholderExpander   cmRuntimeDependencyArchive   cmScriptGenerator   cmSearchPath   cmSeparateArgumentsCommand   cmSetCommand   cmSetDirectoryPropertiesCommand   cmSetPropertyCommand   cmSetSourceFilesPropertiesCommand   cmSetTargetPropertiesCommand   cmSetTestsPropertiesCommand   cmSiteNameCommand   cmSourceFile   cmSourceFileLocation   cmState   cmStateDirectory   cmStateSnapshot   cmString   cmStringAlgorithms   cmStringReplaceHelper   cmStringCommand   cmSubcommandTable   cmSubdirCommand   cmSystemTools   cmTarget   cmTargetCompileDefinitionsCommand   cmTargetCompileFeaturesCommand   cmTargetCompileOptionsCommand   cmTargetIncludeDirectoriesCommand   cmTargetLinkLibrariesCommand   cmTargetLinkOptionsCommand   cmTargetPrecompileHeadersCommand   cmTargetPropCommandBase   cmTargetPropertyComputer   cmTargetSourcesCommand   cmTest   cmTestGenerator   cmTimestamp   cmTryCompileCommand   cmTryRunCommand   cmUnsetCommand   cmUVHandlePtr   cmUVProcessChain   cmVersion   cmWhileCommand   cmWorkingDirectory   cmake    cmakemain   cmcmd  '
 481	-> false
 495	-> CMAKE_STD_CXX_HEADERS='  memory   optional   shared_mutex   string_view   utility '
 498	-> CMAKE_STD_CXX_SOURCES='  string_view '
 505	-> LexerParser_CXX_SOURCES='  cmCommandArgumentLexer   cmCommandArgumentParser   cmExprLexer   cmExprParser '
 509	-> LexerParser_C_SOURCES='  cmListFileLexer '
 511	-> false
 524	-> KWSYS_C_SOURCES='    EncodingC     ProcessUNIX     String     System     Terminal'
 533	-> KWSYS_CXX_SOURCES='  Directory   EncodingCXX   FStream   Glob   RegularExpression   SystemTools'
 547	-> KWSYS_FILES='  Directory.hxx   Encoding.h   Encoding.hxx   FStream.hxx   Glob.hxx   Process.h   RegularExpression.hxx   String.h   String.hxx   System.h   SystemTools.hxx   Terminal.h'
 549	-> false
 601	-> LIBUV_C_SOURCES='    src/strscpy.c     src/timer.c     src/uv-common.c     src/unix/cmake-bootstrap.c     src/unix/core.c     src/unix/fs.c     src/unix/loop.c     src/unix/loop-watcher.c     src/unix/no-fsevents.c     src/unix/pipe.c     src/unix/poll.c     src/unix/posix-hrtime.c     src/unix/posix-poll.c     src/unix/process.c     src/unix/signal.c     src/unix/stream.c     '
 861	-> cmake_verbose=
 862	-> cmake_parallel_make=
 863	-> cmake_ccache_enabled=
 864	-> cmake_prefix_dir=/usr/local
 865	-> test 0 '!=' 0
 909	-> '[' -n '' ']'
 921	-> echo ---------------------------------------------
---------------------------------------------
 923	-> cmake_version_display
 674	-> echo 'CMake 3.16.5, Copyright 2000-2019 Kitware, Inc. and Contributors'
 923	-> echo 'CMake 3.16.5, Copyright 2000-2019 Kitware, Inc. and Contributors'
CMake 3.16.5, Copyright 2000-2019 Kitware, Inc. and Contributors
 926	-> cmake_in_source_build=
 927	-> '[' -f /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/cmake.cxx -a -f /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/cmake.h ']'
 929	-> '[' -n '' ']'
 932	-> cmake_in_source_build=TRUE
 936	-> '[' -z TRUE ']'
 956	-> '[' -d /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk ']'
 957	-> '[' '!' -d /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk ']'
 960	-> cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk
 962	-> '[' -d cmsys ']'
 963	-> '[' '!' -d cmsys ']'
 968	-> rm -f /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap.log
 969	-> rm -f /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmConfigure.h.tmp
 970	-> rm -f /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmVersionConfig.h.tmp
 974	-> '[' -n TRUE ']'
 975	-> rm -f /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Source/cmConfigure.h
 979	-> cmake_c_flags=
 980	-> cmake_cxx_flags=
 981	-> cmake_ld_flags=
 984	-> false
 989	-> true
 990	-> cmake_ld_flags=' -framework CoreFoundation'
 994	-> false
 999	-> false
 1005	-> cmake_toolchains=
 1006	-> case "${cmake_system}" in
 1009	-> cmake_toolchains='Clang GNU'
 1015	-> cmake_toolchain_Clang_CC=clang
 1016	-> cmake_toolchain_Clang_CXX=clang++
 1017	-> cmake_toolchain_GNU_CC=gcc
 1018	-> cmake_toolchain_GNU_CXX=g++
 1019	-> cmake_toolchain_PGI_CC=pgcc
 1020	-> cmake_toolchain_PGI_CXX=pgCC
 1021	-> cmake_toolchain_PathScale_CC=pathcc
 1022	-> cmake_toolchain_PathScale_CXX=pathCC
 1023	-> cmake_toolchain_XL_CC=xlc
 1024	-> cmake_toolchain_XL_CXX=xlC
 1059	-> '[' -z '' -a -z '' ']'
 1060	-> cmake_toolchain_detect
 1050	-> cmake_toolchain=
 1051	-> for tc in '${cmake_toolchains}'
 1052	-> echo 'Checking for Clang toolchain'
 1053	-> cmake_toolchain_try Clang
 1028	-> tc=Clang
 1029	-> cmake_tmp_file
 792	-> echo cmake_bootstrap_1077_test
 1029	-> TMPFILE=cmake_bootstrap_1077_test
 1031	-> eval 'tc_CC=${cmake_toolchain_Clang_CC}'
 1031	-> tc_CC=clang
 1032	-> echo 'int main() { return 0; }'
 1033	-> cmake_try_run clang '' cmake_bootstrap_1077_test.c
 1034	-> tc_result_CC=1
 1035	-> rm -f cmake_bootstrap_1077_test.c
 1036	-> test 1 = 0
 1036	-> return 1
 1051	-> for tc in '${cmake_toolchains}'
 1052	-> echo 'Checking for GNU toolchain'
 1053	-> cmake_toolchain_try GNU
 1028	-> tc=GNU
 1029	-> cmake_tmp_file
 792	-> echo cmake_bootstrap_1077_test
 1029	-> TMPFILE=cmake_bootstrap_1077_test
 1031	-> eval 'tc_CC=${cmake_toolchain_GNU_CC}'
 1031	-> tc_CC=gcc
 1032	-> echo 'int main() { return 0; }'
 1033	-> cmake_try_run gcc '' cmake_bootstrap_1077_test.c
 1034	-> tc_result_CC=0
 1035	-> rm -f cmake_bootstrap_1077_test.c
 1036	-> test 0 = 0
 1038	-> eval 'tc_CXX=${cmake_toolchain_GNU_CXX}'
 1038	-> tc_CXX=g++
 1039	-> echo 'int main() { return 0; }'
 1040	-> cmake_try_run g++ '' cmake_bootstrap_1077_test.cpp
 1041	-> tc_result_CXX=0
 1042	-> rm -f cmake_bootstrap_1077_test.cpp
 1043	-> test 0 = 0
 1045	-> cmake_toolchain=GNU
 1054	-> echo 'Found GNU toolchain'
Found GNU toolchain
 1055	-> break
 1063	-> thread_flags=
 1064	-> case "${cmake_system}" in
 1070	-> cmake_c_compiler=
 1073	-> '[' -n GNU ']'
 1074	-> eval 'cmake_c_compilers=${cmake_toolchain_GNU_CC}'
 1074	-> cmake_c_compilers=gcc
 1082	-> cmake_tmp_file
 792	-> echo cmake_bootstrap_1077_test
 1082	-> TMPFILE=cmake_bootstrap_1077_test
 1107	-> echo '
#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__sun) && __STDC_VERSION__ < 199901L
#error "On Solaris we need C99."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#include <stdio.h>

int main(int argc, char* argv[])
{
  printf("%d%c", (argv != 0), (char)0x0a);
  return argc - 1;
}
'
 1108	-> for std in 11 99 90
 1109	-> cmake_extract_standard_flags GNU C 11
  34	-> sed -n 's/ *set *( *CMAKE_C11_EXTENSION_COMPILE_OPTION *"\{0,1\}\([^")]*\).*/\1/p' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Modules/Compiler/GNU-C.cmake
  35	-> tr ';' ' '
 1109	-> std_flags='-std=gnu11
-std=gnu1x'
 1110	-> for compiler in '${cmake_c_compilers}'
 1111	-> for std_flag in ''\'''\''' '$std_flags'
 1112	-> for thread_flag in ''\'''\''' '$thread_flags'
 1113	-> echo 'Checking whether '\''gcc   '\'' works.'
 1114	-> cmake_try_run gcc '  ' cmake_bootstrap_1077_test.c
 1116	-> cmake_c_compiler=gcc
 1117	-> cmake_c_flags='  '
 1118	-> break 4
 1124	-> rm -f cmake_bootstrap_1077_test.c
 1126	-> '[' -z gcc ']'
 1132	-> echo 'C compiler on this system is: gcc   '
C compiler on this system is: gcc   
 1136	-> cmake_cxx_compiler=
 1141	-> '[' -n GNU ']'
 1142	-> eval 'cmake_cxx_compilers=${cmake_toolchain_GNU_CXX}'
 1142	-> cmake_cxx_compilers=g++
 1150	-> cmake_tmp_file
 792	-> echo cmake_bootstrap_1077_test
 1150	-> TMPFILE=cmake_bootstrap_1077_test
 1218	-> echo '
#include <iostream>
#include <memory>
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
#include <iterator>
int check_cxx14()
{
  int a[] = { 0, 1, 2 };
  auto ai = std::cbegin(a);

  int b[] = { 2, 1, 0 };
  auto bi = std::cend(b);

  return *ai + *(bi - 1);
}
#else
int check_cxx14()
{
  return 0;
}
#endif

#if __cplusplus >= 201703L
#include <optional>
int check_cxx17()
{
  std::optional<int> oi = 0;
  return oi.value();
}
#else
int check_cxx17()
{
  return 0;
}
#endif

class Class
{
public:
  int Get() const { return this->Member; }
private:
  int Member = 1;
};
int main()
{
  auto const c = std::unique_ptr<Class>(new Class);
  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
  return 0;
}
'
 1219	-> for std in 17 14 11
 1220	-> cmake_extract_standard_flags GNU CXX 17
  34	-> sed -n 's/ *set *( *CMAKE_CXX17_EXTENSION_COMPILE_OPTION *"\{0,1\}\([^")]*\).*/\1/p' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Modules/Compiler/GNU-CXX.cmake
  35	-> tr ';' ' '
 1220	-> std_flags='-std=gnu++17
-std=gnu++1z'
 1221	-> for compiler in '${cmake_cxx_compilers}'
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++   '\'' works.'
 1225	-> cmake_try_run g++ '  ' cmake_bootstrap_1077_test.cxx
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++  -std=gnu++17 '\'' works.'
 1225	-> cmake_try_run g++ ' -std=gnu++17 ' cmake_bootstrap_1077_test.cxx
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++  -std=gnu++1z '\'' works.'
 1225	-> cmake_try_run g++ ' -std=gnu++1z ' cmake_bootstrap_1077_test.cxx
 1219	-> for std in 17 14 11
 1220	-> cmake_extract_standard_flags GNU CXX 14
  34	-> sed -n 's/ *set *( *CMAKE_CXX14_EXTENSION_COMPILE_OPTION *"\{0,1\}\([^")]*\).*/\1/p' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Modules/Compiler/GNU-CXX.cmake
  35	-> tr ';' ' '
 1220	-> std_flags='-std=gnu++14
-std=gnu++1y'
 1221	-> for compiler in '${cmake_cxx_compilers}'
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++   '\'' works.'
 1225	-> cmake_try_run g++ '  ' cmake_bootstrap_1077_test.cxx
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++  -std=gnu++14 '\'' works.'
 1225	-> cmake_try_run g++ ' -std=gnu++14 ' cmake_bootstrap_1077_test.cxx
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++  -std=gnu++1y '\'' works.'
 1225	-> cmake_try_run g++ ' -std=gnu++1y ' cmake_bootstrap_1077_test.cxx
 1219	-> for std in 17 14 11
 1220	-> cmake_extract_standard_flags GNU CXX 11
  34	-> sed -n 's/ *set *( *CMAKE_CXX11_EXTENSION_COMPILE_OPTION *"\{0,1\}\([^")]*\).*/\1/p' /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Modules/Compiler/GNU-CXX.cmake
  35	-> tr ';' ' '
 1220	-> std_flags='-std=gnu++11
-std=gnu++0x'
 1221	-> for compiler in '${cmake_cxx_compilers}'
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++   '\'' works.'
 1225	-> cmake_try_run g++ '  ' cmake_bootstrap_1077_test.cxx
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++  -std=gnu++11 '\'' works.'
 1225	-> cmake_try_run g++ ' -std=gnu++11 ' cmake_bootstrap_1077_test.cxx
 1222	-> for std_flag in ''\'''\''' '$std_flags'
 1223	-> for thread_flag in ''\'''\''' '$thread_flags'
 1224	-> echo 'Checking whether '\''g++  -std=gnu++0x '\'' works.'
 1225	-> cmake_try_run g++ ' -std=gnu++0x ' cmake_bootstrap_1077_test.cxx
 1235	-> rm -f cmake_bootstrap_1077_test.cxx
 1237	-> '[' -z '' ']'
 1238	-> cmake_error 7 'Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.'
 680	-> res=7
 681	-> shift 1
 682	-> echo ---------------------------------------------
---------------------------------------------
 683	-> echo 'Error when bootstrapping CMake:'
Error when bootstrapping CMake:
 684	-> echo 'Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.'
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
 685	-> echo ---------------------------------------------
---------------------------------------------
 686	-> '[' -f cmake_bootstrap.log ']'
 687	-> pwd
 687	-> echo 'Log of errors: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap.log'
Log of errors: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap.log
 689	-> echo ---------------------------------------------
---------------------------------------------
 691	-> exit 7



ggausslings-Computer:cmake-3.16.5 ggaussling$ less /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap.log



ggausslings-Computer:cmake-3.16.5 ggaussling$ grep -C3 err /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.5/Bootstrap.cmk/cmake_bootstrap.log
 810	-> cat cmake_bootstrap_1077_test.c

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__sun) && __STDC_VERSION__ < 199901L
#error "On Solaris we need C99."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#include <stdio.h>
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cmake_bootstrap_1077_test.cxx:4:25: error: unordered_map: No such file or directory
cmake_bootstrap_1077_test.cxx:7:2: error: #error "Compiler is not in a mode aware of C++11."
cmake_bootstrap_1077_test.cxx:60: error: ISO C++ forbids initialization of member ‘Member’
cmake_bootstrap_1077_test.cxx:60: error: making ‘Member’ static
cmake_bootstrap_1077_test.cxx:60: error: ISO C++ forbids in-class initialization of non-const static member ‘Member’
cmake_bootstrap_1077_test.cxx: In function ‘int main()’:
cmake_bootstrap_1077_test.cxx:64: error: ISO C++ forbids declaration of ‘c’ with no type
cmake_bootstrap_1077_test.cxx:64: error: ‘unique_ptr’ is not a member of ‘std’
cmake_bootstrap_1077_test.cxx:64: error: expected primary-expression before ‘>’ token
cmake_bootstrap_1077_test.cxx:65: error: base operand of ‘->’ is not a pointer
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ -std=gnu++17 cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cc1plus: error: unrecognized command line option "-std=gnu++17"
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ -std=gnu++1z cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cc1plus: error: unrecognized command line option "-std=gnu++1z"
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cmake_bootstrap_1077_test.cxx:4:25: error: unordered_map: No such file or directory
cmake_bootstrap_1077_test.cxx:7:2: error: #error "Compiler is not in a mode aware of C++11."
cmake_bootstrap_1077_test.cxx:60: error: ISO C++ forbids initialization of member ‘Member’
cmake_bootstrap_1077_test.cxx:60: error: making ‘Member’ static
cmake_bootstrap_1077_test.cxx:60: error: ISO C++ forbids in-class initialization of non-const static member ‘Member’
cmake_bootstrap_1077_test.cxx: In function ‘int main()’:
cmake_bootstrap_1077_test.cxx:64: error: ISO C++ forbids declaration of ‘c’ with no type
cmake_bootstrap_1077_test.cxx:64: error: ‘unique_ptr’ is not a member of ‘std’
cmake_bootstrap_1077_test.cxx:64: error: expected primary-expression before ‘>’ token
cmake_bootstrap_1077_test.cxx:65: error: base operand of ‘->’ is not a pointer
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ -std=gnu++14 cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cc1plus: error: unrecognized command line option "-std=gnu++14"
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ -std=gnu++1y cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cc1plus: error: unrecognized command line option "-std=gnu++1y"
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cmake_bootstrap_1077_test.cxx:4:25: error: unordered_map: No such file or directory
cmake_bootstrap_1077_test.cxx:7:2: error: #error "Compiler is not in a mode aware of C++11."
cmake_bootstrap_1077_test.cxx:60: error: ISO C++ forbids initialization of member ‘Member’
cmake_bootstrap_1077_test.cxx:60: error: making ‘Member’ static
cmake_bootstrap_1077_test.cxx:60: error: ISO C++ forbids in-class initialization of non-const static member ‘Member’
cmake_bootstrap_1077_test.cxx: In function ‘int main()’:
cmake_bootstrap_1077_test.cxx:64: error: ISO C++ forbids declaration of ‘c’ with no type
cmake_bootstrap_1077_test.cxx:64: error: ‘unique_ptr’ is not a member of ‘std’
cmake_bootstrap_1077_test.cxx:64: error: expected primary-expression before ‘>’ token
cmake_bootstrap_1077_test.cxx:65: error: base operand of ‘->’ is not a pointer
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ -std=gnu++11 cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cc1plus: error: unrecognized command line option "-std=gnu++11"
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'
--
#include <unordered_map>

#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif

#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif

#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif

#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif

#if __cplusplus > 201103L
--
 811	-> echo ------------------------------------------
------------------------------------------
 812	-> g++ -std=gnu++0x cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cc1plus: error: unrecognized command line option "-std=gnu++0x"
 813	-> RES=1
 814	-> '[' 1 -ne 0 ']'
 815	-> echo 'Test failed to compile'




ggausslings-Computer:cmake-3.16.5 ggaussling$ head -n30 ./bootstrap
#!/bin/sh
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

die() {
  echo "$@" 1>&2 ; exit 1
}


#-------------------------------------------------
# DEBUG
#-------------------------------------------------


LC_NUMERIC=C LC_COLLATE=C
export PS4='\010$(printf "% 4d" $LINENO)\011-> ' #debug
Ldbg=true
ldbg() {
if [ "$Ldbg" == "true" ];then
printf "$1"
fi
}

dbgStep() {
trap '(read -p "[$BASH_SOURCE:$LINENO] $BASH_COMMAND?")' DEBUG
}
# /DEBUG



ggausslings-Computer:cmake-3.16.5 ggaussling$ 

with the debug section for $LINENO the baffected line has no 1698:

$ cat -n ./bootstrap | grep -C10 '"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"'
  1688	export MAKE
  1689	export CFLAGS
  1690	export CXXFLAGS
  1691	export LDFLAGS
  1692	
  1693	# Run bootstrap CMake to configure real CMake
  1694	cmake_options="-DCMAKE_BOOTSTRAP=1"
  1695	if [ -n "${cmake_verbose}" ]; then
  1696	  cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
  1697	fi
  1698	"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
  1699	RES=$?
  1700	if [ "${RES}" -ne "0" ]; then
  1701	  cmake_error 11 "Problem while running initial CMake"
  1702	fi
  1703	
  1704	echo "---------------------------------------------"
  1705	
  1706	# And we are done. Now just run make
  1707	echo "CMake has bootstrapped.  Now run ${cmake_make_processor}."

Version 0, edited 4 years ago by ggaussling (Gerhard Gaußling) (next)

comment:11 Changed 4 years ago by ggaussling (Gerhard Gaußling)

I noticed this line:

 812	-> g++ -std=gnu++11 cmake_bootstrap_1077_test.cxx -o cmake_bootstrap_1077_test
cc1plus: error: unrecognized command line option "-std=gnu++11"

comment:12 Changed 4 years ago by kencu (Ken)

Iain is not having much luck fixing libgcc so far, so I'll have to roll back gcc7 to 7.4.x.

Chris is hoping we will split this off into different gcc7 versions for different systems, so there's that bit of headache to manage...which is mostly why I didn't fix this already.

comment:13 Changed 4 years ago by ggaussling (Gerhard Gaußling)

Do I have to use commit 481909f1dfa28ec7cad2510d3f9827bd65132d9d ?

https://github.com/macports/macports-ports/commit/481909f1dfa28ec7cad2510d3f9827bd65132d9d

Sorry, but I'm not sure how to handle the workaround ...

https://www.macports.org/ports.php?by=name&substr=gcc7

I'll use this, but don't know the right commit. https://trac.macports.org/wiki/howto/InstallingOlderPort

Or is it better, just to wait, until the workaround is rolling back gcc7.5.0 to 7.4.0? And I'll be able to compile things just by typing sudo port selfupdate ?

Last edited 4 years ago by ggaussling (Gerhard Gaußling) (previous) (diff)

comment:14 Changed 4 years ago by kencu (Ken)

something like this is the fix we need (untested as yet) <https://github.com/kencu/macports-ports/commit/34b21f883477e43fd03134e76dafb19e2f27547c>

From 34b21f883477e43fd03134e76dafb19e2f27547c Mon Sep 17 00:00:00 2001
From: Ken Cunningham <kencu@macports.org>
Date: Mon, 9 Mar 2020 12:59:30 -0700
Subject: [PATCH] gcc7/libgcc7: roll back to 7.4.0 on older systems

there is a c++ standard library conflict occurring
with libgcc 7.5.0 at present. This has been looked into
upstream, but to date (three months) there is no
solution available.

libgcc7 will need to stay pegged at 7.4.0 until this is
addressed upstream.
---
 lang/gcc7/Portfile | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/lang/gcc7/Portfile b/lang/gcc7/Portfile
index ccd3d3cf2be..cf5df63984d 100644
--- a/lang/gcc7/Portfile
+++ b/lang/gcc7/Portfile
@@ -30,13 +30,29 @@ master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/re
                     ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
                     gnu:gcc/gcc-${version}
 
-distname            gcc-${version}
-use_xz              yes
 
 checksums           rmd160  91d46ec088badec75f41a2ad2a0ba228a6715107 \
                     sha256  b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661 \
                     size    62783088
 
+if { ${os.platform} eq "darwin" && ${os.major} < 10 } {
+
+    # roll gcc7 back to version 7.4.0 as 7.5.0 does not play nicely with
+    # the system /usr/lib/libstdc++.dylib at present. This is being looked at upstream.
+    # we bump the epoch to roll back, but will also bump the revisions to 4 to avoid confusion
+
+    epoch           4
+    version         7.4.0
+    revision        4
+    subport libgcc7 {revision 4}
+    checksums       rmd160  77d3cdafe7df748fa484a300e9513acb3ee2c2e1 \
+                    sha256  eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51 \
+                    size    62601888
+}
+
+distname            gcc-${version}
+use_xz              yes
+
 # Check if this is the last supported gcc version for this system.
 # If it is, libgcc7 installs a full runtime, otherwise it only installs
 # what is missing from newer libgccX builds.

comment:15 Changed 4 years ago by kencu (Ken)

So far: I am only seeing this on 10.5 PPC. It seems that 10.4 PPC, and 10.4 and 10.5 Intel, do not show this happening. Further input from others on whether this is also true would be appreciated.

Rolling back to libgcc 7.4.0 using the above epoch bump does resolve it, although this is not ideal as it diverges the libgcc7 builds on different systems to different versions.

I believe the underlying issue relates to the different ABIs used by libstdc++ from our libgcc7 port, and the libstdc++ used by the system.

Presently we build libgcc7 using the default (new) ABI, but force all the builds to the old abi by building with an enabled macro _GLIBCXX_USE_CXX11_ABI=0. That is most likely the issue here. See <https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html>.

In the above link, issues with std::facet are specifically mentioned.

I am presently trying to rebuild libgcc7 7.5.0 with:

--with-default-libstdcxx-abi=0

I believe that will default all builds to _GLIBCXX_USE_CXX11_ABI=0 even without using the flag. cmake is famous for sanitizing it's build environment, and it may not be using _GLIBCXX_USE_CXX11_ABI=0 during it's build.

If that works, I think we can enable that configure option for building libgcc7, at least on 10.5 and less where it is important, but perhaps everywhere (as in MacPorts, we are always setting _GLIBCXX_USE_CXX11_ABI=0 anyway, so it would just be redundant). Hopefully that will work.

If it does not work, there is another configure option available for libgcc, which is reported to force the old ABI behaviour all the time. That might work.

--disable-libstdcxx-dual-abi

If none of those libgcc configure options work to fix the problem, then rolling back to libgcc7 7.4.0 would seem to be all we can do until upstream helps us out.

comment:16 Changed 4 years ago by kencu (Ken)

Another thought is that if indeed it's only cmake showing this issue, then inspecting it's build and somehow forcing _GLIBCXX_USE_CXX11_ABI=0 to be used if it is not being used would be the immediate fix as well (although we'd likely see this again sometime with other software that avoids the macro somehow). TBA.

comment:17 Changed 4 years ago by kencu (Ken)

well, building libgcc7 with this:

--with-default-libstdcxx-abi=0

certainly did not seem to help.

cmake(5351) malloc: *** error for object 0xa0b863dc: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
cmake(5351) malloc: *** error for object 0xa0b8636c: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
loading initial cache file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.16.4/Bootstrap.cmk/InitialCacheFlags.cmake
./bootstrap: line 1676:  5351 Bus error               "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"

so -- on to other ideas I guess.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:18 Changed 4 years ago by kencu (Ken)

using the current libgcc7 7.5.0 but deleting _GLIBCXX_USE_CXX11_ABI=0 from the CXXFLAGS also did not seem to work, which I found somewhat surprising, as I had hoped that do the trick...

comment:19 Changed 4 years ago by michaelld (Michael Dickens)

Has duplicate #60172

Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:20 Changed 4 years ago by kencu (Ken)

So it takes a while, but now I can also confirm the same thing happens with cmake and libgcc7 7.5.0 on 10.4 Intel.

So it looks like not just PPC, and 10.4 also. Unless I (or someone) can come up with something clever, we'll be rolling back gcc7/libgcc7 to 7.4.0 at least on 10.5 and less.

I haven't tried any systems 10.6,7,8 building using -stdlib=libstdc++, but they may well also be affected.

comment:21 Changed 4 years ago by kencu (Ken)

BTW, the other advice from upstream seems less palatable, perhaps -- to replace /usr/lib/libstdc++.dylib with the newer one from libgcc7 7.5.0. I can't see us being able to do the amount of testing that would be needed to see if that is a good idea.

comment:22 in reply to:  21 Changed 4 years ago by noloader (Jeffrey Walton)

Replying to kencu:

... the other advice from upstream seems less palatable, perhaps -- to replace /usr/lib/libstdc++.dylib with the newer one from libgcc7 7.5.0. I can't see us being able to do the amount of testing that would be needed to see if that is a good idea.

That sounds kind of dangerous to me. I'm not sure I would wager that bet, but I've always been a bit risk averse.

comment:23 in reply to:  15 Changed 4 years ago by noloader (Jeffrey Walton)

Replying to kencu:

...

I believe the underlying issue relates to the different ABIs used by libstdc++ from our libgcc7 port, and the libstdc++ used by the system.

Presently we build libgcc7 using the default (new) ABI, but force all the builds to the old abi by building with an enabled macro _GLIBCXX_USE_CXX11_ABI=0. That is most likely the issue here. See <https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html>.

Forgive me for the noise... If needed, here is the blog post covering _GLIBCXX_USE_CXX11_ABI from Red Hat: GCC 5 in Fedora.

-Wabi-tags may be useful while experimenting with _GLIBCXX_USE_CXX11_ABI.

Last edited 4 years ago by noloader (Jeffrey Walton) (previous) (diff)

comment:24 Changed 4 years ago by kencu (Ken)

indeed. I had a long email exchange with upstream in Nov/Dec about this. They know exactly what the issue is, and some others have seen this before (frederic).

object gets newed by one libstdc++, and is attempted to be freed by the other, just like we always worried about.

we can set DYLD_LIBRARY_PATH in macports environ to work around it...iirc that worked fine to make cmake work with 10.5.

that's logically the same as replacing libstdc++, of course, at least for the new softwae.

That might be our best bet, actually, as I want to get this idea also working to use a newer libc++ on the newer systems anyway...

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:25 in reply to:  24 Changed 4 years ago by noloader (Jeffrey Walton)

Replying to kencu:

indeed. I had a long email exchange with upstream in Nov/Dec about this. They know exactly what the issue is, and some others have seen this before (frederic).

object gets newed by one libstdc++, and is attempted to be freed by the other, just like we always worried about.

we can set DYLD_LIBRARY_PATH in macports environ to work around it...iirc that worked fine to make cmake work with 10.5.

that's logically the same as replacing libstdc++, of course, at least for the new softwae.

That might be our best bet, actually, as I want to get this idea also working to use a newer libc++ on the newer systems anyway...

Forgive my ignorance again... Apple linkers in 10.1 and above support two level namespaces. Would a linker namespace help sidestep the problem of allocating in one dylib, and freeing in another dylib? I believe the linker option is -twolevel_namespace. There is also an option -twolevel_namespace_hints.

I have only used the flat namespace, so I have no practical experience with multiple linker namespaces.

Also see Two-Level Namespace Executables.

comment:26 Changed 4 years ago by kencu (Ken)

so just confirming the obvious -- this works:

DYLD_LIBRARY_PATH=/opt/local/lib/libgcc cmake

even with libgcc7 7.5.0.

comment:27 Changed 4 years ago by kencu (Ken)

and you can also, obviously, add that to your .profile

export DYLD_LIBRARY_PATH=/opt/local/lib/libgcc

comment:28 in reply to:  20 Changed 4 years ago by noloader (Jeffrey Walton)

Replying to kencu:

So it takes a while, but now I can also confirm the same thing happens with cmake and libgcc7 7.5.0 on 10.4 Intel.

GCC 5 suffers the same problem. I tested by building CMake from sources (outside of MacPorts).

I am trying to install Clang 7.1 to see if I can get something to work.

comment:29 Changed 4 years ago by kencu (Ken)

I just built libgcc 7.4.0 and cmake 3.16.5 on 10.4 Intel without any problem, and everything works fine for me there.

Also, my other systems rolled back to gcc7/libgcc7 7.4.0 all work.

Don't forget that on MacPorts, all versions of gcc >= 5 share the same libgcc version, so if it's version 7.5.0, every gcc could be expected to show the same error.

My current setups use this <https://github.com/kencu/LeopardPorts/tree/master/lang/gcc7> and you can please feel free to try that, should you care to.

All are working correctly at present.

comment:30 Changed 4 years ago by noloader (Jeffrey Walton)

Deleted. No longer needed.

Last edited 4 years ago by noloader (Jeffrey Walton) (previous) (diff)

comment:31 Changed 4 years ago by noloader (Jeffrey Walton)

@kencu,

My current setups use this <​https://github.com/kencu/LeopardPorts/tree/master/lang/gcc7> and you can please feel free to try that, should you care to.

I'd be happy to test it. The problem is, I don't know what to do with the files.

Is there a procedure somewhere that explains what I am supposed to do?

comment:32 Changed 4 years ago by kencu (Ken)

I have put up a PR for the MacPorts' advanced users to review. You can find it in the MacPorts Github PR queue, and if you would like to advocate for it being committed, you can do so there!

comment:33 Changed 4 years ago by michaelld (Michael Dickens)

@kencu : can you link in the PR and/or tag me on it (if I'm not already)? thx!

comment:34 Changed 4 years ago by kencu (Ken)

Sure. Marcus has a good idea worth exploring here <https://github.com/macports/macports-ports/pull/6617> and there is a different PR to roll back gcc7 here <https://github.com/macports/macports-ports/pull/6595>.

Iain is working on fixing the underlying issue that is leading to this, so this might go away some day.

comment:35 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: assignedclosed

In 492da32894879bc5b5eb1096d2db1163941b4229/macports-ports (master):

cmake: avoid mixing of libstdc++ versions

Fixes #59832

Note: See TracTickets for help on using tickets.