Opened 8 years ago

Closed 7 years ago

#54129 closed defect (fixed)

llvm-4.0 build fails due to libtool error on SnowLeopard when built with clang-3.9, but succeeds when built with clang-3.7

Reported by: kencu (Ken) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: larryv (Lawrence Velázquez), ballapete (Peter "Pete" Dyballa), dliessi (Davide Liessi)
Port: llvm-4.0

Description

Here's what I saw on Snow Leopard when building llvm-4.0.

building with clang-3.9:

cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/clang++-mp-3.9  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/Support -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/include -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/include  -pipe -Os -U__STRICT_ANSI__ -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6    -fno-exceptions -o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o -c /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/Support/Watchdog.cpp
[  8%] Linking CXX static library ../libLLVMSupport.a
cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/cmake -P CMakeFiles/LLVMSupport.dir/cmake_clean_target.cmake
cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/LLVMSupport.dir/link.txt --verbose=ON
/Developer/usr/bin/libtool -static  -o ../libLLVMSupport.a          CMakeFiles/LLVMSupport.dir/APFloat.cpp.o CMakeFiles/LLVMSupport.dir/APInt.cpp.o CMakeFiles/LLVMSupport.dir/APSInt.cpp.o CMakeFiles/LLVMSupport.dir/ARMBuildAttrs.cpp.o CMakeFiles/LLVMSupport.dir/ARMWinEH.cpp.o CMakeFiles/LLVMSupport.dir/Allocator.cpp.o CMakeFiles/LLVMSupport.dir/BlockFrequency.cpp.o CMakeFiles/LLVMSupport.dir/BranchProbability.cpp.o CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o CMakeFiles/LLVMSupport.dir/circular_raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/Chrono.cpp.o CMakeFiles/LLVMSupport.dir/COM.cpp.o CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o CMakeFiles/LLVMSupport.dir/Compression.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o CMakeFiles/LLVMSupport.dir/Debug.cpp.o CMakeFiles/LLVMSupport.dir/DeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/Dwarf.cpp.o CMakeFiles/LLVMSupport.dir/Error.cpp.o CMakeFiles/LLVMSupport.dir/ErrorHandling.cpp.o CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o CMakeFiles/LLVMSupport.dir/FileOutputBuffer.cpp.o CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o CMakeFiles/LLVMSupport.dir/FormattedStream.cpp.o CMakeFiles/LLVMSupport.dir/FormatVariadic.cpp.o CMakeFiles/LLVMSupport.dir/GlobPattern.cpp.o CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o CMakeFiles/LLVMSupport.dir/Hashing.cpp.o CMakeFiles/LLVMSupport.dir/IntEqClasses.cpp.o CMakeFiles/LLVMSupport.dir/IntervalMap.cpp.o CMakeFiles/LLVMSupport.dir/JamCRC.cpp.o CMakeFiles/LLVMSupport.dir/LEB128.cpp.o CMakeFiles/LLVMSupport.dir/LineIterator.cpp.o CMakeFiles/LLVMSupport.dir/Locale.cpp.o CMakeFiles/LLVMSupport.dir/LockFileManager.cpp.o CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o CMakeFiles/LLVMSupport.dir/MathExtras.cpp.o CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.o CMakeFiles/LLVMSupport.dir/MD5.cpp.o CMakeFiles/LLVMSupport.dir/NativeFormatting.cpp.o CMakeFiles/LLVMSupport.dir/Options.cpp.o CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o CMakeFiles/LLVMSupport.dir/PrettyStackTrace.cpp.o CMakeFiles/LLVMSupport.dir/RandomNumberGenerator.cpp.o CMakeFiles/LLVMSupport.dir/Regex.cpp.o CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o CMakeFiles/LLVMSupport.dir/ScopedPrinter.cpp.o CMakeFiles/LLVMSupport.dir/SHA1.cpp.o CMakeFiles/LLVMSupport.dir/SmallPtrSet.cpp.o CMakeFiles/LLVMSupport.dir/SmallVector.cpp.o CMakeFiles/LLVMSupport.dir/SourceMgr.cpp.o CMakeFiles/LLVMSupport.dir/SpecialCaseList.cpp.o CMakeFiles/LLVMSupport.dir/Statistic.cpp.o CMakeFiles/LLVMSupport.dir/StringExtras.cpp.o CMakeFiles/LLVMSupport.dir/StringMap.cpp.o CMakeFiles/LLVMSupport.dir/StringPool.cpp.o CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o CMakeFiles/LLVMSupport.dir/StringRef.cpp.o CMakeFiles/LLVMSupport.dir/SystemUtils.cpp.o CMakeFiles/LLVMSupport.dir/TarWriter.cpp.o CMakeFiles/LLVMSupport.dir/TargetParser.cpp.o CMakeFiles/LLVMSupport.dir/ThreadPool.cpp.o CMakeFiles/LLVMSupport.dir/Timer.cpp.o CMakeFiles/LLVMSupport.dir/ToolOutputFile.cpp.o CMakeFiles/LLVMSupport.dir/TrigramIndex.cpp.o CMakeFiles/LLVMSupport.dir/Triple.cpp.o CMakeFiles/LLVMSupport.dir/Twine.cpp.o CMakeFiles/LLVMSupport.dir/Unicode.cpp.o CMakeFiles/LLVMSupport.dir/YAMLParser.cpp.o CMakeFiles/LLVMSupport.dir/YAMLTraits.cpp.o CMakeFiles/LLVMSupport.dir/raw_os_ostream.cpp.o CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/regcomp.c.o CMakeFiles/LLVMSupport.dir/regerror.c.o CMakeFiles/LLVMSupport.dir/regexec.c.o CMakeFiles/LLVMSupport.dir/regfree.c.o CMakeFiles/LLVMSupport.dir/regstrlcpy.c.o CMakeFiles/LLVMSupport.dir/xxhash.cpp.o CMakeFiles/LLVMSupport.dir/Atomic.cpp.o CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o CMakeFiles/LLVMSupport.dir/Errno.cpp.o CMakeFiles/LLVMSupport.dir/Host.cpp.o CMakeFiles/LLVMSupport.dir/Memory.cpp.o CMakeFiles/LLVMSupport.dir/Mutex.cpp.o CMakeFiles/LLVMSupport.dir/Path.cpp.o CMakeFiles/LLVMSupport.dir/Process.cpp.o CMakeFiles/LLVMSupport.dir/Program.cpp.o CMakeFiles/LLVMSupport.dir/RWMutex.cpp.o CMakeFiles/LLVMSupport.dir/SearchForAddressOfSpecialSymbol.cpp.o CMakeFiles/LLVMSupport.dir/Signals.cpp.o CMakeFiles/LLVMSupport.dir/TargetRegistry.cpp.o CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.o CMakeFiles/LLVMSupport.dir/Threading.cpp.o CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o 
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/APFloat.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/Dwarf.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/SourceMgr.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/TargetParser.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/Timer.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/Triple.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/Twine.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/YAMLParser.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/regcomp.c.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/Host.cpp.o malformed object (unknown load command 2)
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMSupport.dir/Path.cpp.o malformed object (unknown load command 2)
make[2]: *** [lib/libLLVMSupport.a] Error 1

