Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#55415 closed defect (fixed)

cmake 3.10-12 does not build on PPC Tiger, Mac OS X 10.4.11

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: tiger Cc:
Port: cmake

Description

/opt/local/bin/gcc-mp-6 -pipe -Os -m32     -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities  -DCMAKE_BOOTSTRAP -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c -o uv-src-unix-core.c.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c: In function 'uv_os_unsetenv':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c:1292:7: error: void value not ignored as it ought to be
   if (unsetenv(name) != 0)
       ^~~~~~~~~~~~~~
gmake: *** [Makefile:384: uv-src-unix-core.c.o] Error 1
---------------------------------------------
Error when bootstrapping CMake:
Problem while running gmake
---------------------------------------------
Log of errors: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0" && ./configure --prefix=/opt/local --docdir=share/doc/cmake --parallel=1 --init=/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/macports.cmake --no-system-jsoncpp --no-system-librhash --no-system-libs --no-qt-gui 
Exit code: 9

Attachments (6)

main.log (197.7 KB) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
cmake_bootstrap.log (37.7 KB) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
patch-unsetenv@Tiger.diff (367 bytes) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
proposed patch file for Tiger's unsetenv()
patch-birthtime@Tiger.diff (592 bytes) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
Proposed patch for Tiger's unknown birthtime
Tiger-patch-libuv-src-unix-core.c.diff (534 bytes) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
To get a working unsetenv(), new version
Tiger-patch-libuv-src-unix-fs.c.diff (905 bytes) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
To get loose of birthtime member in struct

Download all attachments as: .zip

Change History (53)

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: cmake_bootstrap.log added

comment:1 Changed 6 years ago by Schamschula (Marius Schamschula)

Cc: michaelld@… removed
Owner: set to michaelld
Status: newassigned

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

try adding this and please report back

# fix build on Tiger
if { ${os.platform} eq "darwin" && ${os.major} == 8 } {
    configure.cxxflags-append -D__DARWIN_UNIX03
}
Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:3 in reply to:  2 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

My Portfile has two interesting ranges:

    147 # Tiger has issues with system libraries;
    148 # just use the ones internal to cmake instead.
    149 platform darwin 8 { 
    150     configure.args-delete --system-libs
    151     configure.args-append --no-system-libs
    152     depends_lib-delete \
    153         path:lib/pkgconfig/libuv.pc:libuv \
    154         port:curl \
    155         port:expat \
    156         port:zlib \
    157         port:bzip2 \
    158         port:libarchive \
    159         port:ncurses
    160 }

and

    173 platform darwin {
    174     # TODO: Figure out why using libc++ fails on Lion and fix the bootstrap
    175     #       script to honor CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET.
    176     #       Since nothing links against cmake and cmake is just using the STL,
    177     #       we're safe to force libstdc++
    178     #
    179     #       https://cmake.org/Bug/view.php?id=15039&nbn=16
    180     if {${os.major} < 12} {
    181         configure.cxx_stdlib libstdc++
    182     }
    183 }

I'll add the statement below line #151. Right now another update is going on…

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

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

has duplicate #55382

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

Oh, this is a different error, Michael. Peter is building this with gcc6 already, which supports c++11. This issue is a Tiger header thing. That statement should fix it.

comment:6 in reply to:  2 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

try adding this and please report back

The error is left:

/opt/local/bin/gcc-mp-6 -pipe -Os -m32     -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities  -DCMAKE_BOOTSTRAP -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c -o uv-src-unix-core.c.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c: In function 'uv_os_unsetenv':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c:1292:7: error: void value not ignored as it ought to be
   if (unsetenv(name) != 0)
       ^~~~~~~~~~~~~~
gmake: *** [Makefile:384: uv-src-unix-core.c.o] Error 1
---------------------------------------------

The pre-processor produces this code:

int uv_os_unsetenv(const char* name) {
  if (unsetenv(name) != 0)
    return -
# 1293 "Utilities/cmlibuv/src/unix/core.c" 3 4
           (*__error())
# 1293 "Utilities/cmlibuv/src/unix/core.c"
                ;

  return 0;
}

uv_os_unsetenv() is declared in

Utilities/cmlibuv/include/uv.h:UV_EXTERN int uv_os_setenv(const char* name, const char* value);
Utilities/cmlibuv/include/uv.h:UV_EXTERN int uv_os_unsetenv(const char* name);

They both overwrite the system's declarations.

comment:7 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

In the pre-processed output I find

int setenv(const char *, const char *, int) ;
...
void unsetenv(const char *);
# 260 "/usr/include/stdlib.h" 3 4

coming from

int	 setenv(const char *, const char *, int) __DARWIN_ALIAS(setenv);
...
#if __DARWIN_UNIX03
int	 unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
#else /* !__DARWIN_UNIX03 */
void	 unsetenv(const char *);
#endif /* __DARWIN_UNIX03 */

in /usr/include/stdlib.h. And cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c has

 1280	int uv_os_setenv(const char* name, const char* value) {
 1281	  if (name == NULL || value == NULL)
 1282	    return -EINVAL;
 1283	
 1284	  if (setenv(name, value, 1) != 0)
 1285	    return -errno;
 1286	
 1287	  return 0;
 1288	}
 1289	
 1290	
 1291	int uv_os_unsetenv(const char* name) {
 1292	  if (unsetenv(name) != 0)
 1293	    return -errno;
 1294	
 1295	  return 0;
 1296	}

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

OK. Thanks for trying. For now, I'd suggest you can peg at cmake 3.9.6 - it should work for many years to come. If you can sort out how to to fix this, that would be great! Otherwise I will dig into this error in due course on my Tiger machine.

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

I tried various things to fix this, but it's not as easy as the usual #define __DARWIN_UNIX03 fix. When you turn that on, other configuration things fail.

At the moment, changing the file

Utilities/cmlibuv/src/unix/core.c

to edit the way unsetenv is called seems most likely to work.

comment:10 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

With my patch core.c can be compiled:

/opt/local/bin/gcc-mp-6 -pipe -Os -m32     -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities  -DCMAKE_BOOTSTRAP -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c -o uv-src-unix-core.c.o
/opt/local/bin/gcc-mp-6 -pipe -Os -m32     -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities  -DCMAKE_BOOTSTRAP -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c -o uv-src-unix-fs.c.o

But this file reveals a new error:

/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c: In function 'uv__fs_scandir':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c:396:57: warning: passing argument 4 of 'scandir' from incompatible pointer type [-Wincompatible-pointer-types]
   n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort);
                                                         ^~~~~~~~~~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/include/uv-unix.h:28:0,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/include/uv.h:66,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c:29:
/usr/include/dirent.h:118:5: note: expected 'int (*)(const void *, const void *)' but argument is of type 'int (*)(uv__dirent_t **, uv__dirent_t **) {aka int (*)(struct dirent **, struct dirent **)}'
 int scandir(const char *, struct dirent ***,
     ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c: In function 'uv__fs_sendfile':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c:658:9: warning: implicit declaration of function 'sendfile' [-Wimplicit-function-declaration]
     r = sendfile(in_fd, out_fd, req->off, &len, NULL, 0);
         ^~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c: In function 'uv__to_stat':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c:798:32: error: 'struct stat' has no member named 'st_birthtimespec'; did you mean 'st_atimespec'?
   dst->st_birthtim.tv_sec = src->st_birthtimespec.tv_sec;
                                ^~
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c:799:33: error: 'struct stat' has no member named 'st_birthtimespec'; did you mean 'st_atimespec'?
   dst->st_birthtim.tv_nsec = src->st_birthtimespec.tv_nsec;
                                 ^~
gmake: *** [Makefile:386: uv-src-unix-fs.c.o] Error 1

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: patch-unsetenv@Tiger.diff added

proposed patch file for Tiger's unsetenv()

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

That's a good start.

One thing to ponder is how did cmlibuv build on Tiger in cmake 3.9.6, and could we use that to figure out how to make it build in 3.10.0; or maybe just steal the whole cmlibuv from 3.9.6 and use that in 3.10.0 on Tiger?

Maybe we could just diff the two folders (cmlibuv) and see what has changed to break it in 3.10.0.

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

comment:12 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

I looked at the use of *birthtime*. It only happens with archives (Cmake brings its own libarchive). Tiger has archive_entry.h which has the birthtimes declared. So the problem with birthtime not found in struct stat might be solved with the provided second patch file, patch-birthtime@Tiger.diff. At least fs.c gets now compiled. But a new error now happens:

/opt/local/bin/g++-mp-6 -L/opt/local/lib -Wl,-headerpad_max_install_names -framework CoreFoundation -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32      -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities  cmAddCustomCommandCommand.o cmAddCustomTargetCommand.o cmAddDefinitionsCommand.o cmAddDependenciesCommand.o cmAddExecutableCommand.o cmAddLibraryCommand.o cmAddSubDirectoryCommand.o cmAddTestCommand.o cmBreakCommand.o cmBuildCommand.o cmCMakeMinimumRequired.o cmCMakePolicyCommand.o cmCPackPropertiesGenerator.o cmCacheManager.o cmCommand.o cmCommandArgumentParserHelper.o cmCommandArgumentsHelper.o cmCommands.o cmCommonTargetGenerator.o cmComputeComponentGraph.o cmComputeLinkDepends.o cmComputeLinkInformation.o cmComputeTargetDepends.o cmConditionEvaluator.o cmConfigureFileCommand.o cmContinueCommand.o cmCoreTryCompile.o cmCreateTestSourceList.o cmCustomCommand.o cmCustomCommandGenerator.o cmDefinePropertyCommand.o cmDefinitions.o cmDepends.o cmDependsC.o cmDisallowedCommand.o cmDocumentationFormatter.o cmEnableLanguageCommand.o cmEnableTestingCommand.o cmExecProgramCommand.o cmExecuteProcessCommand.o cmExpandedCommandArgument.o cmExportBuildFileGenerator.o cmExportFileGenerator.o cmExportInstallFileGenerator.o cmExportSet.o cmExportSetMap.o cmExportTryCompileFileGenerator.o cmExprParserHelper.o cmExternalMakefileProjectGenerator.o cmFileCommand.o cmFileTimeComparison.o cmFindBase.o cmFindCommon.o cmFindFileCommand.o cmFindLibraryCommand.o cmFindPackageCommand.o cmFindPathCommand.o cmFindProgramCommand.o cmForEachCommand.o cmFunctionCommand.o cmGeneratedFileStream.o cmGeneratorExpression.o cmGeneratorExpressionContext.o cmGeneratorExpressionDAGChecker.o cmGeneratorExpressionEvaluationFile.o cmGeneratorExpressionEvaluator.o cmGeneratorExpressionLexer.o cmGeneratorExpressionNode.o cmGeneratorExpressionParser.o cmGeneratorTarget.o cmGetCMakePropertyCommand.o cmGetDirectoryPropertyCommand.o cmGetFilenameComponentCommand.o cmGetPropertyCommand.o cmGetSourceFilePropertyCommand.o cmGetTargetPropertyCommand.o cmGetTestPropertyCommand.o cmGlobalCommonGenerator.o cmGlobalGenerator.o cmGlobalUnixMakefileGenerator3.o cmHexFileConverter.o cmIfCommand.o cmIncludeCommand.o cmIncludeGuardCommand.o cmIncludeDirectoryCommand.o cmIncludeRegularExpressionCommand.o cmInstallCommand.o cmInstallCommandArguments.o cmInstallDirectoryGenerator.o cmInstallExportGenerator.o cmInstallFilesCommand.o cmInstallFilesGenerator.o cmInstallGenerator.o cmInstallScriptGenerator.o cmInstallTargetGenerator.o cmInstallTargetsCommand.o cmInstalledFile.o cmLinkDirectoriesCommand.o cmLinkLineComputer.o cmListCommand.o cmListFileCache.o cmLocalCommonGenerator.o cmLocalGenerator.o cmLocalUnixMakefileGenerator3.o cmMSVC60LinkLineComputer.o cmMacroCommand.o cmMakeDirectoryCommand.o cmMakefile.o cmMakefileExecutableTargetGenerator.o cmMakefileLibraryTargetGenerator.o cmMakefileTargetGenerator.o cmMakefileUtilityTargetGenerator.o cmMarkAsAdvancedCommand.o cmMathCommand.o cmMessageCommand.o cmMessenger.o cmNewLineStyle.o cmOSXBundleGenerator.o cmOptionCommand.o cmOrderDirectories.o cmOutputConverter.o cmParseArgumentsCommand.o cmPathLabel.o cmPolicies.o cmProcessOutput.o cmProjectCommand.o cmProperty.o cmPropertyDefinition.o cmPropertyDefinitionMap.o cmPropertyMap.o cmReturnCommand.o cmRulePlaceholderExpander.o cmScriptGenerator.o cmSearchPath.o cmSeparateArgumentsCommand.o cmSetCommand.o cmSetDirectoryPropertiesCommand.o cmSetPropertyCommand.o cmSetSourceFilesPropertiesCommand.o cmSetTargetPropertiesCommand.o cmSetTestsPropertiesCommand.o cmSiteNameCommand.o cmSourceFile.o cmSourceFileLocation.o cmState.o cmStateDirectory.o cmStateSnapshot.o cmStringCommand.o cmSubdirCommand.o cmSystemTools.o cmTarget.o cmTargetCompileDefinitionsCommand.o cmTargetCompileFeaturesCommand.o cmTargetCompileOptionsCommand.o cmTargetIncludeDirectoriesCommand.o cmTargetLinkLibrariesCommand.o cmTargetPropCommandBase.o cmTargetPropertyComputer.o cmTargetSourcesCommand.o cmTest.o cmTestGenerator.o cmTimestamp.o cmTryCompileCommand.o cmTryRunCommand.o cmUnexpectedCommand.o cmUnsetCommand.o cmVersion.o cmWhileCommand.o cmWorkingDirectory.o cmake.o cmakemain.o cmcmd.o cmCommandArgumentLexer.o cmCommandArgumentParser.o cmExprLexer.o cmExprParser.o cmListFileLexer.o Directory.o EncodingCXX.o FStream.o Glob.o RegularExpression.o SystemTools.o EncodingC.o ProcessUNIX.o String.o System.o Terminal.o uv-src-uv-common.c.o uv-src-unix-cmake-bootstrap.c.o uv-src-unix-core.c.o uv-src-unix-fs.c.o uv-src-unix-loop.c.o uv-src-unix-loop-watcher.c.o uv-src-unix-no-fsevents.c.o uv-src-unix-pipe.c.o uv-src-unix-poll.c.o uv-src-unix-posix-hrtime.c.o uv-src-unix-posix-poll.c.o uv-src-unix-process.c.o uv-src-unix-signal.c.o uv-src-unix-stream.c.o uv-src-unix-timer.c.o  -o cmake
ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o
Undefined symbols:
  "_sendfile", referenced from:
      _uv__fs_work in uv-src-unix-fs.c.o
     (maybe you meant: _uv_fs_sendfile)
ld: symbol(s) not found
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:2: cmake] Error 1

