-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Cross-compilation support for native code #6194
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe | ||
|
|
||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe | ||
|
|
||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted | ||
|
|
||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these references to Ubuntu and trusty... so is this support only valid on Ubuntu 14.*?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes (this file is identical to the same file in CoreCLR/RT). |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| set(CROSS_ROOTFS $ENV{ROOTFS_DIR}) | ||
|
|
||
| set(CMAKE_SYSTEM_NAME Linux) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you request a cross build, should we display a warning and disable it if you're not on a supported system? e.g. what happens if someone tries to specify cross on OS X?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have the same problem with CoreCLR and CoreRT. |
||
| set(CMAKE_SYSTEM_VERSION 1) | ||
| set(CMAKE_SYSTEM_PROCESSOR armv7l) | ||
|
|
||
| add_compile_options(-target armv7-linux-gnueabihf) | ||
| add_compile_options(-mthumb) | ||
| add_compile_options(-mfpu=vfpv3) | ||
| add_compile_options(--sysroot=${CROSS_ROOTFS}) | ||
|
|
||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target arm-linux-gnueabihf") | ||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/arm-linux-gnueabihf") | ||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/arm-linux-gnueabihf") | ||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}") | ||
|
|
||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) | ||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) | ||
| set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) | ||
|
|
||
| set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}") | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
|
||
| set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/arm-linux-gnueabihf" CACHE STRING "") | ||
| set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include" CACHE STRING "") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| SET( REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( SSCANF_SUPPORT_ll_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_SCHED_GET_PRIORITY_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_WORKING_GETTIMEOFDAY_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_WORKING_CLOCK_GETTIME_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_CLOCK_MONOTONIC_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_MMAP_DEV_ZERO_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( MMAP_IGNORES_HINT_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( MMAP_DOESNOT_ALLOW_REMAP_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( PTHREAD_CREATE_MODIFIES_ERRNO_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( SEM_INIT_MODIFIES_ERRNO_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_COMPATIBLE_ACOS_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_COMPATIBLE_ASIN_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_COMPATIBLE_POW_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_VALID_NEGATIVE_INF_POW_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_VALID_POSITIVE_INF_POW_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_COMPATIBLE_ATAN2_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_COMPATIBLE_LOG_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_COMPATIBLE_LOG10_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( UNGETC_NOT_RETURN_EOF_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAS_POSIX_SEMAPHORES_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( GETPWUID_R_SETS_ERRNO_EXITCODE | ||
| 0 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
| SET( HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE | ||
| 1 | ||
| CACHE STRING "Result from TRY_RUN" FORCE) | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Many of these aren't used in this repo, right? Can we remove them and only include the ones that are?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do a cleanup when I'm back. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe | ||
|
|
||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe | ||
|
|
||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted | ||
|
|
||
| deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse | ||
| deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| set(CROSS_ROOTFS $ENV{ROOTFS_DIR}) | ||
|
|
||
| set(CMAKE_SYSTEM_NAME Linux) | ||
| set(CMAKE_SYSTEM_VERSION 1) | ||
| set(CMAKE_SYSTEM_PROCESSOR aarch64) | ||
|
|
||
| add_compile_options(-target aarch64-linux-gnu) | ||
| add_compile_options(--sysroot=${CROSS_ROOTFS}) | ||
|
|
||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target aarch64-linux-gnu") | ||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-linux-gnu") | ||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/aarch64-linux-gnu") | ||
| set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}") | ||
|
|
||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) | ||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) | ||
| set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) | ||
|
|
||
| set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}") | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this part. We warn that cross-compilation isn't yet supported if CrossBuild isn't set, but if it is set, we don't warn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rereading it again, I think that I should have left things as they are for the condition, but changed the warning message to be more explicit. It should say something along the lines of:
echo "Warning: compiling native components for a different OS is not yet supported"
Would you agree?