building with clang-3.7:

cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/clang++-mp-3.7  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/Support -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/include -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/include  -pipe -Os -U__STRICT_ANSI__ -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6    -fno-exceptions -o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o -c /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/Support/Watchdog.cpp
[ 12%] Linking CXX static library ../libLLVMSupport.a
cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/cmake -P CMakeFiles/LLVMSupport.dir/cmake_clean_target.cmake
cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/LLVMSupport.dir/link.txt --verbose=ON
/Developer/usr/bin/libtool -static  -o ../libLLVMSupport.a          CMakeFiles/LLVMSupport.dir/APFloat.cpp.o CMakeFiles/LLVMSupport.dir/APInt.cpp.o CMakeFiles/LLVMSupport.dir/APSInt.cpp.o CMakeFiles/LLVMSupport.dir/ARMBuildAttrs.cpp.o CMakeFiles/LLVMSupport.dir/ARMWinEH.cpp.o CMakeFiles/LLVMSupport.dir/Allocator.cpp.o CMakeFiles/LLVMSupport.dir/BlockFrequency.cpp.o CMakeFiles/LLVMSupport.dir/BranchProbability.cpp.o CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o CMakeFiles/LLVMSupport.dir/circular_raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/Chrono.cpp.o CMakeFiles/LLVMSupport.dir/COM.cpp.o CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o CMakeFiles/LLVMSupport.dir/Compression.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o CMakeFiles/LLVMSupport.dir/Debug.cpp.o CMakeFiles/LLVMSupport.dir/DeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/Dwarf.cpp.o CMakeFiles/LLVMSupport.dir/Error.cpp.o CMakeFiles/LLVMSupport.dir/ErrorHandling.cpp.o CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o CMakeFiles/LLVMSupport.dir/FileOutputBuffer.cpp.o CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o CMakeFiles/LLVMSupport.dir/FormattedStream.cpp.o CMakeFiles/LLVMSupport.dir/FormatVariadic.cpp.o CMakeFiles/LLVMSupport.dir/GlobPattern.cpp.o CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o CMakeFiles/LLVMSupport.dir/Hashing.cpp.o CMakeFiles/LLVMSupport.dir/IntEqClasses.cpp.o CMakeFiles/LLVMSupport.dir/IntervalMap.cpp.o CMakeFiles/LLVMSupport.dir/JamCRC.cpp.o CMakeFiles/LLVMSupport.dir/LEB128.cpp.o CMakeFiles/LLVMSupport.dir/LineIterator.cpp.o CMakeFiles/LLVMSupport.dir/Locale.cpp.o CMakeFiles/LLVMSupport.dir/LockFileManager.cpp.o CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o CMakeFiles/LLVMSupport.dir/MathExtras.cpp.o CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.o CMakeFiles/LLVMSupport.dir/MD5.cpp.o CMakeFiles/LLVMSupport.dir/NativeFormatting.cpp.o CMakeFiles/LLVMSupport.dir/Options.cpp.o CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o CMakeFiles/LLVMSupport.dir/PrettyStackTrace.cpp.o CMakeFiles/LLVMSupport.dir/RandomNumberGenerator.cpp.o CMakeFiles/LLVMSupport.dir/Regex.cpp.o CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o CMakeFiles/LLVMSupport.dir/ScopedPrinter.cpp.o CMakeFiles/LLVMSupport.dir/SHA1.cpp.o CMakeFiles/LLVMSupport.dir/SmallPtrSet.cpp.o CMakeFiles/LLVMSupport.dir/SmallVector.cpp.o CMakeFiles/LLVMSupport.dir/SourceMgr.cpp.o CMakeFiles/LLVMSupport.dir/SpecialCaseList.cpp.o CMakeFiles/LLVMSupport.dir/Statistic.cpp.o CMakeFiles/LLVMSupport.dir/StringExtras.cpp.o CMakeFiles/LLVMSupport.dir/StringMap.cpp.o CMakeFiles/LLVMSupport.dir/StringPool.cpp.o CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o CMakeFiles/LLVMSupport.dir/StringRef.cpp.o CMakeFiles/LLVMSupport.dir/SystemUtils.cpp.o CMakeFiles/LLVMSupport.dir/TarWriter.cpp.o CMakeFiles/LLVMSupport.dir/TargetParser.cpp.o CMakeFiles/LLVMSupport.dir/ThreadPool.cpp.o CMakeFiles/LLVMSupport.dir/Timer.cpp.o CMakeFiles/LLVMSupport.dir/ToolOutputFile.cpp.o CMakeFiles/LLVMSupport.dir/TrigramIndex.cpp.o CMakeFiles/LLVMSupport.dir/Triple.cpp.o CMakeFiles/LLVMSupport.dir/Twine.cpp.o CMakeFiles/LLVMSupport.dir/Unicode.cpp.o CMakeFiles/LLVMSupport.dir/YAMLParser.cpp.o CMakeFiles/LLVMSupport.dir/YAMLTraits.cpp.o CMakeFiles/LLVMSupport.dir/raw_os_ostream.cpp.o CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/regcomp.c.o CMakeFiles/LLVMSupport.dir/regerror.c.o CMakeFiles/LLVMSupport.dir/regexec.c.o CMakeFiles/LLVMSupport.dir/regfree.c.o CMakeFiles/LLVMSupport.dir/regstrlcpy.c.o CMakeFiles/LLVMSupport.dir/xxhash.cpp.o CMakeFiles/LLVMSupport.dir/Atomic.cpp.o CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o CMakeFiles/LLVMSupport.dir/Errno.cpp.o CMakeFiles/LLVMSupport.dir/Host.cpp.o CMakeFiles/LLVMSupport.dir/Memory.cpp.o CMakeFiles/LLVMSupport.dir/Mutex.cpp.o CMakeFiles/LLVMSupport.dir/Path.cpp.o CMakeFiles/LLVMSupport.dir/Process.cpp.o CMakeFiles/LLVMSupport.dir/Program.cpp.o CMakeFiles/LLVMSupport.dir/RWMutex.cpp.o CMakeFiles/LLVMSupport.dir/SearchForAddressOfSpecialSymbol.cpp.o CMakeFiles/LLVMSupport.dir/Signals.cpp.o CMakeFiles/LLVMSupport.dir/TargetRegistry.cpp.o CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.o CMakeFiles/LLVMSupport.dir/Threading.cpp.o CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o 
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build'
[ 12%] Built target LLVMSupport