This might related to that warning:

/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c: In function 'uv__fs_sendfile':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c:658:9: warning: implicit declaration of function 'sendfile' [-Wimplicit-function-declaration]
     r = sendfile(in_fd, out_fd, req->off, &len, NULL, 0);
         ^~~~~~~~

Just a missing #include <sys/socket.h>?

I did not perform a diff on directories, just grepped for *birthtime*. The more accurate comparison of the two software versions I might perform some other day. (Or night.)

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: patch-birthtime@Tiger.diff added

Proposed patch for Tiger's unknown birthtime

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

getting there!

man sendfile says:

HISTORY
     The sendfile() system call first appeared in Darwin 9.0 (Mac OS X version
     10.5) .

so it will have to be reimplemented for Tiger.

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

Summary: cmake @3.10.0 does not build on PPC Tiger, Mac OS X 10.4.11, because error: void value not ignored as it ought to becmake @3.10.0 does not build on PPC Tiger, Mac OS X 10.4.11, due to various issues building libuv

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

we might be able to get an implementation of sendfile from here <https://elixir.free-electrons.com/linux/v3.10/source/fs/read_write.c>.

I wish I knew how to use autotools well enough to see how to get it to give us up a replacement function automatically. Edit: gnulib-tool does not have a replacement for sendfile, I suppose because it is implemented in the kernel and only referenced as a function definition in the headers and sources.

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

comment:16 in reply to:  11 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

That's a good start.

One thing to ponder is how did cmlibuv build on Tiger in cmake 3.9.6, and could we use that to figure out how to make it build in 3.10.0; or maybe just steal the whole cmlibuv from 3.9.6 and use that in 3.10.0 on Tiger?

Maybe we could just diff the two folders (cmlibuv) and see what has changed to break it in 3.10.0.

These are the changes (cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c ist a new file, possible related to the macro CMAKE_BOOTSTRAP):

 -rw-r--r-- kitware/staff     16305 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/include/uv-unix.h
 -rw-r--r-- kitware/staff     16008 Nov 10 13:28 2017 cmake-3.9.6/Utilities/cmlibuv/include/uv-unix.h
@@ -44,9 +44,7 @@
 
 #include "uv-threadpool.h"
 
-#ifdef CMAKE_BOOTSTRAP
-# include "uv-posix.h"
-#elif defined(__linux__)
+#if defined(__linux__)
 # include "uv-linux.h"
 #elif defined (__MVS__)
 # include "uv-os390.h"
@@ -126,17 +124,6 @@
 typedef int uv_os_sock_t;
 typedef int uv_os_fd_t;
 
-#ifdef CMAKE_BOOTSTRAP
-#define UV_ONCE_INIT 0
-typedef int uv_once_t;
-typedef int uv_thread_t;
-typedef int uv_mutex_t;
-typedef int uv_rwlock_t;
-typedef int uv_sem_t;
-typedef int uv_cond_t;
-typedef int uv_key_t;
-typedef int uv_barrier_t;
-#else
 #define UV_ONCE_INIT PTHREAD_ONCE_INIT
 
 typedef pthread_once_t uv_once_t;
@@ -147,7 +134,6 @@
 typedef pthread_cond_t uv_cond_t;
 typedef pthread_key_t uv_key_t;
 typedef pthread_barrier_t uv_barrier_t;
-#endif
 
 
 /* Platform-specific definitions for uv_spawn support. */
-----------------------------------------------------------------------------
 -rw-r--r-- kitware/staff      2570 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c
-----------------------------------------------------------------------------
 -rw-r--r-- kitware/staff     35961 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/src/unix/fs.c
 -rw-r--r-- kitware/staff     35931 Nov 10 13:28 2017 cmake-3.9.6/Utilities/cmlibuv/src/unix/fs.c
@@ -244,7 +244,7 @@
 #endif
 }
 
-#if defined(__sun) && (_XOPEN_SOURCE < 600 || defined(CMAKE_BOOTSTRAP))
+#if defined(__sun) && _XOPEN_SOURCE < 600
 static char* uv__mkdtemp(char *template)
 {
   if (!mktemp(template) || mkdir(template, 0700))
-----------------------------------------------------------------------------
 -rw-r--r-- kitware/staff     12011 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/src/unix/internal.h
 -rw-r--r-- kitware/staff     11534 Nov 10 13:28 2017 cmake-3.9.6/Utilities/cmlibuv/src/unix/internal.h
@@ -59,17 +59,7 @@
 # include <AvailabilityMacros.h>
 #endif
 
-#if defined(CMAKE_BOOTSTRAP)
-# undef pthread_atfork
-# define pthread_atfork(prepare, parent, child) \
-     uv__pthread_atfork(prepare, parent, child)
-int uv__pthread_atfork(void (*prepare)(void), void (*parent)(void),
-                       void (*child)(void));
-# undef pthread_sigmask
-# define pthread_sigmask(how, set, oldset) \
-     uv__pthread_sigmask(how, set, oldset)
-int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset);
-#elif defined(__ANDROID__)
+#if defined(__ANDROID__)
 int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset);
 # ifdef pthread_sigmask
 # undef pthread_sigmask
@@ -271,7 +261,7 @@
 int uv__getpwuid_r(uv_passwd_t* pwd);
 
 
-#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP)
+#if defined(__APPLE__)
 int uv___stream_fd(const uv_stream_t* handle);
 #define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t*) (handle)))
 #else
-----------------------------------------------------------------------------
 -rw-r--r-- kitware/staff      7822 Nov 10 13:28 2017 cmake-3.9.6/Utilities/cmlibuv/src/unix/pipe.c
 -rw-r--r-- kitware/staff      7851 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/src/unix/pipe.c
@@ -136,7 +136,7 @@
   if (err)
     return err;
 
-#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP)
+#if defined(__APPLE__)
   err = uv__stream_try_select((uv_stream_t*) handle, &fd);
   if (err)
     return err;
-----------------------------------------------------------------------------
 -rw-r--r-- kitware/staff      2004 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/src/unix/posix-hrtime.c
 -rw-r--r-- kitware/staff      1433 Nov 10 13:28 2017 cmake-3.9.6/Utilities/cmlibuv/src/unix/posix-hrtime.c
@@ -22,29 +22,6 @@
 #include "uv.h"
 #include "internal.h"
 
-#if defined(__APPLE__)
-/* Special case for CMake bootstrap: no clock_gettime on macOS < 10.12 */
-
-#ifndef CMAKE_BOOTSTRAP
-#error "This code path meant only for use during CMake bootstrap."
-#endif
-
-#include <mach/mach.h>
-#include <mach/mach_time.h>
-
-uint64_t uv__hrtime(uv_clocktype_t type) {
-  static mach_timebase_info_data_t info;
-
-  if ((ACCESS_ONCE(uint32_t, info.numer) == 0 ||
-       ACCESS_ONCE(uint32_t, info.denom) == 0) &&
-      mach_timebase_info(&info) != KERN_SUCCESS)
-    abort();
-
-  return mach_absolute_time() * info.numer / info.denom;
-}
-
-#else
-
 #include <stdint.h>
 #include <time.h>
 
@@ -56,5 +33,3 @@
   clock_gettime(CLOCK_MONOTONIC, &ts);
   return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
 }
