Skip to content

Commit 4435bff

Browse files
committed
Ensure newlib gets compiled with the correct target flags
newlib was not building correctly for ARMv7 and ARMv8 targets due to not being passed the -march, -mfpu and -mfloat-abi flags which are required for the compiler to generate correct assembly (it was outputing incorrect assembly without triggering any warnings)
1 parent 30e3b2c commit 4435bff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arm-software/embedded/arm-runtimes/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ if(C_LIBRARY MATCHES "^newlib")
511511
"RANLIB_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ranlib"
512512
"READELF_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-readelf"
513513
"STRIP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-strip"
514-
"CFLAGS_FOR_TARGET=${flags} ${newlib_optim_flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}"
515-
"CCASFLAGS=${flags} ${newlib_optim_flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}"
514+
"CFLAGS_FOR_TARGET=${flags} ${newlib_optim_flags} ${lib_compile_flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI"
515+
"CCASFLAGS=${flags} ${newlib_optim_flags} ${lib_compile_flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI"
516516
)
517517

518518
include(ProcessorCount)

0 commit comments

Comments
 (0)