Skip to content

Commit dc7dd64

Browse files
authored
Undefine the macro _HAVE_INIT_FINI which is defined in newlib. (#624)
Newlib overlay package has calls to init and fini. When building newlib, referencing of _init and _fini has been suppressed by undefining the corresponding macro HAVE_INIT_FINI and relys on the more modern .init_array and .fini_array. But the name of this macro in newlib has changed from HAVE_INIT_FINI to _HAVE_INIT_FINI, so undefine this macro in the cmake file..
1 parent 7db6e10 commit dc7dd64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arm-runtimes/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ if(C_LIBRARY STREQUAL newlib)
468468
"RANLIB_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ranlib"
469469
"READELF_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-readelf"
470470
"STRIP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-strip"
471-
"CFLAGS_FOR_TARGET=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}"
472-
"CCASFLAGS=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}"
471+
"CFLAGS_FOR_TARGET=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}"
472+
"CCASFLAGS=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}"
473473
)
474474

475475
include(ProcessorCount)

0 commit comments

Comments
 (0)