-
-#endif
-----------------------------------------------------------------------------
 -rw-r--r-- kitware/staff     43748 Nov 10 13:28 2017 cmake-3.9.6/Utilities/cmlibuv/src/unix/stream.c
 -rw-r--r-- kitware/staff     43893 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/src/unix/stream.c
@@ -98,7 +98,7 @@
       loop->emfile_fd = err;
   }
 
-#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP)
+#if defined(__APPLE__)
   stream->select = NULL;
 #endif /* defined(__APPLE_) */
 
@@ -107,7 +107,7 @@
 
 
 static void uv__stream_osx_interrupt_select(uv_stream_t* stream) {
-#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP)
+#if defined(__APPLE__)
   /* Notify select() thread about state change */
   uv__stream_select_t* s;
   int r;
@@ -131,7 +131,7 @@
 }
 
 
-#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP)
+#if defined(__APPLE__)
 static void uv__stream_osx_select(void* arg) {
   uv_stream_t* stream;
   uv__stream_select_t* s;
@@ -1598,7 +1598,7 @@
 }
 
 
-#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP)
+#if defined(__APPLE__)
 int uv___stream_fd(const uv_stream_t* handle) {
   const uv__stream_select_t* s;
 
@@ -1619,7 +1619,7 @@
   unsigned int i;
   uv__stream_queued_fds_t* queued_fds;
 
-#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP)
+#if defined(__APPLE__)
   /* Terminate select loop first */
   if (handle->select != NULL) {
     uv__stream_select_t* s;
-----------------------------------------------------------------------------
 -rw-r--r-- kitware/staff     15117 Nov 10 13:28 2017 cmake-3.9.6/Utilities/cmlibuv/src/uv-common.c
 -rw-r--r-- kitware/staff     15173 Nov 20 16:19 2017 cmake-3.10.0/Utilities/cmlibuv/src/uv-common.c
@@ -19,236 +19,646 @@
  * IN THE SOFTWARE.
  */
 
-/*
- * This file is private to libuv. It provides common functionality to both
- * Windows and Unix backends.
- */
-
-#ifndef UV_COMMON_H_
-#define UV_COMMON_H_
+#include "uv.h"
+#include "uv-common.h"
 
 #include <assert.h>
+#include <errno.h>
 #include <stdarg.h>
-#include <stddef.h>
+#include <stddef.h> /* NULL */
+#include <stdio.h>
+#include <stdlib.h> /* malloc */
+#include <string.h> /* memset */
 
-#if defined(_MSC_VER) && _MSC_VER < 1600
-# include "stdint-msvc2008.h"
+#if defined(_WIN32)
+# include <malloc.h> /* malloc */
 #else
-# include <stdint.h>
+# include <net/if.h> /* if_nametoindex */
 #endif
 
-#include "uv.h"
-#include "tree.h"
-#include "queue.h"
 
-#if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900
-extern int snprintf(char*, size_t, const char*, ...);
+typedef struct {
+  uv_malloc_func local_malloc;
+  uv_realloc_func local_realloc;
+  uv_calloc_func local_calloc;
+  uv_free_func local_free;
+} uv__allocator_t;
+
+static uv__allocator_t uv__allocator = {
+  malloc,
+  realloc,
+  calloc,
+  free,
+};
+
+char* uv__strdup(const char* s) {
+  size_t len = strlen(s) + 1;
+  char* m = uv__malloc(len);
+  if (m == NULL)
+    return NULL;
+  return memcpy(m, s, len);
+}
+
+char* uv__strndup(const char* s, size_t n) {
+  char* m;
+  size_t len = strlen(s);
+  if (n < len)
+    len = n;
+  m = uv__malloc(len + 1);
+  if (m == NULL)
+    return NULL;
+  m[len] = '\0';
+  return memcpy(m, s, len);
+}
+
+void* uv__malloc(size_t size) {
+  return uv__allocator.local_malloc(size);
+}
+
+void uv__free(void* ptr) {
+  int saved_errno;
+
+  /* Libuv expects that free() does not clobber errno.  The system allocator
+   * honors that assumption but custom allocators may not be so careful.
+   */
+  saved_errno = errno;
+  uv__allocator.local_free(ptr);
+  errno = saved_errno;
+}
+
+void* uv__calloc(size_t count, size_t size) {
+  return uv__allocator.local_calloc(count, size);
+}
+
+void* uv__realloc(void* ptr, size_t size) {
+  return uv__allocator.local_realloc(ptr, size);
+}
+
+int uv_replace_allocator(uv_malloc_func malloc_func,
+                         uv_realloc_func realloc_func,
+                         uv_calloc_func calloc_func,
+                         uv_free_func free_func) {
+  if (malloc_func == NULL || realloc_func == NULL ||
+      calloc_func == NULL || free_func == NULL) {
+    return UV_EINVAL;
+  }
+
+  uv__allocator.local_malloc = malloc_func;
+  uv__allocator.local_realloc = realloc_func;
+  uv__allocator.local_calloc = calloc_func;
+  uv__allocator.local_free = free_func;
+
+  return 0;
+}
+
+#define XX(uc, lc) case UV_##uc: return sizeof(uv_##lc##_t);
+
+size_t uv_handle_size(uv_handle_type type) {
+  switch (type) {
+    UV_HANDLE_TYPE_MAP(XX)
+    default:
+      return -1;
+  }
+}
+
+size_t uv_req_size(uv_req_type type) {
+  switch(type) {
+    UV_REQ_TYPE_MAP(XX)
+    default:
+      return -1;
+  }
+}
+
+#undef XX
+
+
+size_t uv_loop_size(void) {
+  return sizeof(uv_loop_t);
+}
+
+
+uv_buf_t uv_buf_init(char* base, unsigned int len) {
+  uv_buf_t buf;
+  buf.base = base;
+  buf.len = len;
+  return buf;
+}
+
+
+static const char* uv__unknown_err_code(int err) {
+  char buf[32];
+  char* copy;
+
+  snprintf(buf, sizeof(buf), "Unknown system error %d", err);
+  copy = uv__strdup(buf);
+
+  return copy != NULL ? copy : "Unknown system error";
+}
+
+
+#define UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name;
+const char* uv_err_name(int err) {
+  switch (err) {
+    UV_ERRNO_MAP(UV_ERR_NAME_GEN)
+  }
+  return uv__unknown_err_code(err);
+}
+#undef UV_ERR_NAME_GEN
+
+
+#define UV_STRERROR_GEN(name, msg) case UV_ ## name: return msg;
+const char* uv_strerror(int err) {
+  switch (err) {
+    UV_ERRNO_MAP(UV_STRERROR_GEN)
+  }
+  return uv__unknown_err_code(err);
+}
+#undef UV_STRERROR_GEN
+
+
+int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr) {
+  memset(addr, 0, sizeof(*addr));
+  addr->sin_family = AF_INET;
+  addr->sin_port = htons(port);
+  return uv_inet_pton(AF_INET, ip, &(addr->sin_addr.s_addr));
+}
+
+
+int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) {
+  char address_part[40];
+  size_t address_part_size;
+  const char* zone_index;
+
+  memset(addr, 0, sizeof(*addr));
+  addr->sin6_family = AF_INET6;
+  addr->sin6_port = htons(port);
+
+  zone_index = strchr(ip, '%');
+  if (zone_index != NULL) {
+    address_part_size = zone_index - ip;
+    if (address_part_size >= sizeof(address_part))
+      address_part_size = sizeof(address_part) - 1;
+
+    memcpy(address_part, ip, address_part_size);
+    address_part[address_part_size] = '\0';
+    ip = address_part;
+
+    zone_index++; /* skip '%' */
+    /* NOTE: unknown interface (id=0) is silently ignored */
+#ifdef _WIN32
+    addr->sin6_scope_id = atoi(zone_index);
+#else
+    addr->sin6_scope_id = if_nametoindex(zone_index);
 #endif
+  }
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+  return uv_inet_pton(AF_INET6, ip, &addr->sin6_addr);
+}
 
-#define container_of(ptr, type, member) \
-  ((type *) ((char *) (ptr) - offsetof(type, member)))
 
-#define STATIC_ASSERT(expr)                                                   \
-  void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)])
+int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size) {
+  return uv_inet_ntop(AF_INET, &src->sin_addr, dst, size);
+}
 
-#ifndef _WIN32
-enum {
-  UV__SIGNAL_ONE_SHOT = 0x80000,  /* On signal reception remove sighandler */
-  UV__HANDLE_INTERNAL = 0x8000,
-  UV__HANDLE_ACTIVE   = 0x4000,
-  UV__HANDLE_REF      = 0x2000,
-  UV__HANDLE_CLOSING  = 0 /* no-op on unix */
-};
-#else
-# define UV__SIGNAL_ONE_SHOT_DISPATCHED   0x200
-# define UV__SIGNAL_ONE_SHOT              0x100
-# define UV__HANDLE_INTERNAL              0x80
-# define UV__HANDLE_ACTIVE                0x40
-# define UV__HANDLE_REF                   0x20
-# define UV__HANDLE_CLOSING               0x01
-#endif
 
-int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
+int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size) {
+  return uv_inet_ntop(AF_INET6, &src->sin6_addr, dst, size);
+}
+
+
+int uv_tcp_bind(uv_tcp_t* handle,
+                const struct sockaddr* addr,
+                unsigned int flags) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_TCP)
+    return UV_EINVAL;
 
-void uv__loop_close(uv_loop_t* loop);
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
 
-int uv__tcp_bind(uv_tcp_t* tcp,
-                 const struct sockaddr* addr,
-                 unsigned int addrlen,
-                 unsigned int flags);
+  return uv__tcp_bind(handle, addr, addrlen, flags);
+}
 
