From 69b5c6a1180431520baf51cff6caa81b993d3fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 6 Apr 2012 11:10:18 +0200 Subject: [PATCH] proposed solution with sh-linux-gnu toolchain --- carlfw/include/config.h | 3 +++ carlfw/include/printf.h | 1 - extra/sh-elf-linux.cmake | 16 ++++++++-------- include/linux/types.h | 3 +-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/carlfw/include/config.h b/carlfw/include/config.h index e7c358d..14a1faf 100644 --- a/carlfw/include/config.h +++ b/carlfw/include/config.h @@ -61,4 +61,7 @@ static inline void __config_check(void) BUILD_BUG_ON(CARL9170_INTF_NUM >= AR9170_MAX_VIRTUAL_MAC); } +extern void *memset (void *__s, int __c, size_t __n); +extern void *memcpy (void *__dest, __const void *__src, size_t __n); + #endif /* __CARL9170FW_CONFIG_H */ diff --git a/carlfw/include/printf.h b/carlfw/include/printf.h index dd4559e..c0912d2 100644 --- a/carlfw/include/printf.h +++ b/carlfw/include/printf.h @@ -27,7 +27,6 @@ #define __CARL9170FW_PRINTF_H #include -#include #include "config.h" #include "carl9170.h" #include "uart.h" diff --git a/extra/sh-elf-linux.cmake b/extra/sh-elf-linux.cmake index 8be6d36..7e34f16 100644 --- a/extra/sh-elf-linux.cmake +++ b/extra/sh-elf-linux.cmake @@ -5,16 +5,16 @@ set_property(DIRECTORY PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/toolchain/inst/) -set(CMAKE_C_FLAGS "-m2 -ml -Os -ffreestanding -nostartfiles") +set(CMAKE_C_FLAGS "-m2 -ml -Os -ffreestanding -fleading-underscore -nostartfiles") set(CMAKE_C_LINK_FLAGS "-static -EL -x --gc-sections") -set(OBJCOPY ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-objcopy) -set(CMAKE_C_COMPILER "${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-gcc") -set(CMAKE_AR ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ar) -set(CMAKE_ASM_COMPILER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-as) -set(CMAKE_ASM-ATT_COMPILER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-as) -set(CMAKE_LINKER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ld) -set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ld -o ") +set(OBJCOPY sh-linux-gnu-objcopy) +set(CMAKE_C_COMPILER sh-linux-gnu-gcc) +set(CMAKE_AR sh-linux-gnu-ar) +set(CMAKE_ASM_COMPILER sh-linux-gnu-as) +set(CMAKE_ASM-ATT_COMPILER sh-linux-gnu-as) +set(CMAKE_LINKER sh-linux-gnu-ld) +set(CMAKE_C_LINK_EXECUTABLE "sh-linux-gnu-ld -o ") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/include/linux/types.h b/include/linux/types.h index 3f45f0f..5d70796 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -19,8 +19,7 @@ #include #include -#include -#include +#include #if BYTE_ORDER == BIG_ENDIAN #error "big endian is not supported by target" -- 1.7.7.6