Skip to content

Added build-android script which will build libdispatch for Android #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from

Conversation

amraboelela
Copy link
Contributor

@amraboelela
Copy link
Contributor Author

@milseman pls check this, thanks

@compnerd
Copy link
Member

Are you aware of the cmake based build system? You should be able to build for android using CMake by doing:

cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_NDK=<path to android NDK> <path to source to libdispatch>

@amraboelela
Copy link
Contributor Author

Hi @compnerd have you tried it?

Thanks

@compnerd
Copy link
Member

@amraboelela I've not built it myself, but have worked with a number of others to build it. If there are issues with that, I'm happy to help resolve those.

@dgrove-oss
Copy link
Contributor

echoing @compnerd comment; we're hopefully just about to switch to CMake as the build system for libdispatch. So, android build should be based on that, not autotools.

@MadCoder
Copy link
Contributor

Agreed, please do not use autoconf for new work.

Also, once we update the documentation (hint @compnerd) to explain how to hold CMake we should write the instructions here, I'd like to avoid having 10 different scripts for every single port. Instead the CMake build should do the right thing based on a single (or at most two) arguments.

@compnerd
Copy link
Member

@MadCoder, yeah, thats the next change that I intend to make -- the docs!

@amraboelela
Copy link
Contributor Author

I ran:
cmake -DCMAKE_SYSTEM_NAME=Android
-DCMAKE_SYSTEM_VERSION=21
-DCMAKE_ANDROID_NDK=$ANDROID_NDK_PATH

I got:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/amr/swift/swift-corelibs-libdispatch

~/swift/swift-corelibs-libdispatch$ git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Untracked files:
(use "git add ..." to include in what will be committed)

CMakeCache.txt
CMakeFiles/
CTestTestfile.cmake
TryRunResults.cmake
build-android-cmake
cmake_install.cmake
dispatch/CMakeFiles/
dispatch/CTestTestfile.cmake
dispatch/cmake_install.cmake
man/CMakeFiles/
man/CTestTestfile.cmake
man/cmake_install.cmake
os/CMakeFiles/
os/CTestTestfile.cmake
os/cmake_install.cmake
private/CMakeFiles/
private/CTestTestfile.cmake
private/cmake_install.cmake
src/CMakeFiles/
src/CTestTestfile.cmake
src/cmake_install.cmake
tests/CMakeFiles/
tests/CTestTestfile.cmake
tests/cmake_install.cmake

I couldn't find libdispatch.so

@compnerd
Copy link
Member

You need to run the make command to actually build it. CMake generates the build rules.

@amraboelela
Copy link
Contributor Author

Ah ok, what about make install? Can I make it copy the libdispatch.so to the android toolchain, like what I did in the original script?

@amraboelela
Copy link
Contributor Author

So cmake is just a replacement of autoconf and configure?

@amraboelela
Copy link
Contributor Author

