summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-02-10 21:20:31 -0700
committerEvan Lojewski <github@meklort.com>2019-02-10 21:20:31 -0700
commit4d74b901eb79f99f5ea1710bf4aa4a67bf5ed947 (patch)
tree1cbcad8ba84651b7be6f281aa51bfbd780bb6003 /cmake
parent37e71f8b9a75df96f8901d5ebb51972ab3aac96e (diff)
downloadbcm5719-ortega-4d74b901eb79f99f5ea1710bf4aa4a67bf5ed947.tar.gz
bcm5719-ortega-4d74b901eb79f99f5ea1710bf4aa4a67bf5ed947.zip
Add an initial linker script and crt file for stage1
Diffstat (limited to 'cmake')
-rw-r--r--cmake/mips.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/mips.cmake b/cmake/mips.cmake
index 5edcb60..b9de02b 100644
--- a/cmake/mips.cmake
+++ b/cmake/mips.cmake
@@ -2,7 +2,7 @@
###
### @file mips.cmake
###
-### @project
+### @project
###
### @brief MIPS specific configurations
###
@@ -46,12 +46,16 @@ SET(MIPS_COMPILE_OPTIONS -nostdlib -nodefaultlibs -fomit-frame-pointer -target m
SET(MIPS_LINK_OPTIONS -static-libgcc)
SET(CMAKE_EXE_LINKER_FLAGS -static)
+# ASM files
+SET(CMAKE_INCLUDE_FLAG_ASM "-I")
+SET(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
SET(CMAKE_mips_LINK_EXECUTABLE "ld.lld <OBJECTS> <LINK_LIBRARIES> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -Bstatic -o <TARGET>")
# MIPS-specific executables
function(mips_add_executable target)
add_executable(${target} ${ARGN})
-
+
target_compile_options(${target} PRIVATE ${MIPS_COMPILE_OPTIONS})
set_property(TARGET ${target} APPEND PROPERTY LINK_OPTIONS ${MIPS_LINK_OPTIONS})
set_property(TARGET ${target} PROPERTY LINKER_LANGUAGE mips)
@@ -60,6 +64,6 @@ endfunction(mips_add_executable)
# MIPS-specific libraries
function(mips_add_library target)
add_library(${target} ${ARGN})
-
+
target_compile_options(${target} PRIVATE ${MIPS_COMPILE_OPTIONS})
endfunction(mips_add_library)
OpenPOWER on IntegriCloud