From 9efb63994aed4981a319bcf45cde5a883909e018 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 21 Jun 2009 16:58:58 +0000 Subject: Flesh out examples/nxflat build environment git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1921 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/binfmt/libnxflat/gnu-nxflat.ld | 172 ++++++++++++++++++++++ nuttx/configs/c5471evm/Make.defs | 6 + nuttx/configs/eagle100/httpd/Make.defs | 6 + nuttx/configs/eagle100/nettest/Make.defs | 6 + nuttx/configs/eagle100/nsh/Make.defs | 6 + nuttx/configs/eagle100/nxflat/Make.defs | 6 + nuttx/configs/eagle100/ostest/Make.defs | 6 + nuttx/configs/mcu123-lpc214x/nsh/Make.defs | 6 + nuttx/configs/mcu123-lpc214x/ostest/Make.defs | 6 + nuttx/configs/mcu123-lpc214x/usbserial/Make.defs | 6 + nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs | 6 + nuttx/configs/mx1ads/ostest/Make.defs | 6 + nuttx/configs/ntosd-dm320/nettest/Make.defs | 6 + nuttx/configs/ntosd-dm320/nsh/Make.defs | 6 + nuttx/configs/ntosd-dm320/ostest/Make.defs | 6 + nuttx/configs/ntosd-dm320/poll/Make.defs | 6 + nuttx/configs/ntosd-dm320/udp/Make.defs | 6 + nuttx/configs/ntosd-dm320/uip/Make.defs | 6 + nuttx/configs/olimex-strp711/nsh/Make.defs | 6 + nuttx/configs/olimex-strp711/ostest/Make.defs | 6 + nuttx/examples/null/null_main.c | 40 ++--- nuttx/examples/nxflat/Makefile | 8 +- nuttx/examples/nxflat/nxflat_main.c | 83 +++++++++++ nuttx/examples/nxflat/tests/Make.defs | 46 ------ nuttx/examples/nxflat/tests/errno/Makefile | 23 +-- nuttx/examples/nxflat/tests/hello++/Makefile | 65 ++++---- nuttx/examples/nxflat/tests/hello/Makefile | 23 +-- nuttx/examples/nxflat/tests/longjmp/Makefile | 23 +-- nuttx/examples/nxflat/tests/mutex/Makefile | 23 +-- nuttx/examples/nxflat/tests/nxflat.ld | 172 ---------------------- nuttx/examples/nxflat/tests/pthread/Makefile | 23 +-- nuttx/examples/nxflat/tests/signal/Makefile | 23 +-- nuttx/examples/nxflat/tests/task/Makefile | 23 +-- 33 files changed, 533 insertions(+), 328 deletions(-) create mode 100644 nuttx/binfmt/libnxflat/gnu-nxflat.ld create mode 100644 nuttx/examples/nxflat/nxflat_main.c delete mode 100644 nuttx/examples/nxflat/tests/Make.defs delete mode 100644 nuttx/examples/nxflat/tests/nxflat.ld (limited to 'nuttx') diff --git a/nuttx/binfmt/libnxflat/gnu-nxflat.ld b/nuttx/binfmt/libnxflat/gnu-nxflat.ld new file mode 100644 index 0000000000..9a59c0ec09 --- /dev/null +++ b/nuttx/binfmt/libnxflat/gnu-nxflat.ld @@ -0,0 +1,172 @@ +/**************************************************************************** + * examples/nxflat/nxflat.ld + * + * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name NuttX 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 OWNER 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 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +MEMORY +{ + ISPACE : ORIGIN = 0x0, LENGTH = 2097152 + DSPACE : ORIGIN = 0x0, LENGTH = 2097152 +} + +/**************************************************************************** + * The XFLAT program image is divided into two segments: + * + * (1) ISpace (Instruction Space). This is the segment that contains + * code (.text). Everything in the segment should be fetch-able + * machine PC instructions (jump, branch, call, etc.). + * (2) DSpace (Data Space). This is the segment that contains both + * read-write data (.data, .bss) as well as read-only data (.rodata). + * Everything in this segment should be access-able with machine + * with machine load and store instructions. + ****************************************************************************/ + +SECTIONS +{ + .text 0x00000000 : + { + /* ISpace is located at address 0. Every (unrelocated) ISpace + * address is an offset from the begining of this segment. + */ + + text_start = . ; + + *(.text) + *(.text.*) + *(.gnu.warning) + *(.stub) + *(.glue_7) + *(.glue_7t) + *(.jcr) + + /* C++ support: The .init and .fini sections contain XFLAT- + * specific logic to manage static constructors and destructors. + */ + + *(.gnu.linkonce.t.*) + *(.init) + *(.fini) + + /* This is special code area at the end of the normal + text section. It contains a small lookup table at + the start followed by the code pointed to by entries + in the lookup table. */ + + . = ALIGN (4) ; + PROVIDE(__ctbp = .); + *(.call_table_data) + *(.call_table_text) + + _etext = . ; + + } > ISPACE + + /* DSpace is also located at address 0. Every (unrelocated) DSpace + * address is an offset from the begining of this segment. + */ + + .data 0x00000000 : + { + __data_start = . ; + *(.rodata) + *(.rodata1) + *(.rodata.*) + *(.gnu.linkonce.r*) + *(.data) + *(.data1) + *(.data.*) + *(.gnu.linkonce.d*) + *(.data1) + *(.eh_frame) + *(.gcc_except_table) + + *(.gnu.linkonce.s.*) + *(__libc_atexit) + *(__libc_subinit) + *(__libc_subfreeres) + *(.note.ABI-tag) + + /* C++ support. For each global and static local C++ object, + * GCC creates a small subroutine to construct the object. Pointers + * to these routines (not the routines themselves) are stored as + * simple, linear arrays in the .ctors section of the object file. + * Similarly, pointers to global/static destructor routines are + * stored in .dtors. + */ + + *(.gnu.linkonce.d.*) + + _ctors_start = . ; + *(.ctors) + _ctors_end = . ; + _dtors_start = . ; + *(.dtors) + _dtors_end = . ; + + _edata = . ; + edata = ALIGN( 0x10 ) ; + } > DSPACE + + .bss : + { + __bss_start = _edata ; + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.scommon) + *(.dynbss) + *(.bss) + *(.bss.*) + *(.bss*) + *(.gnu.linkonce.b*) + *(COMMON) + end = ALIGN( 0x10 ) ; + _end = ALIGN( 0x10 ) ; + } > DSPACE + + .got 0 : { *(.got.plt) *(.got) } + .junk 0 : { *(.rel*) *(.rela*) } + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } +} diff --git a/nuttx/configs/c5471evm/Make.defs b/nuttx/configs/c5471evm/Make.defs index 3751f7c30f..94a853b627 100644 --- a/nuttx/configs/c5471evm/Make.defs +++ b/nuttx/configs/c5471evm/Make.defs @@ -71,6 +71,12 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/eagle100/httpd/Make.defs b/nuttx/configs/eagle100/httpd/Make.defs index 1b8282b5eb..e8c7330664 100644 --- a/nuttx/configs/eagle100/httpd/Make.defs +++ b/nuttx/configs/eagle100/httpd/Make.defs @@ -95,6 +95,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/eagle100/nettest/Make.defs b/nuttx/configs/eagle100/nettest/Make.defs index 03ae27f54c..944fbe29eb 100644 --- a/nuttx/configs/eagle100/nettest/Make.defs +++ b/nuttx/configs/eagle100/nettest/Make.defs @@ -95,6 +95,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/eagle100/nsh/Make.defs b/nuttx/configs/eagle100/nsh/Make.defs index dead72b732..4b30ea9eff 100644 --- a/nuttx/configs/eagle100/nsh/Make.defs +++ b/nuttx/configs/eagle100/nsh/Make.defs @@ -95,6 +95,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/eagle100/nxflat/Make.defs b/nuttx/configs/eagle100/nxflat/Make.defs index 9885c44d33..72a51bf800 100644 --- a/nuttx/configs/eagle100/nxflat/Make.defs +++ b/nuttx/configs/eagle100/nxflat/Make.defs @@ -98,6 +98,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/eagle100/ostest/Make.defs b/nuttx/configs/eagle100/ostest/Make.defs index b7dfca3a79..1d0049fd4f 100644 --- a/nuttx/configs/eagle100/ostest/Make.defs +++ b/nuttx/configs/eagle100/ostest/Make.defs @@ -95,6 +95,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs index 475a6cbb4d..d4d776bdce 100644 --- a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs @@ -107,6 +107,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs index 9255c59945..3e5ac3a0a0 100644 --- a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs @@ -107,6 +107,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs index 933e50ef07..8d56c9d73e 100644 --- a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs @@ -107,6 +107,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs index de475239ce..5fb0374219 100644 --- a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs @@ -107,6 +107,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/mx1ads/ostest/Make.defs b/nuttx/configs/mx1ads/ostest/Make.defs index c45d006e30..89bad6d864 100644 --- a/nuttx/configs/mx1ads/ostest/Make.defs +++ b/nuttx/configs/mx1ads/ostest/Make.defs @@ -81,6 +81,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/ntosd-dm320/nettest/Make.defs b/nuttx/configs/ntosd-dm320/nettest/Make.defs index 73611d11c1..baf82a4bfa 100644 --- a/nuttx/configs/ntosd-dm320/nettest/Make.defs +++ b/nuttx/configs/ntosd-dm320/nettest/Make.defs @@ -72,6 +72,12 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/ntosd-dm320/nsh/Make.defs b/nuttx/configs/ntosd-dm320/nsh/Make.defs index d46051160d..d75f7ae8ec 100644 --- a/nuttx/configs/ntosd-dm320/nsh/Make.defs +++ b/nuttx/configs/ntosd-dm320/nsh/Make.defs @@ -72,6 +72,12 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/ntosd-dm320/ostest/Make.defs b/nuttx/configs/ntosd-dm320/ostest/Make.defs index 6feacaa939..589723ec90 100644 --- a/nuttx/configs/ntosd-dm320/ostest/Make.defs +++ b/nuttx/configs/ntosd-dm320/ostest/Make.defs @@ -72,6 +72,12 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/ntosd-dm320/poll/Make.defs b/nuttx/configs/ntosd-dm320/poll/Make.defs index 8e6b123c87..8966a537d4 100644 --- a/nuttx/configs/ntosd-dm320/poll/Make.defs +++ b/nuttx/configs/ntosd-dm320/poll/Make.defs @@ -72,6 +72,12 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/ntosd-dm320/udp/Make.defs b/nuttx/configs/ntosd-dm320/udp/Make.defs index 0d183ad3a7..1d97b966bc 100644 --- a/nuttx/configs/ntosd-dm320/udp/Make.defs +++ b/nuttx/configs/ntosd-dm320/udp/Make.defs @@ -72,6 +72,12 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/ntosd-dm320/uip/Make.defs b/nuttx/configs/ntosd-dm320/uip/Make.defs index 5effc873db..cef41734f1 100644 --- a/nuttx/configs/ntosd-dm320/uip/Make.defs +++ b/nuttx/configs/ntosd-dm320/uip/Make.defs @@ -72,6 +72,12 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/olimex-strp711/nsh/Make.defs b/nuttx/configs/olimex-strp711/nsh/Make.defs index 3c00e29717..cc0f59ac42 100644 --- a/nuttx/configs/olimex-strp711/nsh/Make.defs +++ b/nuttx/configs/olimex-strp711/nsh/Make.defs @@ -107,6 +107,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/configs/olimex-strp711/ostest/Make.defs b/nuttx/configs/olimex-strp711/ostest/Make.defs index 5d368774c8..0389389654 100644 --- a/nuttx/configs/olimex-strp711/ostest/Make.defs +++ b/nuttx/configs/olimex-strp711/ostest/Make.defs @@ -107,6 +107,12 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + OBJEXT = .o LIBEXT = .a EXEEXT = diff --git a/nuttx/examples/null/null_main.c b/nuttx/examples/null/null_main.c index 5b3c8c16b8..fa0a1473d8 100644 --- a/nuttx/examples/null/null_main.c +++ b/nuttx/examples/null/null_main.c @@ -1,7 +1,7 @@ -/************************************************************ - * null_main.c +/**************************************************************************** + * examples/null/null_main.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -31,43 +31,43 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Types - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Data - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Name: user_initialize - ************************************************************/ + ****************************************************************************/ void user_initialize(void) { } -/************************************************************ +/**************************************************************************** * Name: user_start - ************************************************************/ + ****************************************************************************/ int user_start(int argc, char *argv[]) { diff --git a/nuttx/examples/nxflat/Makefile b/nuttx/examples/nxflat/Makefile index 5c9e4e5cea..d597b3b3f6 100644 --- a/nuttx/examples/nxflat/Makefile +++ b/nuttx/examples/nxflat/Makefile @@ -38,7 +38,7 @@ ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = +CSRCS = nxflat_main.c COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) @@ -47,6 +47,7 @@ OBJS = $(AOBJS) $(COBJS) BIN = lib$(CONFIG_EXAMPLE)$(LIBEXT) all: $(BIN) +.PHONY: tests/romfs.h tests/dirlist.h clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -54,7 +55,10 @@ $(AOBJS): %$(OBJEXT): %.S $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(BIN): $(OBJS) +headers: + @$(MAKE) -C tests TOPDIR=$(TOPDIR) CROSSDEV=$(CROSSDEV) + +$(BIN): headers $(OBJS) @( for obj in $(OBJS) ; do \ $(call ARCHIVE, $@, $${obj}); \ done ; ) diff --git a/nuttx/examples/nxflat/nxflat_main.c b/nuttx/examples/nxflat/nxflat_main.c new file mode 100644 index 0000000000..3eddcb4a23 --- /dev/null +++ b/nuttx/examples/nxflat/nxflat_main.c @@ -0,0 +1,83 @@ +/**************************************************************************** + * examples/nxflat/nxflat_main.c + * + * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name NuttX 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 OWNER 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 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include + +#include "tests/romfs.h" +#include "tests/dirlist.h" + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: user_initialize + ****************************************************************************/ + +void user_initialize(void) +{ +} + +/**************************************************************************** + * Name: user_start + ****************************************************************************/ + +int user_start(int argc, char *argv[]) +{ + return 0; +} diff --git a/nuttx/examples/nxflat/tests/Make.defs b/nuttx/examples/nxflat/tests/Make.defs deleted file mode 100644 index 9277ce9cbc..0000000000 --- a/nuttx/examples/nxflat/tests/Make.defs +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################ -# examples/nxflat/Make.defs -# -# Copyright (C) 2009 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. 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. -# 3. Neither the name NuttX 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 OWNER 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 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -NXFLATCC = $(CC) -NXFLATCFLAGS = $(CPICFLAGS) -NXFLATCXX = $(CXX) -NXFLATCXXFLAGS = $(CXXPICFLAGS) - -NXFLATLD = $(LD) -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T $(TOPDIR)/examples/nxflat/tests/nxflat.ld -no-check-sections - -LDNXFLATFLAGS = -e main -s 2048 - diff --git a/nuttx/examples/nxflat/tests/errno/Makefile b/nuttx/examples/nxflat/tests/errno/Makefile index 40544a1e08..158768b852 100644 --- a/nuttx/examples/nxflat/tests/errno/Makefile +++ b/nuttx/examples/nxflat/tests/errno/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN = errno @@ -48,26 +47,32 @@ R2OBJ = $(R2SRC:.S=.o) all: $(BIN) $(R1OBJS): %.o: %.c - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "CC: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(R2OBJ): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN).r2: $(R2OBJ) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core install: - install -D $(BIN) $(ROMFS_DIR)/$(BIN) + @install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/nuttx/examples/nxflat/tests/hello++/Makefile b/nuttx/examples/nxflat/tests/hello++/Makefile index f9419cf6c9..e282816197 100644 --- a/nuttx/examples/nxflat/tests/hello++/Makefile +++ b/nuttx/examples/nxflat/tests/hello++/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN1 = hello++1 BIN2 = hello++2 @@ -74,16 +73,18 @@ LIBSTDC_STUBS_LIB = $(LIBSTDC_STUBS_DIR)/liblibxx.a all: $(BIN1) $(BIN2) $(BIN3) # $(BIN4) $(R1CXXOBJS): %.o: %.cpp - $(NXFLATCXX) -c $(NXFLATCXXFLAGS) $< -o $@ + @echo "CC: $<" + @$(CXX) -c $(CXXPICFLAGS) $< -o $@ $(R2AOBJS): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ # This contains libstdc++ stubs to that you can build C++ code # without actually having libstdc++ $(LIBSTDC_STUBS_LIB): - $(MAKE) -C $(LIBSTDC_STUBS_DIR) TOPDIR=$(TOPDIR) + @$(MAKE) -C $(LIBSTDC_STUBS_DIR) TOPDIR=$(TOPDIR) # BIN1 and BIN2 link just like C code because they contain no # static constructors. BIN1 is equivalent to a C hello world; @@ -91,28 +92,35 @@ $(LIBSTDC_STUBS_LIB): # not statically initialized. $(BIN1).r1: $(R1OBJS1) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC1): $(BIN1).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN1).r2: $(R2OBJ1) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS1) $(R2OBJ1) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS1) $(R2OBJ1) $(BIN1): $(BIN1).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ $(BIN2).r1: $(R1OBJS2) $(LIBSTDC_STUBS_LIB) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC2): $(BIN2).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN2).r2: $(R2OBJ2) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS2) $(R2OBJ2) + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS2) $(R2OBJ2) -(BIN2): $(BIN2).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(BIN2): $(BIN2).r2 + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ # BIN3 and BIN4 require that we include --cxx in the xflat-ld command. # This will instruct xflat-ld that we want it to put togethe the correct @@ -121,41 +129,48 @@ $(BIN2).r2: $(R2OBJ2) # BIN3 is equivalent to BIN2 except that is uses static initializers $(BIN3).r1: $(R1OBJS3) $(LIBSTDC_STUBS_LIB) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC3): $(BIN3).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN3).r2: $(R2OBJ3) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS3) $(R2OBJ3) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS3) $(R2OBJ3) $(BIN3): $(BIN3).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ # BIN4 is similar to BIN3 except that it uses the streams code from libstdc++ # # NOTE: libstdc++ is not available for XFLAT as of this writing # #$(BIN4).r1: $(R1OBJS4) $(LIBSTDC_STUBS_LIB) -# $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ +# @echo "LD: $<" +# $(LD) $(NXFLATLDFLAGS1) -o $@ $^ # #$(R2SRC4): $(BIN4).r1 +# @echo "MK: $<" # $(MKNXFLAT) -o $@ $^ # -#$(BIN4).r2: $(R2OBJ4) -# $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS4) $(R2OBJ4) +#$(BIN4).r2: $(R2OBJ4)# @echo "LD: $<" +# $(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS4) $(R2OBJ4) # #$(BIN4): $(BIN4).r2 +# @echo "LD: $<" # $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(ALL_BIN) $(DERIVED) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(ALL_BIN) $(DERIVED) *.o *.r1 *.r2 *~ .*.swp core install: $(ALL_BIN) - install -D $(BIN1) $(ROMFS_DIR)/$(BIN1) - install -D $(BIN2) $(ROMFS_DIR)/$(BIN2) - install -D $(BIN3) $(ROMFS_DIR)/$(BIN3) -# install -D $(BIN4) $(ROMFS_DIR)/$(BIN4) + @install -D $(BIN1) $(ROMFS_DIR)/$(BIN1) + @install -D $(BIN2) $(ROMFS_DIR)/$(BIN2) + @install -D $(BIN3) $(ROMFS_DIR)/$(BIN3) +# @install -D $(BIN4) $(ROMFS_DIR)/$(BIN4) diff --git a/nuttx/examples/nxflat/tests/hello/Makefile b/nuttx/examples/nxflat/tests/hello/Makefile index 7aea72240e..ccde7a98f2 100644 --- a/nuttx/examples/nxflat/tests/hello/Makefile +++ b/nuttx/examples/nxflat/tests/hello/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN = hello @@ -48,26 +47,32 @@ R2OBJ = $(R2SRC:.S=.o) all: $(BIN) $(R1OBJS): %.o: %.c - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "CC: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(R2OBJ): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN).r2: $(R2OBJ) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core install: - install -D $(BIN) $(ROMFS_DIR)/$(BIN) + @install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/nuttx/examples/nxflat/tests/longjmp/Makefile b/nuttx/examples/nxflat/tests/longjmp/Makefile index 9ad186791c..d0c93ebbda 100644 --- a/nuttx/examples/nxflat/tests/longjmp/Makefile +++ b/nuttx/examples/nxflat/tests/longjmp/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN = longjmp @@ -48,26 +47,32 @@ R2OBJ = $(R2SRC:.S=.o) all: $(BIN) $(R1OBJS): %.o: %.c - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "CC: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(R2OBJ): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN).r2: $(R2OBJ) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core install: - install -D $(BIN) $(ROMFS_DIR)/$(BIN) + @install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/nuttx/examples/nxflat/tests/mutex/Makefile b/nuttx/examples/nxflat/tests/mutex/Makefile index f4b58987b0..8c9fbb4a31 100644 --- a/nuttx/examples/nxflat/tests/mutex/Makefile +++ b/nuttx/examples/nxflat/tests/mutex/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN = mutex @@ -48,26 +47,32 @@ R2OBJ = $(R2SRC:.S=.o) all: $(BIN) $(R1OBJS): %.o: %.c - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "CC: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(R2OBJ): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN).r2: $(R2OBJ) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core install: - install -D $(BIN) $(ROMFS_DIR)/$(BIN) + @install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/nuttx/examples/nxflat/tests/nxflat.ld b/nuttx/examples/nxflat/tests/nxflat.ld deleted file mode 100644 index 9a59c0ec09..0000000000 --- a/nuttx/examples/nxflat/tests/nxflat.ld +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** - * examples/nxflat/nxflat.ld - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. Neither the name NuttX 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 OWNER 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 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -MEMORY -{ - ISPACE : ORIGIN = 0x0, LENGTH = 2097152 - DSPACE : ORIGIN = 0x0, LENGTH = 2097152 -} - -/**************************************************************************** - * The XFLAT program image is divided into two segments: - * - * (1) ISpace (Instruction Space). This is the segment that contains - * code (.text). Everything in the segment should be fetch-able - * machine PC instructions (jump, branch, call, etc.). - * (2) DSpace (Data Space). This is the segment that contains both - * read-write data (.data, .bss) as well as read-only data (.rodata). - * Everything in this segment should be access-able with machine - * with machine load and store instructions. - ****************************************************************************/ - -SECTIONS -{ - .text 0x00000000 : - { - /* ISpace is located at address 0. Every (unrelocated) ISpace - * address is an offset from the begining of this segment. - */ - - text_start = . ; - - *(.text) - *(.text.*) - *(.gnu.warning) - *(.stub) - *(.glue_7) - *(.glue_7t) - *(.jcr) - - /* C++ support: The .init and .fini sections contain XFLAT- - * specific logic to manage static constructors and destructors. - */ - - *(.gnu.linkonce.t.*) - *(.init) - *(.fini) - - /* This is special code area at the end of the normal - text section. It contains a small lookup table at - the start followed by the code pointed to by entries - in the lookup table. */ - - . = ALIGN (4) ; - PROVIDE(__ctbp = .); - *(.call_table_data) - *(.call_table_text) - - _etext = . ; - - } > ISPACE - - /* DSpace is also located at address 0. Every (unrelocated) DSpace - * address is an offset from the begining of this segment. - */ - - .data 0x00000000 : - { - __data_start = . ; - *(.rodata) - *(.rodata1) - *(.rodata.*) - *(.gnu.linkonce.r*) - *(.data) - *(.data1) - *(.data.*) - *(.gnu.linkonce.d*) - *(.data1) - *(.eh_frame) - *(.gcc_except_table) - - *(.gnu.linkonce.s.*) - *(__libc_atexit) - *(__libc_subinit) - *(__libc_subfreeres) - *(.note.ABI-tag) - - /* C++ support. For each global and static local C++ object, - * GCC creates a small subroutine to construct the object. Pointers - * to these routines (not the routines themselves) are stored as - * simple, linear arrays in the .ctors section of the object file. - * Similarly, pointers to global/static destructor routines are - * stored in .dtors. - */ - - *(.gnu.linkonce.d.*) - - _ctors_start = . ; - *(.ctors) - _ctors_end = . ; - _dtors_start = . ; - *(.dtors) - _dtors_end = . ; - - _edata = . ; - edata = ALIGN( 0x10 ) ; - } > DSPACE - - .bss : - { - __bss_start = _edata ; - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.scommon) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.bss*) - *(.gnu.linkonce.b*) - *(COMMON) - end = ALIGN( 0x10 ) ; - _end = ALIGN( 0x10 ) ; - } > DSPACE - - .got 0 : { *(.got.plt) *(.got) } - .junk 0 : { *(.rel*) *(.rela*) } - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/nuttx/examples/nxflat/tests/pthread/Makefile b/nuttx/examples/nxflat/tests/pthread/Makefile index 7008ec7768..27da42e7cd 100644 --- a/nuttx/examples/nxflat/tests/pthread/Makefile +++ b/nuttx/examples/nxflat/tests/pthread/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN = pthread @@ -48,26 +47,32 @@ R2OBJ = $(R2SRC:.S=.o) all: $(BIN) $(R1OBJS): %.o: %.c - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "CC: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(R2OBJ): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN).r2: $(R2OBJ) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core install: - install -D $(BIN) $(ROMFS_DIR)/$(BIN) + @install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/nuttx/examples/nxflat/tests/signal/Makefile b/nuttx/examples/nxflat/tests/signal/Makefile index c613cb0f17..d967fbf09a 100644 --- a/nuttx/examples/nxflat/tests/signal/Makefile +++ b/nuttx/examples/nxflat/tests/signal/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN = signal @@ -48,26 +47,32 @@ R2OBJ = $(R2SRC:.S=.o) all: $(BIN) $(R1OBJS): %.o: %.c - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "CC: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(R2OBJ): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN).r2: $(R2OBJ) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core install: - install -D $(BIN) $(ROMFS_DIR)/$(BIN) + @install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/nuttx/examples/nxflat/tests/task/Makefile b/nuttx/examples/nxflat/tests/task/Makefile index 07254dba18..0881d4717a 100644 --- a/nuttx/examples/nxflat/tests/task/Makefile +++ b/nuttx/examples/nxflat/tests/task/Makefile @@ -35,7 +35,6 @@ -include $(TOPDIR)/.config # Current configuration -include $(TOPDIR)/Make.defs # Basic make info -include ../Make.defs # NXFLAT make info BIN = task @@ -48,27 +47,33 @@ R2OBJ = $(R2SRC:.S=.o) all: $(BIN) $(R1OBJS): %.o: %.c - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "CC: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(R2OBJ): %.o: %.S - $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ + @echo "AS: $<" + @$(CC) -c $(CPICFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 - $(MKNXFLAT) -o $@ $^ + @echo "MK: $<" + @$(MKNXFLAT) -o $@ $^ $(BIN).r2: $(R2OBJ) - $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) + @echo "LD: $<" + @$(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ + @echo "LD: $<" + @$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: - rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core + @rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core install: - install -D $(BIN) $(ROMFS_DIR)/$(BIN) + @install -D $(BIN) $(ROMFS_DIR)/$(BIN) -- cgit v1.2.3