-int uv__tcp_connect(uv_connect_t* req,
+
+int uv_udp_bind(uv_udp_t* handle,
+                const struct sockaddr* addr,
+                unsigned int flags) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__udp_bind(handle, addr, addrlen, flags);
+}
+
+
+int uv_tcp_connect(uv_connect_t* req,
                    uv_tcp_t* handle,
                    const struct sockaddr* addr,
-                   unsigned int addrlen,
-                   uv_connect_cb cb);
+                   uv_connect_cb cb) {
+  unsigned int addrlen;
 
-int uv__udp_bind(uv_udp_t* handle,
-                 const struct sockaddr* addr,
-                 unsigned int  addrlen,
-                 unsigned int flags);
-
-int uv__udp_send(uv_udp_send_t* req,
-                 uv_udp_t* handle,
-                 const uv_buf_t bufs[],
-                 unsigned int nbufs,
-                 const struct sockaddr* addr,
-                 unsigned int addrlen,
-                 uv_udp_send_cb send_cb);
-
-int uv__udp_try_send(uv_udp_t* handle,
-                     const uv_buf_t bufs[],
-                     unsigned int nbufs,
-                     const struct sockaddr* addr,
-                     unsigned int addrlen);
-
-int uv__udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloccb,
-                       uv_udp_recv_cb recv_cb);
-
-int uv__udp_recv_stop(uv_udp_t* handle);
-
-void uv__fs_poll_close(uv_fs_poll_t* handle);
-
-int uv__getaddrinfo_translate_error(int sys_err);    /* EAI_* error. */
-
-void uv__work_submit(uv_loop_t* loop,
-                     struct uv__work *w,
-                     void (*work)(struct uv__work *w),
-                     void (*done)(struct uv__work *w, int status));
-
-void uv__work_done(uv_async_t* handle);
-
-size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs);
-
-int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value);
-
-void uv__fs_scandir_cleanup(uv_fs_t* req);
-
-#define uv__has_active_reqs(loop)                                             \
-  (QUEUE_EMPTY(&(loop)->active_reqs) == 0)
-
-#define uv__req_register(loop, req)                                           \
-  do {                                                                        \
-    QUEUE_INSERT_TAIL(&(loop)->active_reqs, &(req)->active_queue);            \
-  }                                                                           \
-  while (0)
-
-#define uv__req_unregister(loop, req)                                         \
-  do {                                                                        \
-    assert(uv__has_active_reqs(loop));                                        \
-    QUEUE_REMOVE(&(req)->active_queue);                                       \
-  }                                                                           \
-  while (0)
-
-#define uv__has_active_handles(loop)                                          \
-  ((loop)->active_handles > 0)
-
-#define uv__active_handle_add(h)                                              \
-  do {                                                                        \
-    (h)->loop->active_handles++;                                              \
-  }                                                                           \
-  while (0)
-
-#define uv__active_handle_rm(h)                                               \
-  do {                                                                        \
-    (h)->loop->active_handles--;                                              \
-  }                                                                           \
-  while (0)
-
-#define uv__is_active(h)                                                      \
-  (((h)->flags & UV__HANDLE_ACTIVE) != 0)
-
-#define uv__is_closing(h)                                                     \
-  (((h)->flags & (UV_CLOSING |  UV_CLOSED)) != 0)
-
-#define uv__handle_start(h)                                                   \
-  do {                                                                        \
-    assert(((h)->flags & UV__HANDLE_CLOSING) == 0);                           \
-    if (((h)->flags & UV__HANDLE_ACTIVE) != 0) break;                         \
-    (h)->flags |= UV__HANDLE_ACTIVE;                                          \
-    if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_add(h);         \
-  }                                                                           \
-  while (0)
-
-#define uv__handle_stop(h)                                                    \
-  do {                                                                        \
-    assert(((h)->flags & UV__HANDLE_CLOSING) == 0);                           \
-    if (((h)->flags & UV__HANDLE_ACTIVE) == 0) break;                         \
-    (h)->flags &= ~UV__HANDLE_ACTIVE;                                         \
-    if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_rm(h);          \
-  }                                                                           \
-  while (0)
-
-#define uv__handle_ref(h)                                                     \
-  do {                                                                        \
-    if (((h)->flags & UV__HANDLE_REF) != 0) break;                            \
-    (h)->flags |= UV__HANDLE_REF;                                             \
-    if (((h)->flags & UV__HANDLE_CLOSING) != 0) break;                        \
-    if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_add(h);      \
-  }                                                                           \
-  while (0)
-
-#define uv__handle_unref(h)                                                   \
-  do {                                                                        \
-    if (((h)->flags & UV__HANDLE_REF) == 0) break;                            \
-    (h)->flags &= ~UV__HANDLE_REF;                                            \
-    if (((h)->flags & UV__HANDLE_CLOSING) != 0) break;                        \
-    if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_rm(h);       \
-  }                                                                           \
-  while (0)
+  if (handle->type != UV_TCP)
+    return UV_EINVAL;
 
-#define uv__has_ref(h)                                                        \
-  (((h)->flags & UV__HANDLE_REF) != 0)
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
 
-#if defined(_WIN32)
-# define uv__handle_platform_init(h) ((h)->u.fd = -1)
+  return uv__tcp_connect(req, handle, addr, addrlen, cb);
+}
+
+
+int uv_udp_send(uv_udp_send_t* req,
+                uv_udp_t* handle,
+                const uv_buf_t bufs[],
+                unsigned int nbufs,
+                const struct sockaddr* addr,
+                uv_udp_send_cb send_cb) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__udp_send(req, handle, bufs, nbufs, addr, addrlen, send_cb);
+}
+
+
+int uv_udp_try_send(uv_udp_t* handle,
+                    const uv_buf_t bufs[],
+                    unsigned int nbufs,
+                    const struct sockaddr* addr) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__udp_try_send(handle, bufs, nbufs, addr, addrlen);
+}
+
+
+int uv_udp_recv_start(uv_udp_t* handle,
+                      uv_alloc_cb alloc_cb,
+                      uv_udp_recv_cb recv_cb) {
+  if (handle->type != UV_UDP || alloc_cb == NULL || recv_cb == NULL)
+    return UV_EINVAL;
+  else
+    return uv__udp_recv_start(handle, alloc_cb, recv_cb);
+}
+
+
+int uv_udp_recv_stop(uv_udp_t* handle) {
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+  else
+    return uv__udp_recv_stop(handle);
+}
+
+
+void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) {
+  QUEUE queue;
+  QUEUE* q;
+  uv_handle_t* h;
+
+  QUEUE_MOVE(&loop->handle_queue, &queue);
+  while (!QUEUE_EMPTY(&queue)) {
+    q = QUEUE_HEAD(&queue);
+    h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+
+    QUEUE_REMOVE(q);
+    QUEUE_INSERT_TAIL(&loop->handle_queue, q);
+
+    if (h->flags & UV__HANDLE_INTERNAL) continue;
+    walk_cb(h, arg);
+  }
+}
+
+
+static void uv__print_handles(uv_loop_t* loop, int only_active, FILE* stream) {
+  const char* type;
+  QUEUE* q;
+  uv_handle_t* h;
+
+  if (loop == NULL)
+    loop = uv_default_loop();
+
+  QUEUE_FOREACH(q, &loop->handle_queue) {
+    h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+
+    if (only_active && !uv__is_active(h))
+      continue;
+
+    switch (h->type) {
+#define X(uc, lc) case UV_##uc: type = #lc; break;
+      UV_HANDLE_TYPE_MAP(X)
+#undef X
+      default: type = "<unknown>";
+    }
+
+    fprintf(stream,
+            "[%c%c%c] %-8s %p\n",
+            "R-"[!(h->flags & UV__HANDLE_REF)],
+            "A-"[!(h->flags & UV__HANDLE_ACTIVE)],
+            "I-"[!(h->flags & UV__HANDLE_INTERNAL)],
+            type,
+            (void*)h);
+  }
+}
+
+
+void uv_print_all_handles(uv_loop_t* loop, FILE* stream) {
+  uv__print_handles(loop, 0, stream);
+}
+
+
+void uv_print_active_handles(uv_loop_t* loop, FILE* stream) {
+  uv__print_handles(loop, 1, stream);
+}
+
+
+void uv_ref(uv_handle_t* handle) {
+  uv__handle_ref(handle);
+}
+
+
+void uv_unref(uv_handle_t* handle) {
+  uv__handle_unref(handle);
+}
+
+
+int uv_has_ref(const uv_handle_t* handle) {
+  return uv__has_ref(handle);
+}
+
+
+void uv_stop(uv_loop_t* loop) {
+  loop->stop_flag = 1;
+}
+
+
+uint64_t uv_now(const uv_loop_t* loop) {
+  return loop->time;
+}
+
+
+
+size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs) {
+  unsigned int i;
+  size_t bytes;
+
+  bytes = 0;
+  for (i = 0; i < nbufs; i++)
+    bytes += (size_t) bufs[i].len;
+
+  return bytes;
+}
+
+int uv_recv_buffer_size(uv_handle_t* handle, int* value) {
+  return uv__socket_sockopt(handle, SO_RCVBUF, value);
+}
+
+int uv_send_buffer_size(uv_handle_t* handle, int *value) {
+  return uv__socket_sockopt(handle, SO_SNDBUF, value);
+}
+
+int uv_fs_event_getpath(uv_fs_event_t* handle, char* buffer, size_t* size) {
+  size_t required_len;
+
+  if (!uv__is_active(handle)) {
+    *size = 0;
+    return UV_EINVAL;
+  }
+
+  required_len = strlen(handle->path);
+  if (required_len >= *size) {
+    *size = required_len + 1;
+    return UV_ENOBUFS;
+  }
+
+  memcpy(buffer, handle->path, required_len);
+  *size = required_len;
+  buffer[required_len] = '\0';
+
+  return 0;
+}
+
+/* The windows implementation does not have the same structure layout as
+ * the unix implementation (nbufs is not directly inside req but is
+ * contained in a nested union/struct) so this function locates it.
+*/
+static unsigned int* uv__get_nbufs(uv_fs_t* req) {
+#ifdef _WIN32
+  return &req->fs.info.nbufs;
 #else
-# define uv__handle_platform_init(h) ((h)->next_closing = NULL)
+  return &req->nbufs;
 #endif
+}
 
-#define uv__handle_init(loop_, h, type_)                                      \
-  do {                                                                        \
-    (h)->loop = (loop_);                                                      \
-    (h)->type = (type_);                                                      \
-    (h)->flags = UV__HANDLE_REF;  /* Ref the loop when active. */             \
-    QUEUE_INSERT_TAIL(&(loop_)->handle_queue, &(h)->handle_queue);            \
-    uv__handle_platform_init(h);                                              \
-  }                                                                           \
-  while (0)
+/* uv_fs_scandir() uses the system allocator to allocate memory on non-Windows
+ * systems. So, the memory should be released using free(). On Windows,
+ * uv__malloc() is used, so use uv__free() to free memory.
+*/
+#ifdef _WIN32
+# define uv__fs_scandir_free uv__free
+#else
+# define uv__fs_scandir_free free
+#endif
 