Now I got:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/amr/swift/swift-corelibs-libdispatch
[ 1%] Building C object CMakeFiles/BlocksRuntime.dir/src/BlocksRuntime/data.c.o
cc: error: unrecognized command line option ‘-Wdocumentation’
cc: error: unrecognized command line option ‘-Wconstant-conversion’
cc: error: unrecognized command line option ‘-Wbool-conversion’
cc: error: unrecognized command line option ‘-Wenum-conversion’
cc: error: unrecognized command line option ‘-Wassign-enum’
cc: error: unrecognized command line option ‘-Wshorten-64-to-32’
cc: error: unrecognized command line option ‘-Wnewline-eof’
cc: error: unrecognized command line option ‘-Winfinite-recursion’
cc: error: unrecognized command line option ‘-Warray-bounds-pointer-arithmetic’
cc: error: unrecognized command line option ‘-Watomic-properties’
cc: error: unrecognized command line option ‘-Wcomma’
cc: error: unrecognized command line option ‘-Wconditional-uninitialized’
cc: error: unrecognized command line option ‘-Wcovered-switch-default’
cc: error: unrecognized command line option ‘-Wduplicate-enum’
cc: error: unrecognized command line option ‘-Wexpansion-to-defined’
cc: error: unrecognized command line option ‘-Widiomatic-parentheses’
cc: error: unrecognized command line option ‘-Wimplicit-fallthrough’
cc: error: unrecognized command line option ‘-Wnullable-to-nonnull-conversion’
cc: error: unrecognized command line option ‘-Wobjc-interface-ivars’
cc: error: unrecognized command line option ‘-Wover-aligned’
cc: error: unrecognized command line option ‘-Wstatic-in-inline’
cc: error: unrecognized command line option ‘-Wsuper-class-method-mismatch’
cc: error: unrecognized command line option ‘-Wtautological-compare’
cc: error: unrecognized command line option ‘-Wunguarded-availability’
CMakeFiles/BlocksRuntime.dir/build.make:62: recipe for target 'CMakeFiles/BlocksRuntime.dir/src/BlocksRuntime/data.c.o' failed
make[2]: *** [CMakeFiles/BlocksRuntime.dir/src/BlocksRuntime/data.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/BlocksRuntime.dir/all' failed
make[1]: *** [CMakeFiles/BlocksRuntime.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

@compnerd
Copy link
Member

Yeah, CMake is a replacement for autoconf/automake. I think you failed to specify -DCMAKE_C_COMPILER=/path/to/clang and -DCMAKE_CXX_COMPILER=/path/to/clang++ so you are using the system compiler, which is not what you want. Yes, you can copy libdispatch.so as you used to, or you can use the install rule with the generator (e.g. ninja install).

@amraboelela
Copy link
Contributor Author

Ok I am able to generate libdisptach.so file now inside the src directory. What about Dispatch.swiftmodule file, I need this one too. How can I generate it?

@compnerd
Copy link
Member

You need to provide the path to the swift compiler -DCMAKE_SWIFT_COMPILER=/path/to/swiftc, that should generate Dispatch.swiftmodule.

@amraboelela
Copy link
Contributor Author

So I am ending up giving back all the parameters i used to pass to configure before :)

What about making it release instead of debug?

Also I noticed that the generated lib dispatch.so file is 641KB while before it was 909KB, do u know why?

@amraboelela
Copy link
Contributor Author

Now I am using:
cmake -DCMAKE_SYSTEM_NAME=Android
-DCMAKE_SYSTEM_VERSION=21
-DCMAKE_ANDROID_NDK=$ANDROID_NDK_PATH
-DCMAKE_C_COMPILER=$SWIFT_ANDROID_BUILD_PATH/llvm-linux-x86_64/bin/clang
-DCMAKE_CXX_COMPILER=$SWIFT_ANDROID_BUILD_PATH/llvm-linux-x86_64/bin/clang++
-DCMAKE_SWIFT_COMPILER=$SWIFT_ANDROID_BUILD_PATH/swift-linux-x86_64/bin/swiftc

make

And I got:
../src/libdispatch.so: undefined reference to _T0s14CountableRangeVMa' ../src/libdispatch.so: undefined reference to _T0Sus13BinaryIntegersWP'
../src/libdispatch.so: undefined reference to _T0s9OptionSetPsE12intersectionxxF' ../src/libdispatch.so: undefined reference to _T0s26DefaultRandomAccessIndicesVyxGs10Collectionss01_bC9IndexableRzlWa'
../src/libdispatch.so: undefined reference to _T0SvN' ../src/libdispatch.so: undefined reference to _T0s5Int64Vs13SignedIntegersWP'
../src/libdispatch.so: undefined reference to _T0s9OptionSetPsE5unionxxF' ../src/libdispatch.so: undefined reference to _T0SVN'
../src/libdispatch.so: undefined reference to _T0S2SSgSPys4Int8VG14validatingUTF8_tcfC' ../src/libdispatch.so: undefined reference to _T0SPMa'
../src/libdispatch.so: undefined reference to swift_endAccess' ../src/libdispatch.so: undefined reference to _T0s10CollectionPsE6prefix11SubSequenceQzSiF'
../src/libdispatch.so: undefined reference to _T0s27_allocateUninitializedArraySayxG_BptBwlFSS_Tgq5' ../src/libdispatch.so: undefined reference to _T0s17RandomAccessSliceVyxGs23BidirectionalCollectionss01_aB9IndexableRzlWa'
../src/libdispatch.so: undefined reference to _T0s10SetAlgebraPssAARz7ElementQz012ArrayLiteralC0RtzlExSayAFG05arrayE0d_tcfC' ../src/libdispatch.so: undefined reference to _T0s22RandomAccessCollectionMp'
../src/libdispatch.so: undefined reference to _swift_release' ../src/libdispatch.so: undefined reference to _T0s25ExpressibleByArrayLiteralMp'
../src/libdispatch.so: undefined reference to _T0s19_emptyStringStorages6UInt32Vvp' ../src/libdispatch.so: undefined reference to _T0s15UnsignedIntegerPss010FixedWidthB0RzsAARzlExqd__cs06BinaryB0Rd(long, float __restrict, const)'
../src/libdispatch.so: undefined reference to _T0SuMa' ../src/libdispatch.so: undefined reference to _T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzlufC'
../src/libdispatch.so: undefined reference to _T0s9OptionSetPssAARzs17FixedWidthInteger8RawValueRpzlE16formIntersectionyxF' ../src/libdispatch.so: undefined reference to _T0SQMa'
../src/libdispatch.so: undefined reference to _T0s10CollectionPsE3mapSayqd__Gqd__7ElementQzKcKlF' ../src/libdispatch.so: undefined reference to _T0Sis11_StrideablesWP'
../src/libdispatch.so: undefined reference to _T0s9OptionSetPssAARzs17FixedWidthInteger8RawValueRpzlExycfC' ../src/libdispatch.so: undefined reference to _T0s23_BidirectionalIndexableMp'
../src/libdispatch.so: undefined reference to _T0SR11baseAddressSPyxGSgvg' ../src/libdispatch.so: undefined reference to _T0Sq7flatMapqd__SgABxKcKlF'
../src/libdispatch.so: undefined reference to _T0s8SequencePsE18_preprocessingPassqd__Sgqd__yKcKlF' ../src/libdispatch.so: undefined reference to _T0s5Int16Vs13BinaryIntegersWP'
../src/libdispatch.so: undefined reference to `_T0s23_BidirectionalIndexablePsE8distance13IndexDistanceQz0D0Qz4from_AG2totF'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
tests/CMakeFiles/dispatch_plusplus.dir/build.make:97: recipe for target 'tests/dispatch_plusplus' failed
make[2]: *** [tests/dispatch_plusplus] Error 1
CMakeFiles/Makefile2:361: recipe for target 'tests/CMakeFiles/dispatch_plusplus.dir/all' failed
make[1]: *** [tests/CMakeFiles/dispatch_plusplus.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

@compnerd
Copy link
Member

You know, its probably better off if you use build-script. It already sets up all the parameters for you. The errors sound like you're failing to link against the swift stdlib.

@amraboelela
Copy link
Contributor Author

But using the old fashion configure was working fine. Don't think build-script will help build lib dispatch for android, I tried it. My original build-android was based on: https://github.com/SwiftJava/swifty-robot-environment/blob/master/util/prepare_environment/060_build_corelibs_libdispatch.sh

@amraboelela
Copy link
Contributor Author

I added build-android-cmake if someone wanna try it

@awakecoding
Copy link

@amraboelela I'm not using swift, as I'm only interested in libdispatch for pure C usage. As for your issue with Dispatch.swiftmodule, I'm pretty sure it can be done with CMake. Can you describe what's involved? Otherwise you can ask in the #cmake channel on freenode, the devs are really helpful.

@compnerd
Copy link
Member

compnerd commented Oct 4, 2017

FYI, the last set of improvements for libdispatch's build should take care of the issues that you saw with dispatch_plusplus. Note that you will need to add -DENABLE_SWIFT=YES to build the swift overlay.

@amraboelela
Copy link
Contributor Author

Actually the latest “improvement” caused the swift/utils/android/build-toolchain to fail :), as it is no longer generate Dispatch.swiftmodule for linux, it used to do that before.

@compnerd
Copy link
Member

compnerd commented Oct 5, 2017

As I mentioned, you will need to add the explicit flag to enable the swift part of the build :-). We most definitely generate that as it is done as part of the build for the swift SDK overlay :-).

@amraboelela
Copy link
Contributor Author

This is what the android/build-toolchain looks like:

${SWIFT_PATH}/swift/utils/build-script
-R
--android
--android-ndk ${ANDROID_NDK_PATH}
--android-api-level 21
--android-icu-uc "${ANDROID_ICU_PATH}/armeabi-v7a"
--android-icu-uc-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/common"
--android-icu-i18n "${ANDROID_ICU_PATH}/armeabi-v7a"
--android-icu-i18n-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/i18n"
--llbuild --install-llbuild
--lldb --install-lldb
--install-swift
--libdispatch --install-libdispatch
--swiftpm --install-swiftpm
--install-destdir=${SWIFT_ANDROID_TOOLCHAIN_PATH}

Can I add -DENABLE_SWIFT=YES to build-script parameters?

@compnerd
Copy link
Member

compnerd commented Oct 5, 2017

Yeah, you could add that to the build script parameters as extra parameters. However, I think that is the core of the issue -- I never wired up the --android-ndk parameter into the CMake invocation for libdispatch. That should be easy to do in build-script-impl though.

@amraboelela
Copy link
Contributor Author

So will it look like this?

${SWIFT_PATH}/swift/utils/build-script
-R
--android
--android-ndk ${ANDROID_NDK_PATH}
--android-api-level 21
--android-icu-uc "${ANDROID_ICU_PATH}/armeabi-v7a"
--android-icu-uc-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/common"
--android-icu-i18n "${ANDROID_ICU_PATH}/armeabi-v7a"
--android-icu-i18n-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/i18n"
--llbuild --install-llbuild
--lldb --install-lldb
--install-swift
--libdispatch --install-libdispatch
--swiftpm --install-swiftpm
--install-destdir=${SWIFT_ANDROID_TOOLCHAIN_PATH}
-DENABLE_SWIFT=YES

Doesn't look right, as it is different from other parameters

@amraboelela
Copy link
Contributor Author

amraboelela commented Oct 5, 2017

Another weird thing I noticed, when I run:

${SWIFT_PATH}/swift/utils/build-script
-R
--llbuild --install-llbuild
--install-swift
--lldb --install-lldb
--libdispatch --install-libdispatch
--install-destdir=${SWIFT_ANDROID_TOOLCHAIN_PATH}

I get:
swift-android-toolchain$ find . -name "ispatch"
./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix
./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix/include/dispatch
./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix/include/dispatch/dispatch.h
./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix/lib/libdispatch.so
./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix/lib/swift/linux/x86_64/Dispatch.swiftdoc
./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix/lib/swift/linux/x86_64/Dispatch.swiftmodule

swift-android-toolchain$ find . -name "*.swiftmodule"
./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix/lib/swift/linux/x86_64/Dispatch.swiftmodule
./usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule
./usr/lib/swift/linux/x86_64/StdlibUnittest.swiftmodule
./usr/lib/swift/linux/x86_64/SwiftPrivatePthreadExtras.swiftmodule
./usr/lib/swift/linux/x86_64/SwiftPrivate.swiftmodule
./usr/lib/swift/linux/x86_64/SwiftPrivateLibcExtras.swiftmodule
./usr/lib/swift/linux/x86_64/Glibc.swiftmodule
./usr/lib/swift/linux/x86_64/Swift.swiftmodule

Why does it put the full path ./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix into the toolchain?

@ephemer
Copy link
Contributor

ephemer commented Oct 9, 2017

I'm currently blocked by this issue, also because I need to build Foundation, which relies on Dispatch as well. Does anyone have a status update on this? @amraboelela?

@compnerd the invocation in https://github.com/apple/swift-corelibs-libdispatch/blob/master/INSTALL.md only seems to build x86_64 libraries on my machine (Ubuntu 16.04) and an invocation of swift's build-script like this:

utils/build-script \
    -R \
    --android \
    --android-ndk $NDK \
    --android-api-level 21 \
    --android-icu-uc $LIBICONV_ANDROID/armeabi-v7a/ \
    --android-icu-uc-include $LIBICONV_ANDROID/armeabi-v7a/icu/source/common \
    --android-icu-i18n $LIBICONV_ANDROID/armeabi-v7a/ \
    --android-icu-i18n-include $LIBICONV_ANDROID/armeabi-v7a/icu/source/i18n \
    --libdispatch --install-libdispatch \
    --foundation --install-foundation \
    --llbuild --install-llbuild \
    --lldb --install-lldb \
    --swiftpm --install-swiftpm \
    --xctest --install-xctest \
    --install-swift \
    '--swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;dev' \
    --install-prefix=/usr --install-destdir=$SWIFT_INSTALLATION_PATH

... doesn't seem to build dispatch for Android, only for the host system (unless I'm just looking in the wrong place? It's definitely not in build/Ninja-ReleaseAssert/lib/swift/android)

I'd greatly appreciate any help or updates on this

@compnerd
Copy link
Member

compnerd commented Oct 9, 2017

Yeah, the install doesn't place it under android but rather linux. That is an easy fix. I don't use the build-script, so can you please extract the cmake invocation?

@ephemer
Copy link
Contributor

ephemer commented Oct 10, 2017

linux only has a x86_64 subdirectory, no armv7 etc. I have searched (with find .) the entire build directory for .so or .a files that may have anything to do with dispatch for Android. If it's there it's well hidden.

By cmake invocation, do you mean the dry-run output of build-script or do you need something else?

@compnerd
Copy link
Member

@ephemer sure the dry run output should contain the CMake invocation. Did you pass CMAKE_SYSTEM_PROCESSOR?

@compnerd
Copy link
Member

Okay, with #312 I was able to build a libdispatch.so for android. I didn't have the swift stdlib available for android, so I didn't test the swift integration.

@amraboelela
Copy link
Contributor Author

I tried build-android-cmake
and i got:
...
-- Configuring incomplete, errors occurred!
See also "/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeOutput.log".
See also "/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeError.log".

@amraboelela
Copy link
Contributor Author

CMakeError.log contains:

Determining if the VQ_VERYLOWDISK exist failed with the following output:
Change Dir: /home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_aefd8/fast"
/usr/bin/make -f CMakeFiles/cmTC_aefd8.dir/build.make CMakeFiles/cmTC_aefd8.dir/build
make[1]: Entering directory '/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_aefd8.dir/CheckSymbolExists.c.o
/usr/bin/cc -D_GNU_SOURCE -o CMakeFiles/cmTC_aefd8.dir/CheckSymbolExists.c.o -c /home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In function ‘main’:
/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: ‘VQ_VERYLOWDISK’ undeclared (first use in this function)
return ((int*)(&VQ_VERYLOWDISK))[argc];
^
/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
CMakeFiles/cmTC_aefd8.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_aefd8.dir/CheckSymbolExists.c.o' failed
make[1]: *** [CMakeFiles/cmTC_aefd8.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_aefd8/fast' failed
make: *** [cmTC_aefd8/fast] Error 2

@amraboelela
Copy link
Contributor Author

Run Build Command:"/usr/bin/make" "cmTC_ec569/fast"
/usr/bin/make -f CMakeFiles/cmTC_ec569.dir/build.make CMakeFiles/cmTC_ec569.dir/build
make[1]: Entering directory '/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ec569.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_ec569.dir/CheckSymbolExists.c.o -c /home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_ec569
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ec569.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_ec569.dir/CheckSymbolExists.c.o -o cmTC_ec569
CMakeFiles/cmTC_ec569.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x16): undefined reference to pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_ec569.dir/build.make:97: recipe for target 'cmTC_ec569' failed
make[1]: *** [cmTC_ec569] Error 1
make[1]: Leaving directory '/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_ec569/fast' failed
make: *** [cmTC_ec569/fast] Error 2

Determining if the function _pthread_workqueue_init exists failed with the following output:
Change Dir: /home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_2e36f/fast"
/usr/bin/make -f CMakeFiles/cmTC_2e36f.dir/build.make CMakeFiles/cmTC_2e36f.dir/build
make[1]: Entering directory '/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2e36f.dir/CheckFunctionExists.c.o
/usr/bin/cc -D_GNU_SOURCE -DCHECK_FUNCTION_EXISTS=_pthread_workqueue_init -o CMakeFiles/cmTC_2e36f.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_2e36f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2e36f.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=_pthread_workqueue_init CMakeFiles/cmTC_2e36f.dir/CheckFunctionExists.c.o -o cmTC_2e36f
CMakeFiles/cmTC_2e36f.dir/CheckFunctionExists.c.o: In function main': CheckFunctionExists.c:(.text+0x15): undefined reference to _pthread_workqueue_init'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_2e36f.dir/build.make:97: recipe for target 'cmTC_2e36f' failed
make[1]: *** [cmTC_2e36f] Error 1

Determining if the function mach_absolute_time exists failed with the following output:
Change Dir: /home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_6fc57/fast"
/usr/bin/make -f CMakeFiles/cmTC_6fc57.dir/build.make CMakeFiles/cmTC_6fc57.dir/build
make[1]: Entering directory '/home/amr/swift/swift-corelibs-libdispatch/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6fc57.dir/CheckFunctionExists.c.o
/usr/bin/cc -D_GNU_SOURCE -DCHECK_FUNCTION_EXISTS=mach_absolute_time -o CMakeFiles/cmTC_6fc57.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_6fc57
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6fc57.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=mach_absolute_time CMakeFiles/cmTC_6fc57.dir/CheckFunctionExists.c.o -o cmTC_6fc57
CMakeFiles/cmTC_6fc57.dir/CheckFunctionExists.c.o: In function main': CheckFunctionExists.c:(.text+0x15): undefined reference to mach_absolute_time'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_6fc57.dir/build.make:97: recipe for target 'cmTC_6fc57' failed
make[1]: *** [cmTC_6fc57] Error 1

@alblue
Copy link

alblue commented May 24, 2018

This PR has gone stale. Please rebase and fix the conflicts before re-opening.

@alblue alblue closed this May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants