Modify user build cflags and lds
This commit is contained in:
parent
6176717125
commit
619b32ad49
|
@ -19,7 +19,9 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O2 -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
|
||||
board_specs = stub.o
|
||||
endif
|
||||
|
||||
|
@ -104,7 +106,7 @@ test_irq_hdlr: test_irq_handler.o libserial.o printf.o libipc.o session.o usysca
|
|||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
shell: shell_port.o libserial.o printf.o shell_cmd_list.o shell.o shell_ext.o libfs.o libipc.o session.o usyscall.o arch_usyscall.o libmem.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^ ${board_specs}
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^ ${board_specs} -T $(KERNEL_ROOT)/services/boards/jh7110/jh7110_user.lds
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
test_fault: test_fault.o libserial.o printf.o usyscall.o arch_usyscall.o
|
||||
|
@ -120,7 +122,7 @@ simple_server: simple_server.o libserial.o printf.o libipc.o session.o simple_se
|
|||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
fs_server: fs_server.o libfs.o fs.o libserial.o printf.o libipc.o session.o block_io.o usyscall.o arch_usyscall.o libmem.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^ ${board_specs}
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^ ${board_specs} -T $(KERNEL_ROOT)/services/boards/jh7110/jh7110_user.lds
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
test_priority: test_priority.o libserial.o printf.o usyscall.o arch_usyscall.o libmem.o
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2012, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file jh7110_user.lds
|
||||
* @brief refer to XV6 riscv
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2024.10.10
|
||||
*/
|
||||
|
||||
|
||||
OUTPUT_ARCH("riscv")
|
||||
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x0;
|
||||
|
||||
.text : {
|
||||
*(.text .text.*)
|
||||
}
|
||||
|
||||
.rodata : {
|
||||
. = ALIGN(16);
|
||||
*(.srodata .srodata.*)
|
||||
. = ALIGN(16);
|
||||
*(.rodata .rodata.*)
|
||||
}
|
||||
|
||||
.eh_frame : {
|
||||
*(.eh_frame)
|
||||
*(.eh_frame.*)
|
||||
}
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
.data : {
|
||||
. = ALIGN(16);
|
||||
*(.sdata .sdata.*)
|
||||
. = ALIGN(16);
|
||||
*(.data .data.*)
|
||||
}
|
||||
|
||||
.bss : {
|
||||
. = ALIGN(16);
|
||||
*(.sbss .sbss.*)
|
||||
. = ALIGN(16);
|
||||
*(.bss .bss.*)
|
||||
}
|
||||
|
||||
. = ALIGN((1 << 21));
|
||||
.sdata : {
|
||||
__global_pointer$ = . + 0x800;
|
||||
*(.sdata*)
|
||||
}
|
||||
|
||||
. = ALIGN((1 << 21));
|
||||
_edata = .;
|
||||
_end = .;
|
||||
PROVIDE(end = .);
|
||||
}
|
||||
|
||||
/*
|
||||
SECTIONS
|
||||
{
|
||||
_start = .;
|
||||
_boot_start = .;
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
.text : {
|
||||
. = ALIGN(0x1000);
|
||||
*(.text .text.*)
|
||||
}
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
.data : {
|
||||
. = ALIGN(16);
|
||||
*(.sdata .sdata.*)
|
||||
. = ALIGN(16);
|
||||
*(.data .data.*)
|
||||
|
||||
__start_init_task = .;
|
||||
init_thread_union = .;
|
||||
init_stack = .;
|
||||
KEEP(*(.data..init_task))
|
||||
KEEP(*(.data..init_thread_info))
|
||||
. = __start_init_task + ((1 << (12)) << (2));
|
||||
__end_init_task = .;
|
||||
|
||||
|
||||
PROVIDE(__init_array_start = .);
|
||||
PROVIDE(__init_array_end = .);
|
||||
}
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
_image_size = . - _start;
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
.bss : {
|
||||
PROVIDE(kernel_data_begin = .);
|
||||
PROVIDE(__bss_start = .);
|
||||
*(.bss .bss.* COMMON)
|
||||
. = ALIGN(0x1000);
|
||||
PROVIDE(__bss_end = .);
|
||||
PROVIDE(kernel_data_end = .);
|
||||
__bss_stop = .;
|
||||
}
|
||||
|
||||
. = ALIGN((1 << 21));
|
||||
.sdata : {
|
||||
__global_pointer$ = . + 0x800;
|
||||
*(.sdata*)
|
||||
}
|
||||
. = ALIGN((1 << 21));
|
||||
_edata = .;
|
||||
_end = .;
|
||||
PROVIDE(end = .);
|
||||
}
|
||||
*/
|
|
@ -17,7 +17,8 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
|
@ -16,7 +16,8 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
|
@ -17,7 +17,8 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
|
@ -16,7 +16,8 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
|
@ -16,7 +16,8 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
|
@ -16,7 +16,8 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
|
@ -16,7 +16,8 @@ endif
|
|||
ifeq ($(BOARD), jh7110)
|
||||
toolchain ?= riscv64-unknown-elf-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -Wall -O0 -g -std=c11 -nostdlib -nodefaultlibs -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -fno-common -nostdlib -fno-builtin-strncpy -fno-builtin-strncmp -fno-builtin-strlen -fno-builtin-memset -fno-builtin-memmove -fno-builtin-memcmp -fno-builtin-log -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-exit -fno-builtin-malloc -fno-builtin-putc -fno-builtin-free -fno-builtin-memcpy -Wno-main -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -I. -fno-stack-protector -fno-pie -no-pie
|
||||
cflags = $(CFLAGS) -Wno-unused -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
cc = ${toolchain}gcc
|
||||
|
|
Loading…
Reference in New Issue