-/* Note: uses an open-coded version of SET_REQ_SUCCESS() because of
- * a circular dependency between src/uv-common.h and src/win/internal.h.
- */
-#if defined(_WIN32)
-# define UV_REQ_INIT(req, typ)                                                \
-  do {                                                                        \
-    (req)->type = (typ);                                                      \
-    (req)->u.io.overlapped.Internal = 0;  /* SET_REQ_SUCCESS() */             \
-  }                                                                           \
-  while (0)
+void uv__fs_scandir_cleanup(uv_fs_t* req) {
+  uv__dirent_t** dents;
+
+  unsigned int* nbufs = uv__get_nbufs(req);
+
+  dents = req->ptr;
+  if (*nbufs > 0 && *nbufs != (unsigned int) req->result)
+    (*nbufs)--;
+  for (; *nbufs < (unsigned int) req->result; (*nbufs)++)
+    uv__fs_scandir_free(dents[*nbufs]);
+
+  uv__fs_scandir_free(req->ptr);
+  req->ptr = NULL;
+}
+
+
+int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) {
+  uv__dirent_t** dents;
+  uv__dirent_t* dent;
+  unsigned int* nbufs;
+
+  /* Check to see if req passed */
+  if (req->result < 0)
+    return req->result;
+
+  /* Ptr will be null if req was canceled or no files found */
+  if (!req->ptr)
+    return UV_EOF;
+
+  nbufs = uv__get_nbufs(req);
+  assert(nbufs);
+
+  dents = req->ptr;
+
+  /* Free previous entity */
+  if (*nbufs > 0)
+    uv__fs_scandir_free(dents[*nbufs - 1]);
+
+  /* End was already reached */
+  if (*nbufs == (unsigned int) req->result) {
+    uv__fs_scandir_free(dents);
+    req->ptr = NULL;
+    return UV_EOF;
+  }
+
+  dent = dents[(*nbufs)++];
+
+  ent->name = dent->d_name;
+#ifdef HAVE_DIRENT_TYPES
+  switch (dent->d_type) {
+    case UV__DT_DIR:
+      ent->type = UV_DIRENT_DIR;
+      break;
+    case UV__DT_FILE:
+      ent->type = UV_DIRENT_FILE;
+      break;
+    case UV__DT_LINK:
+      ent->type = UV_DIRENT_LINK;
+      break;
+    case UV__DT_FIFO:
+      ent->type = UV_DIRENT_FIFO;
+      break;
+    case UV__DT_SOCKET:
+      ent->type = UV_DIRENT_SOCKET;
+      break;
+    case UV__DT_CHAR:
+      ent->type = UV_DIRENT_CHAR;
+      break;
+    case UV__DT_BLOCK:
+      ent->type = UV_DIRENT_BLOCK;
+      break;
+    default:
+      ent->type = UV_DIRENT_UNKNOWN;
+  }
 #else
-# define UV_REQ_INIT(req, typ)                                                \
-  do {                                                                        \
-    (req)->type = (typ);                                                      \
-  }                                                                           \
-  while (0)
-#endif
-
-#define uv__req_init(loop, req, typ)                                          \
-  do {                                                                        \
-    UV_REQ_INIT(req, typ);                                                    \
-    uv__req_register(loop, req);                                              \
-  }                                                                           \
-  while (0)
-
-/* Allocator prototypes */
-void *uv__calloc(size_t count, size_t size);
-char *uv__strdup(const char* s);
-char *uv__strndup(const char* s, size_t n);
-void* uv__malloc(size_t size);
-void uv__free(void* ptr);
-void* uv__realloc(void* ptr, size_t size);
+  ent->type = UV_DIRENT_UNKNOWN;
+#endif
+
+  return 0;
+}
+
+
+int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...) {
+  va_list ap;
+  int err;
+
+  va_start(ap, option);
+  /* Any platform-agnostic options should be handled here. */
+  err = uv__loop_configure(loop, option, ap);
+  va_end(ap);
+
+  return err;
+}
+
+
+static uv_loop_t default_loop_struct;
+static uv_loop_t* default_loop_ptr;
+
+
+uv_loop_t* uv_default_loop(void) {
+  if (default_loop_ptr != NULL)
+    return default_loop_ptr;
+
+  if (uv_loop_init(&default_loop_struct))
+    return NULL;
+
+  default_loop_ptr = &default_loop_struct;
+  return default_loop_ptr;
+}
+
+
+uv_loop_t* uv_loop_new(void) {
+  uv_loop_t* loop;
+
+  loop = uv__malloc(sizeof(*loop));
+  if (loop == NULL)
+    return NULL;
+
+  if (uv_loop_init(loop)) {
+    uv__free(loop);
+    return NULL;
+  }
+
+  return loop;
+}
+
+
+int uv_loop_close(uv_loop_t* loop) {
+  QUEUE* q;
+  uv_handle_t* h;
+#ifndef NDEBUG
+  void* saved_data;
+#endif
+
+  if (!QUEUE_EMPTY(&(loop)->active_reqs))
+    return UV_EBUSY;
+
+  QUEUE_FOREACH(q, &loop->handle_queue) {
+    h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+    if (!(h->flags & UV__HANDLE_INTERNAL))
+      return UV_EBUSY;
+  }
+
+  uv__loop_close(loop);
+
+#ifndef NDEBUG
+  saved_data = loop->data;
+  memset(loop, -1, sizeof(*loop));
+  loop->data = saved_data;
+#endif
+  if (loop == default_loop_ptr)
+    default_loop_ptr = NULL;
+
+  return 0;
+}
+
+
+void uv_loop_delete(uv_loop_t* loop) {
+  uv_loop_t* default_loop;
+  int err;
+
+  default_loop = default_loop_ptr;
 
-#endif /* UV_COMMON_H_ */
+  err = uv_loop_close(loop);
+  (void) err;    /* Squelch compiler warnings. */
+  assert(err == 0);
+  if (loop != default_loop)
+    uv__free(loop);
+}

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

well, if you're feeling lucky, you might just whack that whole thing in as a giant patch (with the right patchlevel sorted out) and see if it "just works" after that.

comment:18 in reply to:  17 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

well, if you're feeling lucky, you might just whack that whole thing in as a giant patch (with the right patchlevel sorted out) and see if it "just works" after that.

I'm not lucky…

Kind of resetting CMake's own version ob libuv leads to an error:

