View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014254CMakeCMakepublic2013-06-28 11:192016-06-06 13:37
ReporterTobias Hieta 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformMacbook ProOSMacOSXOS Version10.8.4
Product VersionCMake 2.8.11.1 
Target VersionCMake 3.0Fixed in VersionCMake 3.0 
Summary0014254: With Xcode-5DP $CURRENT_ARCH is set to undefined_arch and makes OBJECT libraries fail to compile
DescriptionThe following test example fails to work with the Xcode generator and Xcode 5DP-2

add_library(lib OBJECT lib.c)
add_executable(test test.c $<TARGET_OBJECTS:lib>)

The problem seems to be that CURRENT_ARCH is set to undefined_arch whatever I try to select, Xcode buildlog:

CompileC b/Project.build/Debug/lib.build/Objects-normal/x86_64/lib.o lib.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/tru/Documents/Code/cmake-xcode-bug
    setenv LANG en_US.US-ASCII
    /Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCMAKE_INTDIR=\"Debug\" -isysroot /Applications/Xcode5-DP2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=10.8 -g -Wno-sign-conversion -I/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/include -I/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/DerivedSources/x86_64 -I/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal -MMD -MT dependencies -MF /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/x86_64/lib.d --serialize-diagnostics /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/x86_64/lib.dia -c /Users/tru/Documents/Code/cmake-xcode-bug/lib.c -o /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/x86_64/lib.o
Libtool b/Project.build/Debug/lib.build/Objects-normal/liblib.a normal x86_64
    cd /Users/tru/Documents/Code/cmake-xcode-bug
    setenv MACOSX_DEPLOYMENT_TARGET 10.8
    /Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode5-DP2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal -filelist /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/x86_64/lib.LinkFileList -o /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/liblib.a
CompileC b/Project.build/Debug/test.build/Objects-normal/x86_64/test.o test.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/tru/Documents/Code/cmake-xcode-bug
    setenv LANG en_US.US-ASCII
    /Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCMAKE_INTDIR=\"Debug\" -isysroot /Applications/Xcode5-DP2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=10.8 -g -Wno-sign-conversion -I/Users/tru/Documents/Code/cmake-xcode-bug/b/Debug/include -I/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/test.build/DerivedSources/x86_64 -I/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/test.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/tru/Documents/Code/cmake-xcode-bug/b/Debug -MMD -MT dependencies -MF /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/test.build/Objects-normal/x86_64/test.d --serialize-diagnostics /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/test.build/Objects-normal/x86_64/test.dia -c /Users/tru/Documents/Code/cmake-xcode-bug/test.c -o /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/test.build/Objects-normal/x86_64/test.o
Ld b/Debug/test normal x86_64
    cd /Users/tru/Documents/Code/cmake-xcode-bug
    setenv MACOSX_DEPLOYMENT_TARGET 10.8
    /Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode5-DP2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/tru/Documents/Code/cmake-xcode-bug/b/Debug -F/Users/tru/Documents/Code/cmake-xcode-bug/b/Debug -filelist /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/test.build/Objects-normal/x86_64/test.LinkFileList -mmacosx-version-min=10.8 -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/undefined_arch/lib.o -Xlinker -dependency_info -Xlinker /Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/test.build/Objects-normal/x86_64/test_dependency_info.dat -o /Users/tru/Documents/Code/cmake-xcode-bug/b/Debug/test
clang: error: no such file or directory: '/Users/tru/Documents/Code/cmake-xcode-bug/b/Project.build/Debug/lib.build/Objects-normal/undefined_arch/lib.o'


Test case attached.
Additional InformationMarked as private since Xcode5 is still under NDA.
TagsNo tags attached.
Attached Filesgz file icon cmake-xcode5-bug-test.tar.gz [^] (81,012 bytes) 2013-06-28 11:19

 Relationships

  Notes
(0033402)
Brad King (manager)
2013-06-28 15:19

The use of CURRENT_ARCH was added here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8045e171 [^]

Is there an alternative for this version of Xcode?
(0033967)
Brad King (manager)
2013-10-02 14:05

Now that Xcode 5 is out I was able to reproduce this. While $(CURRENT_ARCH) appears to be broken in the PBXFileReference objects used to add object files to the link phase, Xcode 5 also fixes dependencies in OTHER_LDFLAGS so we can put the objects there instead.

Here is the fix:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3194ff4 [^]

The 3 immediate ancestors of that commit also fix other problems with Xcode 5.

If there are further issues please open a public issue entry now that Xcode 5 has been released.
(0035275)
Robert Maynard (manager)
2014-03-05 09:58

Closing resolved issues that have not been updated in more than 4 months

 Issue History
Date Modified Username Field Change
2013-06-28 11:19 Tobias Hieta New Issue
2013-06-28 11:19 Tobias Hieta File Added: cmake-xcode5-bug-test.tar.gz
2013-06-28 15:19 Brad King Note Added: 0033402
2013-10-02 14:05 Brad King Note Added: 0033967
2013-10-02 14:05 Brad King Assigned To => Brad King
2013-10-02 14:05 Brad King Status new => resolved
2013-10-02 14:05 Brad King Resolution open => fixed
2013-10-02 14:05 Brad King Fixed in Version => CMake 3.0
2013-10-02 14:05 Brad King Target Version => CMake 3.0
2014-03-05 09:58 Robert Maynard Note Added: 0035275
2014-03-05 09:58 Robert Maynard Status resolved => closed
2016-06-06 13:37 Brad King View Status private => public


Copyright © 2000 - 2018 MantisBT Team