On this particular machine, /Developer refers to Xcode 4.2.

I have another version of libtool in /opt/local/bin/libtool, but this is not called by the llvm-4.0 cmake script.

I'm not sure if the object files built with clang-3.9 are different than object files built with clang-3.7.

Attachments (4)

main.log (433.7 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log
main.2.log (76.5 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log with failure due to Xcode version number comparison with 4.3
debug-vanilla-base.log (254.0 KB) - added by Ionic (Mihai Moldovan) 7 years ago.
vanilla base attempt
debug-patched-base.log (78.8 KB) - added by Ionic (Mihai Moldovan) 7 years ago.
patched base attempt

Download all attachments as: .zip

Change History (34)

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

$ /Developer/usr/bin/libtool -V
Apple Computer, Inc. version cctools-809

comment:2 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

You should install the cctools port.

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

Yeah, that's been there for quite a while. The cmake build script must be specifically targeting the libtool at /Developer/usr/bin/libtool. I'll see if I can figure out where & why that happens.

$ port -v installed cctools
The following ports are currently installed:
  cctools @895_3+llvm39+universal-llvm34 (active) platform='darwin 10' archs='i386 x86_64' date='2016-12-24T17:48:26-0800'
$ which libtool
/opt/local/bin/libtool
$ libtool -V
Apple Inc. version cctools-895

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

right here in CMakeList.txt

 execute_process(COMMAND ${CMAKE_XCRUN} -find libtool
 OUTPUT_VARIABLE CMAKE_LIBTOOL
$ xcrun -find libtool
 /Developer/usr/bin/libtool

I suppose CMAKE_LIBTOOL could be pushed in by the Portfile on systems that need it, if the llvm group doesn't want to monkey with the CMakeLists.txt logic.

comment:5 Changed 8 years ago by mf2k (Frank Schima)

Cc: larryv added; jeremyhu removed
Owner: set to jeremyhu
Status: newassigned

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

Oh, I see. You already have that.

Maybe this xcodeversion test will need to be bumped up past 4.2 then. Not sure where it needs to be set.

# I'm not sure the exact version of Xcode that has a good enough libtool, but 3.2.6 seems to get past this when 3.1.4 doesn't:
#     /Developer/usr/bin/libtool: for architecture x86_64 object: CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o malformed object (unknown load command 1)
#     /Developer/usr/bin/libtool: for architecture: (null) file: CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o is not an object file (not allowed in a library)
#     /Developer/usr/bin/libtool: for architecture i386 object: CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o malformed object (unknown load command 1)
if {[vercmp $xcodeversion "3.2.6"] < 0} {
    depends_build-append port:cctools
    depends_skip_archcheck-append cctools
    configure.args-append \
        -DCMAKE_LIBTOOL=${prefix}/bin/libtool
}

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

I changed the xcode test to 4.3 (which is beyond the xcode I have installed), and now clang-4.0 builds through with clang-3.9 on SnowLeopard, using macport's cctools-895 libtool.

if {[vercmp $xcodeversion "4.3"] < 0} {
    depends_build-append port:cctools
    depends_skip_archcheck-append cctools
    configure.args-append \
        -DCMAKE_LIBTOOL=${prefix}/bin/libtool
}
cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/clang++-mp-3.9  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/Support -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/include -I/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/include  -pipe -Os -U__STRICT_ANSI__ -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6    -fno-exceptions -o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o -c /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/Support/Watchdog.cpp
[ 12%] Linking CXX static library ../libLLVMSupport.a
cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/cmake -P CMakeFiles/LLVMSupport.dir/cmake_clean_target.cmake
cd /opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build/lib/Support && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/LLVMSupport.dir/link.txt --verbose=ON
/opt/local/bin/libtool -static -no_warning_for_no_symbols -o ../libLLVMSupport.a          CMakeFiles/LLVMSupport.dir/APFloat.cpp.o CMakeFiles/LLVMSupport.dir/APInt.cpp.o CMakeFiles/LLVMSupport.dir/APSInt.cpp.o CMakeFiles/LLVMSupport.dir/ARMBuildAttrs.cpp.o CMakeFiles/LLVMSupport.dir/ARMWinEH.cpp.o CMakeFiles/LLVMSupport.dir/Allocator.cpp.o CMakeFiles/LLVMSupport.dir/BlockFrequency.cpp.o CMakeFiles/LLVMSupport.dir/BranchProbability.cpp.o CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o CMakeFiles/LLVMSupport.dir/circular_raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/Chrono.cpp.o CMakeFiles/LLVMSupport.dir/COM.cpp.o CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o CMakeFiles/LLVMSupport.dir/Compression.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o CMakeFiles/LLVMSupport.dir/Debug.cpp.o CMakeFiles/LLVMSupport.dir/DeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.o CMakeFiles/LLVMSupport.dir/Dwarf.cpp.o CMakeFiles/LLVMSupport.dir/Error.cpp.o CMakeFiles/LLVMSupport.dir/ErrorHandling.cpp.o CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o CMakeFiles/LLVMSupport.dir/FileOutputBuffer.cpp.o CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o CMakeFiles/LLVMSupport.dir/FormattedStream.cpp.o CMakeFiles/LLVMSupport.dir/FormatVariadic.cpp.o CMakeFiles/LLVMSupport.dir/GlobPattern.cpp.o CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o CMakeFiles/LLVMSupport.dir/Hashing.cpp.o CMakeFiles/LLVMSupport.dir/IntEqClasses.cpp.o CMakeFiles/LLVMSupport.dir/IntervalMap.cpp.o CMakeFiles/LLVMSupport.dir/JamCRC.cpp.o CMakeFiles/LLVMSupport.dir/LEB128.cpp.o CMakeFiles/LLVMSupport.dir/LineIterator.cpp.o CMakeFiles/LLVMSupport.dir/Locale.cpp.o CMakeFiles/LLVMSupport.dir/LockFileManager.cpp.o CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o CMakeFiles/LLVMSupport.dir/MathExtras.cpp.o CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.o CMakeFiles/LLVMSupport.dir/MD5.cpp.o CMakeFiles/LLVMSupport.dir/NativeFormatting.cpp.o CMakeFiles/LLVMSupport.dir/Options.cpp.o CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o CMakeFiles/LLVMSupport.dir/PrettyStackTrace.cpp.o CMakeFiles/LLVMSupport.dir/RandomNumberGenerator.cpp.o CMakeFiles/LLVMSupport.dir/Regex.cpp.o CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o CMakeFiles/LLVMSupport.dir/ScopedPrinter.cpp.o CMakeFiles/LLVMSupport.dir/SHA1.cpp.o CMakeFiles/LLVMSupport.dir/SmallPtrSet.cpp.o CMakeFiles/LLVMSupport.dir/SmallVector.cpp.o CMakeFiles/LLVMSupport.dir/SourceMgr.cpp.o CMakeFiles/LLVMSupport.dir/SpecialCaseList.cpp.o CMakeFiles/LLVMSupport.dir/Statistic.cpp.o CMakeFiles/LLVMSupport.dir/StringExtras.cpp.o CMakeFiles/LLVMSupport.dir/StringMap.cpp.o CMakeFiles/LLVMSupport.dir/StringPool.cpp.o CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o CMakeFiles/LLVMSupport.dir/StringRef.cpp.o CMakeFiles/LLVMSupport.dir/SystemUtils.cpp.o CMakeFiles/LLVMSupport.dir/TarWriter.cpp.o CMakeFiles/LLVMSupport.dir/TargetParser.cpp.o CMakeFiles/LLVMSupport.dir/ThreadPool.cpp.o CMakeFiles/LLVMSupport.dir/Timer.cpp.o CMakeFiles/LLVMSupport.dir/ToolOutputFile.cpp.o CMakeFiles/LLVMSupport.dir/TrigramIndex.cpp.o CMakeFiles/LLVMSupport.dir/Triple.cpp.o CMakeFiles/LLVMSupport.dir/Twine.cpp.o CMakeFiles/LLVMSupport.dir/Unicode.cpp.o CMakeFiles/LLVMSupport.dir/YAMLParser.cpp.o CMakeFiles/LLVMSupport.dir/YAMLTraits.cpp.o CMakeFiles/LLVMSupport.dir/raw_os_ostream.cpp.o CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.o CMakeFiles/LLVMSupport.dir/regcomp.c.o CMakeFiles/LLVMSupport.dir/regerror.c.o CMakeFiles/LLVMSupport.dir/regexec.c.o CMakeFiles/LLVMSupport.dir/regfree.c.o CMakeFiles/LLVMSupport.dir/regstrlcpy.c.o CMakeFiles/LLVMSupport.dir/xxhash.cpp.o CMakeFiles/LLVMSupport.dir/Atomic.cpp.o CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o CMakeFiles/LLVMSupport.dir/Errno.cpp.o CMakeFiles/LLVMSupport.dir/Host.cpp.o CMakeFiles/LLVMSupport.dir/Memory.cpp.o CMakeFiles/LLVMSupport.dir/Mutex.cpp.o CMakeFiles/LLVMSupport.dir/Path.cpp.o CMakeFiles/LLVMSupport.dir/Process.cpp.o CMakeFiles/LLVMSupport.dir/Program.cpp.o CMakeFiles/LLVMSupport.dir/RWMutex.cpp.o CMakeFiles/LLVMSupport.dir/SearchForAddressOfSpecialSymbol.cpp.o CMakeFiles/LLVMSupport.dir/Signals.cpp.o CMakeFiles/LLVMSupport.dir/TargetRegistry.cpp.o CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.o CMakeFiles/LLVMSupport.dir/Threading.cpp.o CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o 
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_SnowLeopardPorts_lang_llvm-4.0/llvm-4.0/work/build'
[ 12%] Built target LLVMSupport

etc ...

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

Attachment: main.log added

main.log

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

Cc: ballapete added

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

Replying to kencu:

This does not work on my Mac. Very early the first failure happens, similar to what I get with ffmpeg-devel (#54333):

[  1%] Building CXX object lib/MC/MCDisassembler/CMakeFiles/LLVMMCDisassembler.dir/MCRelocationInfo.cpp.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/build/lib/MC/MCDisassembler && /opt/local/bin/clang++-mp-3.9  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/build/lib/MC/MCDisassembler -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/MC/MCDisassembler -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/include  -pipe -Os -U__STRICT_ANSI__ -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6    -fno-exceptions -o CMakeFiles/LLVMMCDisassembler.dir/MCRelocationInfo.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/llvm-4.0.0.src/lib/MC/MCDisassembler/MCRelocationInfo.cpp
[  1%] Linking CXX static library ../libLLVMDemangle.a
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/build/lib/Demangle && /opt/local/bin/cmake -P CMakeFiles/LLVMDemangle.dir/cmake_clean_target.cmake
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/build/lib/Demangle && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/LLVMDemangle.dir/link.txt --verbose=ON
/Developer/usr/bin/libtool -static  -o ../libLLVMDemangle.a          CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o 
/Developer/usr/bin/libtool: object: CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o malformed object (unknown load command 2)
make[2]: *** [lib/libLLVMDemangle.a] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/llvm-4.0/work/build'
make[1]: *** [lib/Demangle/CMakeFiles/LLVMDemangle.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

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

Attachment: main.2.log added

main.log with failure due to Xcode version number comparison with 4.3

comment:10 Changed 7 years ago by kencu (Ken)

Your build attempt is somehow still calling /Developer/usr/bin/libtool as you can see, which does not work to link object files built with clang-3.9 on 10.6 as it's too old.

The fix I suggested above changes that to /opt/local/bin/libtool from cctools, which does work. Please check that bit carefully in the llvm-4.0 build file you edited and see if you altered it correctly. Or as I said in your other ticket, just check out my SnowLeopardPorts repo where it is all done for you.

I would submit a PR for this for the main MacPorts repo, but Jeremy understands bootstrapping dependencies much better than I do. Obviously he is very busy these days.

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

Replying to kencu:

Your build attempt is somehow still calling /Developer/usr/bin/libtool as you can see, which does not work to link object files built with clang-3.9 on 10.6 as it's too old.

Indeed:

-- Found libtool - /Developer/usr/bin/libtool

The fix I suggested above changes that to /opt/local/bin/libtool from cctools, which does work. Please check that bit carefully in the llvm-4.0 build file you edited and see if you altered it correctly. Or as I said in your other ticket, just check out my SnowLeopardPorts repo where it is all done for you.

diff /opt/local/var/macports/sources/nue.de.rsync.macports.org/macports/release/tarballs/ports/lang/llvm-4.0/Portfile /opt/local/var/macports/sources/nue.de.rsync.macports.org/macports/release/tarballs/ports/lang/llvm-4.0/Portfile.orig
63c63
<     if {[vercmp $xcodeversion "4.3"] < 0} {
---
>     if {[vercmp $xcodeversion "6.0.0"] < 0} {
66,67d65
< 	configure.args-append \
< 	        -DCMAKE_LIBTOOL=${prefix}/bin/libtool

Or did I miss the proper build file?

I would submit a PR for this for the main MacPorts repo, but Jeremy understands bootstrapping dependencies much better than I do. Obviously he is very busy these days.

Apple® hardware has a long life…

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

There are two places where the xcodeversion is checked. You need to change the second one from 3.2.6 to 4.3.

I think you've changed the first one from 6.0.0 to 4.3.

Or, if you get super stuck, and don't want to use my repo, just build llvm-4.0 with clang-3.7, which 10.6 can link with its stock tool chain.

comment:13 in reply to:  12 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

There are two places where the xcodeversion is checked. You need to change the second one from 3.2.6 to 4.3.

I must have made an error when I searched in vi for vercmp. Doing it again and more controlled I found the second occurrence and now

  clang-4.0 @4.0.0_0+analyzer+libstdcxx (active)
  llvm-4.0 @4.0.0_0 (active)

are built. Building llvm-4.0 with polly is certainly not recommended because the ppl port is installed and also used by other ports.

Thank you, Ken!

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

great! Progress! but but please don't forget that clang-4.0 is still broken on snow leopard unless you did that patch I mentioned in here 54135.

comment:15 in reply to:  14 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

great! Progress! but but please don't forget that clang-4.0 is still broken on snow leopard unless you did that patch I mentioned in here 54135.

Over the cooler night the patched Clang 4.0 built. I wonder whether Poppler 0.55 and TeX Live 2017 will build…

comment:16 Changed 7 years ago by dliessi (Davide Liessi)

Cc: dliessi added

comment:17 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I'm thinking that base should add port:cctools to depends_build when using a macports compiler

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

even if we did that (which is a fine idea) I think we'd still need this bit because if it is not specified, cmake will try to find one and it finds the /Developer one.

-DCMAKE_LIBTOOL=${prefix}/bin/libtool

comment:19 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Please give this a try for the change in base:

https://github.com/jeremyhu/macports-base/commit/90eb1ae7903e9b24fa47c8e2a2adef3e50e69fb3

As for -DCMAKE_LIBTOOL=${prefix}/bin/libtool, IMO, that should be default. We should fix how CMAKE_LIBTOOL gets discovered.

comment:20 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: assignedclosed

In fed75e667986cb1e85f35b8014cbb1a405955219/macports-ports:

llvm-{3.8,3.9,4.0,devel}: Depend on the cctools port whenever we use macports-clang-*

Closes: #54129

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@…>

comment:21 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: closedreopened

Reopening to continue the discussion for base. That change just addresses the immediate need for the llvm ports.

comment:22 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Status: reopenedaccepted

comment:23 Changed 7 years ago by Ionic (Mihai Moldovan)

This doesn't seem to work as intended.

For some reason, the code that adds the cctools dependency and checks whether cctools have been added as a dependency to add the cmake/configure option is executed before compiler blacklisting takes place - which means that gcc-4.2 is still selected as the compiler and everything fails badly.

If I wrap both checks into a pre-configure block, delaying execution, it starts working as intended.

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

Yes. I have default_compiler set which would override that for me, so I wouldn't see that.

comment:25 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Does it work just adding the CMAKE_LIBTOOL block behind pre_configure? configure.compiler should always evaluate after the blacklisting, so I doubt that is problematic.

@@ -243,10 +243,12 @@ if {[string match macports-clang-* ${configure.compiler}]} {
     depends_skip_archcheck-append cctools
 }
 
-# Set CMAKE_LIBTOOL if we're using MacPorts-provided cctools
-if {[lsearch -exact $PortInfo(depends_build) port:cctools] != -1} {
-    configure.args-append \
-        -DCMAKE_LIBTOOL=${prefix}/bin/libtool
+pre_configure {
+    # Set CMAKE_LIBTOOL if we're using MacPorts-provided cctools
+    if {[lsearch -exact $PortInfo(depends_build) port:cctools] != -1} {
+        configure.args-append \
+            -DCMAKE_LIBTOOL=${prefix}/bin/libtool
+    }
 }
 
 if {${subport} eq "llvm-${llvm_version}"} {

comment:26 Changed 7 years ago by Ionic (Mihai Moldovan)

No, it doesn't. ${configure.compiler} is being used before blacklisting, which keeps it at gcc-4.2 and hence any dependencies upon cctools are not added to depends_build. This holds for unpatched base.

The situation is different if I backport your base patch (though we cannot rely on that for the moment): since the cctools dependency is added by base early enough, the cmake option is also added in the pre-configure block.

Take a look at these two log files - one made with vanilla base, the other one with the backported patch. I've added ui_debug statements to the Portfile for printing out ${configure.compiler} and $PortInfo(depends_build). Two of them in global scope (before and after the block that should add the cctools dewpendency) and one of them in pre-configure scope.

For now, we should delay both blocks by putting them into the pre-configure phase.

Last edited 7 years ago by Ionic (Mihai Moldovan) (previous) (diff)

Changed 7 years ago by Ionic (Mihai Moldovan)

Attachment: debug-vanilla-base.log added

vanilla base attempt

Changed 7 years ago by Ionic (Mihai Moldovan)

Attachment: debug-patched-base.log added

patched base attempt

comment:27 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

${configure.compiler} is being used before blacklisting

Well then that is the issue that needs to be addressed. Wrapping it all in a pre-configure script isn't the solution there.

comment:28 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

In b6107767144ad4774c2d9bd13c6c77890b3d8ba6/macports-ports, that block has been moved after the blacklisting.

comment:29 Changed 7 years ago by Ionic (Mihai Moldovan)

That works great. Thanks!

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

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.