/opt/local/bin/gcc-mp-6 -pipe -Os -m32     -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities  -DCMAKE_BOOTSTRAP -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c -o uv-src-unix-cmake-bootstrap.c.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c: In function 'uv_once':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c:99:7: error: used struct type value where scalar is required
   if (*guard) {
       ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c:102:10: error: incompatible types when assigning to type 'uv_once_t {aka struct _opaque_pthread_once_t}' from type 'int'
   *guard = 1;
          ^
gmake: *** [Makefile:382: uv-src-unix-cmake-bootstrap.c.o] Error 1

The problem seams to be that guard is nowhere declared:

cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c:98:void uv_once(uv_once_t* guard, void (*callback)(void)) {
cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c:99:  if (*guard) {
cmake-3.10.0/Utilities/cmlibuv/src/unix/cmake-bootstrap.c:102:  *guard = 1;
cmake-3.10.0/Utilities/cmlibuv/src/unix/thread.c:216:void uv_once(uv_once_t* guard, void (*callback)(void)) {
cmake-3.10.0/Utilities/cmlibuv/src/unix/thread.c:217:  if (pthread_once(guard, callback))
cmake-3.10.0/Utilities/cmlibuv/src/win/thread.c:49:static void uv__once_inner(uv_once_t* guard, void (*callback)(void)) {
cmake-3.10.0/Utilities/cmlibuv/src/win/thread.c:59:  existing_event = InterlockedCompareExchangePointer(&guard->event,
cmake-3.10.0/Utilities/cmlibuv/src/win/thread.c:69:    guard->ran = 1;
cmake-3.10.0/Utilities/cmlibuv/src/win/thread.c:81:void uv_once(uv_once_t* guard, void (*callback)(void)) {
cmake-3.10.0/Utilities/cmlibuv/src/win/thread.c:83:  if (guard->ran) {
cmake-3.10.0/Utilities/cmlibuv/src/win/thread.c:87:  uv__once_inner(guard, callback);

just inherently defined and used… The type of uv_once_t is defined as:

typedef pthread_once_t uv_once_t;

Which can be resolved in steps to:

typedef __darwin_pthread_once_t pthread_once_t;
typedef struct _opaque_pthread_once_t
   __darwin_pthread_once_t;
struct _opaque_pthread_once_t { long __sig; char __opaque[4]; };

I've taken this from the pre-processed file. *I* have no idea why GCC 6 sees here an int.

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

also applies to v3.10.1. Has duplicate 55578

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

Summary: cmake @3.10.0 does not build on PPC Tiger, Mac OS X 10.4.11, due to various issues building libuvcmake @3.10.1 does not build on PPC Tiger, Mac OS X 10.4.11, due to various issues building libuv

comment:21 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

CMake's Portfile has for El Capitan, or all Darwin versions, the configure option --system-libs (line # 152). This is withdrawn for Tiger (line # 152). Couldn't this be as well used for Tiger, in case libuv could be built on Tiger? (See #53143 and #55594)

comment:22 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

I started a request on the libuv mailing list to enhance the code in order to handle the special Tiger case.

comment:23 in reply to:  2 ; Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

try adding this and please report back

# fix build on Tiger
if { ${os.platform} eq "darwin" && ${os.major} == 8 } {
    configure.cxxflags-append -D__DARWIN_UNIX03
}

I started to test again, since this libuv failure makes upgrading the ports a bit complicated. Portfilehas already

    166 platform darwin 8 {
    167     configure.args-delete --system-libs
    168     configure.args-append --no-system-libs

so one can add

    169     configure.cppflags-append -D__DARWIN_UNIX03

but this change leads to exactly the same build failure, no change. So it's likely that the function using unsetenv{} needs a fix.

In #55145 this fix for Kerberos is featured:

-    if (unsetenv(KRB5_ENV_CCNAME) != 0) {
-        retval = errno;
-        com_err(prog_name, retval, _("while clearing the value of %s"),
-                KRB5_ENV_CCNAME);
-        return retval;
-    }

In Tiger the if clause compares a void() with an integer. If the compiler accepts this type mismatch then the result must be true – something (undefined?) will almost never equal 0. So the code block is entered. Where comes errno from? Does it need (local, inside the function) declaration? Or is there some automatism at work?

The original funtion in cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c is:

int uv_os_unsetenv(const char* name) {
  if (unsetenv(name) != 0)
    return -errno;

  return 0;
}

which looks quite similar, and the error repored by GCC 6 is:

error: void value not ignored as it ought to be

I presume this report will continue to exist…

comment:24 in reply to:  23 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Now, this is fascinating! Using

    169     configure.cflags-append -D__DARWIN_UNIX03

instead of

    169     configure.cppflags-append -D__DARWIN_UNIX03

in Portfile leads to

/opt/local/bin/gcc-mp-6 -pipe -Os -D__DARWIN_UNIX03 -m32     -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities  -DCMAKE_BOOTSTRAP -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/core.c -o uv-src-unix-core.c.o
/opt/local/bin/gcc-mp-6 -pipe -Os -D__DARWIN_UNIX03 -m32     -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities  -DCMAKE_BOOTSTRAP -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c -o uv-src-unix-fs.c.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c: In function 'uv__fs_scandir':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c:396:57: warning: passing argument 4 of 'scandir' from incompatible pointer type [-Wincompatible-pointer-types]
   n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort);
                                                         ^~~~~~~~~~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/include/uv-unix.h:28:0,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/include/uv.h:66,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c:29:
/usr/include/dirent.h:118:5: note: expected 'int (*)(const void *, const void *)' but argument is of type 'int (*)(uv__dirent_t **, uv__dirent_t **) {aka int (*)(struct dirent **, struct dirent **)}'
 int scandir(const char *, struct dirent ***,
     ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c: In function 'uv__fs_sendfile':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c:658:9: warning: implicit declaration of function 'sendfile' [-Wimplicit-function-declaration]
     r = sendfile(in_fd, out_fd, req->off, &len, NULL, 0);
         ^~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c: In function 'uv__to_stat':
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c:798:32: error: 'struct stat' has no member named 'st_birthtimespec'; did you mean 'st_atimespec'?
   dst->st_birthtim.tv_sec = src->st_birthtimespec.tv_sec;
                                ^~
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities/cmlibuv/src/unix/fs.c:799:33: error: 'struct stat' has no member named 'st_birthtimespec'; did you mean 'st_atimespec'?
   dst->st_birthtim.tv_nsec = src->st_birthtimespec.tv_nsec;
                                 ^~
gmake: *** [Makefile:386: uv-src-unix-fs.c.o] Error 1
---------------------------------------------
Error when bootstrapping CMake:
Problem while running gmake
---------------------------------------------

One problem solved, another one gained! (A least.) But patches exist! They just need a bit adjustment to __DARWIN_UNIX03, don't they?

comment:25 in reply to:  23 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to ballapete:

Replying to kencu:

The original funtion in cmake-3.10.0/Utilities/cmlibuv/src/unix/core.c is:

int uv_os_unsetenv(const char* name) {
  if (unsetenv(name) != 0)
    return -errno;

  return 0;
}

Isn't the following equivalent?

int uv_os_unsetenv(const char* name) {
  unsetenv(name);
  /* in old libc (Mac OS X 10.4) unsetenv() returns void, so let's check success "manually" */
  if (getenv(name) != NULL)    /* name still exists in environment */
    return -errno;

  return 0;                    /* successful elimination */
}

So the improved patch (who knows all side effects of #defining __DARWIN_UNIX03?) would be:

 int uv_os_unsetenv(const char* name) {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
   if (unsetenv(name) != 0)
     return -errno;
-
+#else
+  unsetenv(name);
+  if (getenv(name) != NULL)    /* if name still exists in environment, then no NULL pointer */
+    return -errno;
+#endif
   return 0;
 }

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

Hi Peter,

I did get a slightly older version of libuv, 1.7.5 to build through to completion on Tiger PPC. I thought I would start there with something a bit simpler. I'm not sure if it's new enough to support cmake, but perhaps this is a start at least.

Most of the tests pass. There are some very smart people around here, like Michael for example, who might be able take this one to the end zone.

Here's the patch I used for libuv 1.7.5: <https://github.com/kencu/TigerPorts/commit/55ef4b50b05d1c8fbc37bb9f613f4e396e463827>

And here's the whole Portfile with patches:

<https://github.com/kencu/TigerPorts/tree/master/devel/libuv>

Best, Ken

comment:27 in reply to:  2 ; Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

try adding this and please report back

# fix build on Tiger
if { ${os.platform} eq "darwin" && ${os.major} == 8 } {
    configure.cxxflags-append -D__DARWIN_UNIX03
}

Ken, are you sure this works? Recently I had to use configure.cflags-append -D__DARWIN_UNIX03 to see a difference, i.e. the cure of void unsetenv(). Can it be this works only when invoking port test <some port>?

I think of recording all the C header files (via configure.cflags-append -H) and then finding all the source files that use a header with __DARWIN_UNIX03 to possible determine all the changes that are introduced through this definition.

BTW, I think I have found a *fully* compatible version for the unsetenv() problem:

int uv_os_unsetenv(const char* name) {
  /* Mac OS X before Leopard, 10.5, has void unsetenv */
#if __MAC_OS_X_VERSION_MIN_REQUIRED > 1040
  if (unsetenv(name) != 0)
    return -errno;

#else
  unsetenv(name);
  if (getenv(name) != NULL)    /* if name still exists in environment, then no NULL pointer */
    return -1;
#endif

  return 0;
}

The only question left, for me, is whether 1 is the correct value… I mean the value for errno, if used here, would be that of getenv(). Which error could happen? A typo in name? No memory or disk space left? But it seems to that this function is just declared (for UNIX and MS) and nowhere used. So it could be removed as well.

comment:28 in reply to:  27 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Only seven C header files use __DARWIN_UNIX03:

/usr/include/assert.h
/usr/include/stdio.h
/usr/include/stdlib.h
/usr/include/sys/cdefs.h
/usr/include/sys/errno.h
/usr/include/time.h
/usr/include/unistd.h

comment:29 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

With two little paches and configure.cppflags-append -D_NETINET_TCP_H_=1 the configure step came quite far and reached to:

-- 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
-- Check for working CXX compiler: /opt/local/bin/g++-mp-6
-- Check for working CXX compiler: /opt/local/bin/g++-mp-6 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking if compiler supports C11 _Thread_local
-- Checking if compiler supports C11 _Thread_local - yes
-- Checking if compiler supports C++14 cstdio
-- Checking if compiler supports C++14 cstdio - yes
-- Checking if compiler supports C++ fallthrough
-- Checking if compiler supports C++ fallthrough - no
-- Checking if compiler supports C++ gnu_fallthrough
-- Checking if compiler supports C++ gnu_fallthrough - no
-- Checking if compiler supports C++ attribute_fallthrough
-- Checking if compiler supports C++ attribute_fallthrough - no
-- Checking if compiler supports C++ make_unique
-- Checking if compiler supports C++ make_unique - no
-- Checking if compiler supports C++ unique_ptr
-- Checking if compiler supports C++ unique_ptr - no
CMake Error at CMakeLists.txt:79 (message):
  The C++ compiler does not support C++11 (e.g.  std::unique_ptr).


-- Configuring incomplete, errors occurred!
See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeOutput.log".
See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3" && ./configure --prefix=/opt/local --docdir=share/doc/cmake --parallel=1 --init=/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/macports.cmake --no-system-jsoncpp --no-system-librhash --no-system-libs --no-qt-gui 

The two CMake*.log files do not seem to contain anything useful, in CMakeError.log I only find:

   71	Determining if compiler supports C++ unique_ptr failed with the following output:
   72	Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeTmp
   73	
   74	Run Build Command:"/opt/local/bin/gmake" "cmTC_ccf87/fast"
   75	gmake -f CMakeFiles/cmTC_ccf87.dir/build.make CMakeFiles/cmTC_ccf87.dir/build
   76	gmake[1]: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeTmp'
   77	Building CXX object CMakeFiles/cmTC_ccf87.dir/cm_cxx_unique_ptr.cxx.o
   78	/opt/local/bin/g++-mp-6    -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32  -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4   -std=gnu++14 -o CMakeFiles/cmTC_ccf87.dir/cm_cxx_unique_ptr.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source/Checks/cm_cxx_unique_ptr.cxx
   79	Linking CXX executable cmTC_ccf87
   80	/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_ccf87.dir/link.txt --verbose=1
   81	/opt/local/bin/g++-mp-6  -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32  -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_ccf87.dir/cm_cxx_unique_ptr.cxx.o  -o cmTC_ccf87 
   82	ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o
   83	gmake[1]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeTmp'

The mentioned CMakeLists.txt has:

   71	if(NOT CMake_TEST_EXTERNAL_CMAKE)
   72	  # include special compile flags for some compilers
   73	  include(CompileFlags.cmake)
   74	
   75	  # check for available C++ features
   76	  include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
   77	
   78	  if(NOT CMake_HAVE_CXX_UNIQUE_PTR)
   79	    message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).")
   80	  endif()
   81	endif()

I am lost now…

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

To get a working unsetenv(), new version

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

To get loose of birthtime member in struct

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

pete, you did see all those patches I posted above, right?

comment:31 in reply to:  30 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

pete, you did see all those patches I posted above, right?

Yes. I used them as potential input against the errors that appeared (approximately two). Without explanation it's not easy to decide which patch cures which error. Besides, I am working on CMake 3.10.3 meanwhile. Could be some of them are not necessary.

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

77	Building CXX object CMakeFiles/cmTC_ccf87.dir/cm_cxx_unique_ptr.cxx.o
78	/opt/local/bin/g++-mp-6    -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32  -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4   -std=gnu++14 -o CMakeFiles/cmTC_ccf87.dir/cm_cxx_unique_ptr.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source/Checks/cm_cxx_unique_ptr.cxx

My guess here is that g++-mp-6 can't find /opt/local/lib/libstdc++.6.dylib in -isysroot /Developer/SDKs/MacOSX10.4u.sdk Try a quick hack like this, to link in /opt/local to the SDK so it can find it. (or figure out how to change the -isysroot to "/".

cd /Developer/SDKs/MacOSX10.4u.sdk/
sudo ln -s /opt .
Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:33 in reply to:  32 ; Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

cd /Developer/SDKs/MacOSX10.4u.sdk/
sudo ln -s /opt .

This works, somehow:

/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeOutput.log:    arg [/Developer/SDKs/MacOSX10.4u.sdk] ==> ignore
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeOutput.log:  Library search paths: [;/Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib;/Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib;/Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0;/Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/gcc6;/Developer/SDKs/MacOSX10.4u.sdk/usr/lib;/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib]
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeOutput.log:  Framework search paths: [;/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/;/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/]
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeOutput.log:  collapse library dir [/Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib] ==> [/Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib]

but in the end the result is the same. Why is -isysroot necessary a all? Doesn't the compiler know by heart where its guts can be found?

Version 0, edited 6 years ago by ballapete (Peter "Pete" Dyballa) (next)

comment:34 in reply to:  33 ; Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

I have this (a bit edited):

cmake-3.10.3/CMakeFiles/3.10.3/CMakeCXXCompiler.cmake:set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;gcc_s.10.4;gcc_ext.10.4;gcc")
cmake-3.10.3/CMakeFiles/3.10.3/CMakeCXXCompiler.cmake:set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "\
   /opt/local/lib;\
   /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0;\
   /opt/local/lib/gcc6;\
   /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib;\
   /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0;\
   /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/gcc6;\
   /Developer/SDKs/MacOSX10.4u.sdk/usr/lib;\
   /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib")
cmake-3.10.3/CMakeFiles/3.10.3/CMakeCXXCompiler.cmake:set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks;/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks")
cmake-3.10.3/Modules/CMakeCXXCompiler.cmake.in:set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
cmake-3.10.3/Modules/CMakeCXXCompiler.cmake.in:set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
cmake-3.10.3/Modules/CMakeCXXCompiler.cmake.in:set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
cmake-3.10.3/Tests/SystemInformation/SystemInformation.in:CMAKE_CXX_IMPLICIT_LINK_LIBRARIES == "${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}"
cmake-3.10.3/Tests/SystemInformation/SystemInformation.in:CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES == "${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}"
cmake-3.10.3/Tests/SystemInformation/SystemInformation.in:CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES == "${CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}"

I presume that CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES is listing possible places that contain the CMAKE_CXX_IMPLICIT_LINK_LIBRARIES stdc++*, gcc_s.10.4*, gcc_ext.10.4*, or gcc*. In /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/gcc6 I have:

drwxr-xr-x 3 root admin      102 16. Aug 2017  gcc

lrwxrwxrwx 1 root admin       43 16. Aug 2017  libgcc_ext.10.4.dylib -> /opt/local/lib/libgcc/libgcc_ext.10.4.dylib
lrwxrwxrwx 1 root admin       43 16. Aug 2017  libgcc_ext.10.5.dylib -> /opt/local/lib/libgcc/libgcc_ext.10.5.dylib

lrwxrwxrwx 1 root admin       38 16. Aug 2017  libgcc_s.1.dylib -> /opt/local/lib/libgcc/libgcc_s.1.dylib
lrwxrwxrwx 1 root admin       16 16. Aug 2017  libgcc_s_ppc64.1.dylib -> libgcc_s.1.dylib
lrwxrwxrwx 1 root admin       16 16. Aug 2017  libgcc_s_x86_64.1.dylib -> libgcc_s.1.dylib

lrwxrwxrwx 1 root admin       39 16. Aug 2017  libstdc++.6.dylib -> /opt/local/lib/libgcc/libstdc++.6.dylib
-rw-r--r-- 1 root admin 12743616 16. Aug 2017  libstdc++.a
-rw-r--r-- 1 root admin     2399 16. Aug 2017  libstdc++.a-gdb.py
lrwxrwxrwx 1 root admin       17 16. Aug 2017  libstdc++.dylib -> libstdc++.6.dylib
-rwxr-xr-x 1 root admin      947 16. Aug 2017  libstdc++.la
-rw-r--r-- 1 root admin  3332608 16. Aug 2017  libstdc++fs.a
-rwxr-xr-x 1 root admin      902 16. Aug 2017  libstdc++fs.la

On disk I have also:

lrwxr-xr-x   1 root      wheel           27 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/i686-apple-darwin8/4.0.1/libstdc++.dylib -> ../../lib/libstdc++.6.dylib
-rw-r--r--   1 root      wheel      2966776 20 Apr  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/darwin/3.3/libstdc++.a
-rw-r--r--   1 root      wheel      2966776 20 Apr  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/darwin/3.3/libstdc++_ZeroLink.a
-rw-r--r--   1 root      wheel      1688364 27 Mai  2005 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.0/libstdc++.a
lrwxr-xr-x   1 root      wheel           26 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.0/libstdc++.dylib -> ../../../libstdc++.6.dylib
lrwxr-xr-x   1 root      wheel           26 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/libstdc++.dylib -> ../../../libstdc++.6.dylib
-rw-r--r--   1 root      wheel      1789636 27 Mai  2005 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libstdc++.a
lrwxr-xr-x   1 root      wheel           26 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libstdc++.dylib -> ../../../libstdc++.6.dylib
-rw-r--r--   1 root      wheel      1944436 27 Mai  2005 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/ppc64/libstdc++.a
lrwxr-xr-x   1 root      wheel           26 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libstdc++.dylib -> ../../../libstdc++.6.dylib
-rw-r--r--   1 root      wheel      6766864 20 Apr  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libstdc++-static.a
-rwxr-xr-x   1 root      wheel      1340048 13 Sep  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libstdc++.6.0.4.dylib
lrwxr-xr-x   1 root      wheel           21 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libstdc++.6.dylib -> libstdc++.6.0.4.dylib
lrwxr-xr-x   1 root      wheel           21 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libstdc++.dylib -> libstdc++.6.0.4.dylib
lrwxr-xr-x   1 root      wheel           27 27 Apr  2013 /Developer/SDKs/MacOSX10.4u.sdk/usr/power-apple-darwin8/4.0.1/libstdc++.dylib -> ../../lib/libstdc++.6.dylib
lrwxr-xr-x   1 root      wheel           26 27 Apr  2013 /Developer/usr/lib/gcc/i686-apple-darwin8/4.0.1/libstdc++.dylib -> ../../../libstdc++.6.dylib
lrwxr-xr-x   1 root      wheel           26 27 Apr  2013 /Developer/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libstdc++.dylib -> ../../../libstdc++.6.dylib

-rwxr-xr-x   1 root  wheel  10612 14 Sep  2006 /Developer/SDKs/MacOSX10.3.9.sdk/usr/lib/libgcc_s.10.4.dylib
-rwxr-xr-x   1 root  wheel  41500 20 Apr  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libgcc_s.10.4.dylib

drwxr-xr-x     3 root      wheel   102 27 Okt  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/gcc
drwxr-xr-x     5 root      wheel   170 27 Okt  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc
drwxr-xr-x     2 root      wheel    68 27 Okt  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include/gcc
drwxr-xr-x     2 root      wheel    68 27 Okt  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/include/gcc
drwxr-xr-x     2 root      wheel    68 27 Okt  2007 /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/gcc
drwxr-xr-x     4 root      wheel   136 21 Sep  2007 /Developer/usr/lib/gcc
drwxr-xr-x     2 root      wheel    68 21 Sep  2007 /Developer/usr/lib/gcc/i686-apple-darwin8/4.0.1/include/gcc
drwxr-xr-x     2 root      wheel    68 21 Sep  2007 /Developer/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/gcc

Are the now in GCC6 existing

-rw-r--r--   1 root  admin  6848 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.4.dylib
-rw-r--r--   1 root  admin  6380 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.5.dylib

causing the failure?

comment:35 in reply to:  34 ; Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to ballapete:

Are the now in GCC6 existing

-rw-r--r--   1 root  admin  6848 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.4.dylib
-rw-r--r--   1 root  admin  6380 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.5.dylib

causing the failure?

I don't think so! I added configure.ldflags-append -t to Portfile. With this switch I get:

/opt/local/bin/g++-mp-6 -L/opt/local/lib -Wl,-headerpad_max_install_names -t -framework CoreFoundation -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32      -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Bootstrap.cmk   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source/LexerParser   -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Utilities  cmAddCustomCommandCommand.o cmAddCustomTargetCommand.o cmAddDefinitionsCommand.o cmAddDependenciesCommand.o cmAddExecutableCommand.o cmAddLibraryCommand.o cmAddSubDirectoryCommand.o cmAddTestCommand.o cmBreakCommand.o cmBuildCommand.o cmCMakeMinimumRequired.o cmCMakePolicyCommand.o cmCPackPropertiesGenerator.o cmCacheManager.o cmCommand.o cmCommandArgumentParserHelper.o cmCommandArgumentsHelper.o cmCommands.o cmCommonTargetGenerator.o cmComputeComponentGraph.o cmComputeLinkDepends.o cmComputeLinkInformation.o cmComputeTargetDepends.o cmConditionEvaluator.o cmConfigureFileCommand.o cmContinueCommand.o cmCoreTryCompile.o cmCreateTestSourceList.o cmCustomCommand.o cmCustomCommandGenerator.o cmDefinePropertyCommand.o cmDefinitions.o cmDepends.o cmDependsC.o cmDisallowedCommand.o cmDocumentationFormatter.o cmEnableLanguageCommand.o cmEnableTestingCommand.o cmExecProgramCommand.o cmExecuteProcessCommand.o cmExpandedCommandArgument.o cmExportBuildFileGenerator.o cmExportFileGenerator.o cmExportInstallFileGenerator.o cmExportSet.o cmExportSetMap.o cmExportTryCompileFileGenerator.o cmExprParserHelper.o cmExternalMakefileProjectGenerator.o cmFileCommand.o cmFileTimeComparison.o cmFindBase.o cmFindCommon.o cmFindFileCommand.o cmFindLibraryCommand.o cmFindPackageCommand.o cmFindPathCommand.o cmFindProgramCommand.o cmForEachCommand.o cmFunctionCommand.o cmGeneratedFileStream.o cmGeneratorExpression.o cmGeneratorExpressionContext.o cmGeneratorExpressionDAGChecker.o cmGeneratorExpressionEvaluationFile.o cmGeneratorExpressionEvaluator.o cmGeneratorExpressionLexer.o cmGeneratorExpressionNode.o cmGeneratorExpressionParser.o cmGeneratorTarget.o cmGetCMakePropertyCommand.o cmGetDirectoryPropertyCommand.o cmGetFilenameComponentCommand.o cmGetPropertyCommand.o cmGetSourceFilePropertyCommand.o cmGetTargetPropertyCommand.o cmGetTestPropertyCommand.o cmGlobalCommonGenerator.o cmGlobalGenerator.o cmGlobalUnixMakefileGenerator3.o cmHexFileConverter.o cmIfCommand.o cmIncludeCommand.o cmIncludeGuardCommand.o cmIncludeDirectoryCommand.o cmIncludeRegularExpressionCommand.o cmInstallCommand.o cmInstallCommandArguments.o cmInstallDirectoryGenerator.o cmInstallExportGenerator.o cmInstallFilesCommand.o cmInstallFilesGenerator.o cmInstallGenerator.o cmInstallScriptGenerator.o cmInstallTargetGenerator.o cmInstallTargetsCommand.o cmInstalledFile.o cmLinkDirectoriesCommand.o cmLinkLineComputer.o cmListCommand.o cmListFileCache.o cmLocalCommonGenerator.o cmLocalGenerator.o cmLocalUnixMakefileGenerator3.o cmMSVC60LinkLineComputer.o cmMacroCommand.o cmMakeDirectoryCommand.o cmMakefile.o cmMakefileExecutableTargetGenerator.o cmMakefileLibraryTargetGenerator.o cmMakefileTargetGenerator.o cmMakefileUtilityTargetGenerator.o cmMarkAsAdvancedCommand.o cmMathCommand.o cmMessageCommand.o cmMessenger.o cmNewLineStyle.o cmOSXBundleGenerator.o cmOptionCommand.o cmOrderDirectories.o cmOutputConverter.o cmParseArgumentsCommand.o cmPathLabel.o cmPolicies.o cmProcessOutput.o cmProjectCommand.o cmProperty.o cmPropertyDefinition.o cmPropertyDefinitionMap.o cmPropertyMap.o cmReturnCommand.o cmRulePlaceholderExpander.o cmScriptGenerator.o cmSearchPath.o cmSeparateArgumentsCommand.o cmSetCommand.o cmSetDirectoryPropertiesCommand.o cmSetPropertyCommand.o cmSetSourceFilesPropertiesCommand.o cmSetTargetPropertiesCommand.o cmSetTestsPropertiesCommand.o cmSiteNameCommand.o cmSourceFile.o cmSourceFileLocation.o cmState.o cmStateDirectory.o cmStateSnapshot.o cmStringCommand.o cmSubdirCommand.o cmSystemTools.o cmTarget.o cmTargetCompileDefinitionsCommand.o cmTargetCompileFeaturesCommand.o cmTargetCompileOptionsCommand.o cmTargetIncludeDirectoriesCommand.o cmTargetLinkLibrariesCommand.o cmTargetPropCommandBase.o cmTargetPropertyComputer.o cmTargetSourcesCommand.o cmTest.o cmTestGenerator.o cmTimestamp.o cmTryCompileCommand.o cmTryRunCommand.o cmUnexpectedCommand.o cmUnsetCommand.o cmVersion.o cmWhileCommand.o cmWorkingDirectory.o cmake.o cmakemain.o cmcmd.o cmCommandArgumentLexer.o cmCommandArgumentParser.o cmExprLexer.o cmExprParser.o cmListFileLexer.o Directory.o EncodingCXX.o FStream.o Glob.o RegularExpression.o SystemTools.o EncodingC.o ProcessUNIX.o String.o System.o Terminal.o uv-src-uv-common.c.o uv-src-unix-cmake-bootstrap.c.o uv-src-unix-core.c.o uv-src-unix-fs.c.o uv-src-unix-loop.c.o uv-src-unix-loop-watcher.c.o uv-src-unix-no-fsevents.c.o uv-src-unix-pipe.c.o uv-src-unix-poll.c.o uv-src-unix-posix-hrtime.c.o uv-src-unix-posix-poll.c.o uv-src-unix-process.c.o uv-src-unix-signal.c.o uv-src-unix-stream.c.o uv-src-unix-timer.c.o  -o cmake
/usr/lib/crt1.o
/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o
/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation
<<many, many object files>>
uv-src-uv-common.c.o
uv-src-unix-cmake-bootstrap.c.o
uv-src-unix-core.c.o
uv-src-unix-fs.c.o
uv-src-unix-loop.c.o
uv-src-unix-loop-watcher.c.o
uv-src-unix-no-fsevents.c.o
uv-src-unix-pipe.c.o
uv-src-unix-poll.c.o
uv-src-unix-posix-hrtime.c.o
uv-src-unix-posix-poll.c.o
uv-src-unix-process.c.o
uv-src-unix-signal.c.o
uv-src-unix-stream.c.o
uv-src-unix-timer.c.o
/opt/local/lib/gcc6/libstdc++.dylib
>>> /usr/lib/libgcc_s.10.4.dylib <<<
/opt/local/lib/gcc6/libgcc_ext.10.4.dylib
/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/libgcc.a
/usr/lib/libSystemStubs.a
/usr/lib/libSystem.dylib
/usr/lib/libicucore.A.dylib
/usr/lib/libauto.dylib
/usr/lib/libobjc.A.dylib
/usr/lib/system/libmathCommon.A.dylib
/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/libgcc.a(darwin-gpsave.old: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o
)
loading initial cache file /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Bootstrap.cmk/InitialCacheFlags.cmake
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes

/usr/lib/libgcc_s.10.4.dylib instead of /opt/local/lib/gcc6/libgcc_s.1.dylib (symlink to /opt/local/lib/libgcc/libgcc_s.1.dylib) or /opt/local/lib/gcc6/libgcc_s_ppc64.1.dylib or /opt/local/lib/gcc6/libgcc_s_x86_64.1.dylib (both symlinks to libgcc_s.1.dylib) is used/found because GCC6 is incorrectly installed on Tiger: No file name *without* .1 and no file name *with* 10.4 instead.

comment:36 in reply to:  35 ; Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

I also have:

root 380 /\ l `port contents gcc48 | grep libgcc_s`
lrwxrwxrwx   1 root  admin  38 17 Aug  2017 /opt/local/lib/gcc48/libgcc_s.1.dylib -> /opt/local/lib/libgcc/libgcc_s.1.dylib
lrwxrwxrwx   1 root  admin  16 17 Aug  2017 /opt/local/lib/gcc48/libgcc_s_ppc64.1.dylib -> libgcc_s.1.dylib
lrwxrwxrwx   1 root  admin  16 17 Aug  2017 /opt/local/lib/gcc48/libgcc_s_x86_64.1.dylib -> libgcc_s.1.dylib
root 381 /\ l `port contents gcc5 | grep libgcc_s`
lrwxrwxrwx   1 root  admin  38 15 Okt 00:38 /opt/local/lib/gcc5/libgcc_s.1.dylib -> /opt/local/lib/libgcc/libgcc_s.1.dylib
lrwxrwxrwx   1 root  admin  16 15 Okt 00:34 /opt/local/lib/gcc5/libgcc_s_ppc64.1.dylib -> libgcc_s.1.dylib
lrwxrwxrwx   1 root  admin  16 15 Okt 00:34 /opt/local/lib/gcc5/libgcc_s_x86_64.1.dylib -> libgcc_s.1.dylib
root 382 /\ l `port contents gcc6 | grep libgcc_s`
lrwxrwxrwx   1 root  admin  38 16 Aug  2017 /opt/local/lib/gcc6/libgcc_s.1.dylib -> /opt/local/lib/libgcc/libgcc_s.1.dylib
lrwxrwxrwx   1 root  admin  16 16 Aug  2017 /opt/local/lib/gcc6/libgcc_s_ppc64.1.dylib -> libgcc_s.1.dylib
lrwxrwxrwx   1 root  admin  16 16 Aug  2017 /opt/local/lib/gcc6/libgcc_s_x86_64.1.dylib -> libgcc_s.1.dylib
root 391 /\ l `port contents libgcc | grep /opt/local/lib/libgcc`
-rwxr-xr-x   1 root  admin    24544 13 Feb 22:13 /opt/local/lib/libgcc/libatomic.1.dylib
-rw-r--r--   1 root  admin     6848 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.4.dylib
-rw-r--r--   1 root  admin     6380 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.5.dylib
-rw-r--r--   1 root  admin    58264 13 Feb 22:13 /opt/local/lib/libgcc/libgcc_s.1.dylib
-rwxr-xr-x   1 root  admin   792172 13 Feb 22:13 /opt/local/lib/libgcc/libgfortran.4.dylib
-rwxr-xr-x   1 root  admin   124912 13 Feb 22:13 /opt/local/lib/libgcc/libgomp.1.dylib
-rwxr-xr-x   1 root  admin   102568 13 Feb 22:13 /opt/local/lib/libgcc/libitm.1.dylib
-rwxr-xr-x   1 root  admin    74784 13 Feb 22:13 /opt/local/lib/libgcc/libobjc-gnu.4.dylib
-rwxr-xr-x   1 root  admin    13756 13 Feb 22:13 /opt/local/lib/libgcc/libssp.0.dylib
-rwxr-xr-x   1 root  admin  1218356 13 Feb 22:13 /opt/local/lib/libgcc/libstdc++.6.dylib
root 396 /\ l `port -q contents libgcc6`
-rwxr-xr-x   1 root  admin  721244 19 Sep  2017 /opt/local/lib/libgcc/libgfortran.3.dylib
root 397 /\ l /opt/local/lib/libgcc/libgcc*
-rw-r--r--   1 root  admin   6848 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.4.dylib
-rw-r--r--   1 root  admin   6380 13 Feb 22:09 /opt/local/lib/libgcc/libgcc_ext.10.5.dylib
-rw-r--r--   1 root  admin  58264 13 Feb 22:13 /opt/local/lib/libgcc/libgcc_s.1.dylib

And I have Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in. It has a Mac section, although it uses GCC 4.2.1 for PPC related tests. In its Linux section the GCC invocations with -lgcc_s while in the MS WIndows section it's -lgcc_s.1. So there must be a file that dictates which tests are performed on Tiger at build time, where -lgcc_s can be substituted with -lgcc_s.1.

comment:37 in reply to:  36 ; Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Although I have now:

-rw-r--r--   1 root  admin  58264 13 Feb 22:13 /opt/local/lib/libgcc/libgcc_s.1.dylib
lrwxr-xr-x   1 root  admin     18 23 Mär 22:20 /opt/local/lib/libgcc/libgcc_s.10.4.dylib -> ./libgcc_s.1.dylib

CMake still prefers other files…

Run Build Command:"/opt/local/bin/gmake" "cmTC_37a16/fast"
gmake -f CMakeFiles/cmTC_37a16.dir/build.make CMakeFiles/cmTC_37a16.dir/build
gmake[1]: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_37a16.dir/cm_cxx_unique_ptr.cxx.o
/opt/local/bin/g++-mp-6    -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32  -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4   -std=gnu++14 -o CMakeFiles/cmTC_37a16.dir/cm_cxx_unique_ptr.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Source/Checks/cm_cxx_unique_ptr.cxx
Linking CXX executable cmTC_37a16
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_37a16.dir/link.txt --verbose=1
/opt/local/bin/g++-mp-6  -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32  -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -t  CMakeFiles/cmTC_37a16.dir/cm_cxx_unique_ptr.cxx.o  -o cmTC_37a16 
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.o
/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o
CMakeFiles/cmTC_37a16.dir/cm_cxx_unique_ptr.cxx.o
/opt/local/lib/gcc6/libstdc++.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libgcc_s.10.4.dylib
/opt/local/lib/gcc6/libgcc_ext.10.4.dylib
/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/libgcc.a
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libSystemStubs.a
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libSystem.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/system/libmathCommon.A.dylib
/opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/libgcc.a(darwin-gpsave.old: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o
)
gmake[1]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.3/CMakeFiles/CMakeTmp'

I am going to try again with thy symlink opt in /Developer/SDKs/MacOSX10.4u.sdk.

Last edited 6 years ago by ballapete (Peter "Pete" Dyballa) (previous) (diff)

comment:38 in reply to:  37 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libgcc_s.10.4.dylib has a strange attraction – still no success with std::unique_ptr

comment:39 Changed 5 years ago by michaelld (Michael Dickens)

Summary: cmake @3.10.1 does not build on PPC Tiger, Mac OS X 10.4.11, due to various issues building libuvcmake 3.10-12 does not build on PPC Tiger, Mac OS X 10.4.11

has duplicate #57551 ... which does have some relevant info in it ... but there's at least as much relevant info here ... so we're keeping this one

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

for the foreseeable future you'll need to peg cmake in Tiger at 3.96.

I have libuv 1.9.1 building on Tiger now. That's up from 1.7.5. So might get there one day...

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

cmake needs (presently) libuv 1.10.0 and I have 1.9.1 building, so we're close. I have thought of a different idea as well that might solve this...stay tuned.

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

Well, it is possible to do it:

$ port -v installed cmake
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
The following ports are currently installed:
  cmake @3.12.3_0 (active) platform='darwin 8' archs='i386' date='2018-11-10T12:09:44-0800'

$ cmake --version
cmake version 3.12.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Just have to automate it now...

comment:43 in reply to:  42 Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

Well, it is possible to do it:

You make MacPorts great again!

comment:44 in reply to:  41 ; Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

cmake needs (presently) libuv 1.10.0 and I have 1.9.1 building, so we're close. I have thought of a different idea as well that might solve this...stay tuned.

I do wonder why I have now libuv @1.24.0_0 (active) platform='darwin 8' archs='ppc' date='2018-11-15T01:12:55+0100'

comment:45 in reply to:  44 Changed 5 years ago by kencu (Ken)

Replying to ballapete:

I do wonder why I have now libuv @1.24.0_0 (active) platform='darwin 8' archs='ppc' date='2018-11-15T01:12:55+0100'

Pretty good, eh? There are a couple of test suite failures I'd like to fix (or like someone to help me fix), but it works quite well. I told you I'd get it done ;>

cmake for 10.4 is fixed as well <https://github.com/macports/macports-ports/pull/3012>. Mike is just wanting to wrap around the fix and see if it is as good as it can possibly be.

IF you're impatient (dunno why -- cmake-3.9 builds everything still, and you have that now) but if you are impatient, it's not too hard to check out the PR and build it for yourself.... Go for it! Or wait until Mike commits / says we can commit it.

comment:46 Changed 5 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In 7c9beaf9b82a77e7f02b8240fbdddc73f583740e/macports-ports (master):

cmake: fix build on Tiger

with newly-fixed libuv, now can use system libs again
add fixes for cm_libuv to allow bootstrap cmake to build
add a missing link library
closes: #55415

comment:47 Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

Built here too!

Note: See TracTickets for help on using tickets.