runtime icon indicating copy to clipboard operation
runtime copied to clipboard

CMake flags for arm-softfp rootfs (cross build)

Open prajwal-aithal opened this issue 10 years ago • 3 comments

In the cross/arm-softfp/toolchain.cmake file, the following code snippet sets the cross link flags

set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN} -L${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")

Shouldn't the path passed to the -B flag be as follows?

set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN} -L${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")

@kvochko @ianhays

prajwal-aithal avatar May 24 '16 03:05 prajwal-aithal

cc: @jyoungyun @seanshpark @leemgs

prajwal-aithal avatar May 24 '16 03:05 prajwal-aithal

the second line,

-L${CROSS_ROOTFS}/lib/${TOOLCHAIN} -L${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}

is this ok too?

seanshpark avatar May 24 '16 04:05 seanshpark

It shall be:

set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")

It perfectly works for both CoreCLR and CoreFX (see https://github.com/dotnet/corefx/pull/8678).

mkborg avatar May 24 '16 09:05 mkborg