summaryrefslogtreecommitdiff
path: root/nuttx/examples/nxflat
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/examples/nxflat')
-rw-r--r--nuttx/examples/nxflat/tests/Make.defs6
-rw-r--r--nuttx/examples/nxflat/tests/Makefile2
-rw-r--r--nuttx/examples/nxflat/tests/errno/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/hello++/Makefile18
-rw-r--r--nuttx/examples/nxflat/tests/hello/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/longjmp/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/mutex/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/mutex/mutex.c13
-rw-r--r--nuttx/examples/nxflat/tests/pthread/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/signal/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/task/Makefile4
11 files changed, 28 insertions, 39 deletions
diff --git a/nuttx/examples/nxflat/tests/Make.defs b/nuttx/examples/nxflat/tests/Make.defs
index 3f4445a7a..9277ce9cb 100644
--- a/nuttx/examples/nxflat/tests/Make.defs
+++ b/nuttx/examples/nxflat/tests/Make.defs
@@ -39,6 +39,8 @@ NXFLATCXX = $(CXX)
NXFLATCXXFLAGS = $(CXXPICFLAGS)
NXFLATLD = $(LD)
-NXFLATLDFLAGS1 = -e main
-NXFLATLDFLAGS2 = -e main -T $(TOPDIR)/examples/nxflat/tests/nxflat.ld -no-check-sections
+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/Makefile b/nuttx/examples/nxflat/tests/Makefile
index 35ad4644e..979bbc92b 100644
--- a/nuttx/examples/nxflat/tests/Makefile
+++ b/nuttx/examples/nxflat/tests/Makefile
@@ -35,7 +35,7 @@
# Most of these do no build yet
#SUBDIRS = errno hello hello++ longjmp mutex pthread signal task
-SUBDIRS = errno hello pthread task
+SUBDIRS = errno hello mutex pthread task
define DIR_template
$(1)_$(2):
diff --git a/nuttx/examples/nxflat/tests/errno/Makefile b/nuttx/examples/nxflat/tests/errno/Makefile
index ad409e758..40544a1e0 100644
--- a/nuttx/examples/nxflat/tests/errno/Makefile
+++ b/nuttx/examples/nxflat/tests/errno/Makefile
@@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
@@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
- touch $(BIN) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core
diff --git a/nuttx/examples/nxflat/tests/hello++/Makefile b/nuttx/examples/nxflat/tests/hello++/Makefile
index 6d8388f23..f9419cf6c 100644
--- a/nuttx/examples/nxflat/tests/hello++/Makefile
+++ b/nuttx/examples/nxflat/tests/hello++/Makefile
@@ -59,7 +59,7 @@ R2SRC3 = $(BIN3)-thunk.S
R2OBJ3 = $(R2SRC3:.S=.o)
#R1SRCS4 = $(BIN4).c
-#R1OBJS4 = $(R1SRCS4:.c=.o)
+#R1OBJS4 = $(R1SRCS4:.c=.o)
#R2SRC4 = $(BIN4)-thunk.S
#R2OBJ4 = $(R2SRC4:.S=.o)
@@ -91,7 +91,7 @@ $(LIBSTDC_STUBS_LIB):
# not statically initialized.
$(BIN1).r1: $(R1OBJS1)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC1): $(BIN1).r1
$(MKNXFLAT) -o $@ $^
@@ -100,10 +100,10 @@ $(BIN1).r2: $(R2OBJ1)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS1) $(R2OBJ1)
$(BIN1): $(BIN1).r2
- touch $(BIN1) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
$(BIN2).r1: $(R1OBJS2) $(LIBSTDC_STUBS_LIB)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC2): $(BIN2).r1
$(MKNXFLAT) -o $@ $^
@@ -112,7 +112,7 @@ $(BIN2).r2: $(R2OBJ2)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS2) $(R2OBJ2)
(BIN2): $(BIN2).r2
- touch $(BIN2) # For now
+ $(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,7 +121,7 @@ $(BIN2).r2: $(R2OBJ2)
# BIN3 is equivalent to BIN2 except that is uses static initializers
$(BIN3).r1: $(R1OBJS3) $(LIBSTDC_STUBS_LIB)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC3): $(BIN3).r1
$(MKNXFLAT) -o $@ $^
@@ -130,14 +130,14 @@ $(BIN3).r2: $(R2OBJ3)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS3) $(R2OBJ3)
$(BIN3): $(BIN3).r2
- touch $(BIN3) # For now
+ $(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) -r $(NXFLATLDFLAGS1) -o $@ $^
+# $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
#
#$(R2SRC4): $(BIN4).r1
# $(MKNXFLAT) -o $@ $^
@@ -146,7 +146,7 @@ $(BIN3): $(BIN3).r2
# $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS4) $(R2OBJ4)
#
#$(BIN4): $(BIN4).r2
-# touch $(BIN4) # For now
+# $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(ALL_BIN) $(DERIVED) *.o *.r1 *.r2 *~ .*.swp core
diff --git a/nuttx/examples/nxflat/tests/hello/Makefile b/nuttx/examples/nxflat/tests/hello/Makefile
index 80912c075..7aea72240 100644
--- a/nuttx/examples/nxflat/tests/hello/Makefile
+++ b/nuttx/examples/nxflat/tests/hello/Makefile
@@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
@@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
- touch $(BIN) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core
diff --git a/nuttx/examples/nxflat/tests/longjmp/Makefile b/nuttx/examples/nxflat/tests/longjmp/Makefile
index fcca4c827..9ad186791 100644
--- a/nuttx/examples/nxflat/tests/longjmp/Makefile
+++ b/nuttx/examples/nxflat/tests/longjmp/Makefile
@@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
@@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
- touch $(BIN) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core
diff --git a/nuttx/examples/nxflat/tests/mutex/Makefile b/nuttx/examples/nxflat/tests/mutex/Makefile
index e52bcfb48..f4b58987b 100644
--- a/nuttx/examples/nxflat/tests/mutex/Makefile
+++ b/nuttx/examples/nxflat/tests/mutex/Makefile
@@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
@@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
- touch $(BIN) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core
diff --git a/nuttx/examples/nxflat/tests/mutex/mutex.c b/nuttx/examples/nxflat/tests/mutex/mutex.c
index dc42331ee..1553f0487 100644
--- a/nuttx/examples/nxflat/tests/mutex/mutex.c
+++ b/nuttx/examples/nxflat/tests/mutex/mutex.c
@@ -40,7 +40,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
-#include <signal.h>
/****************************************************************************
* Private Data
@@ -89,14 +88,6 @@ static void thread_func(void *parameter)
}
}
-static void signal_handler(int signo)
-{
- printf("\tThread1\tThread2\n");
- printf("Loops\t%ld\t%ld\n", nloops[0], nloops[1]);
- printf("Errors\t%ld\t%ld\n", nerrors[0], nerrors[1]);
- exit(0);
-}
-
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -107,10 +98,6 @@ int main(int argc, char **argv, char **envp)
printf("Starting threads\n");
- /* Set up to catch control-C interrupt */
-
- (void)signal(SIGINT, signal_handler);
-
/* Initialize the mutex */
pthread_mutex_init(&mut, NULL);
diff --git a/nuttx/examples/nxflat/tests/pthread/Makefile b/nuttx/examples/nxflat/tests/pthread/Makefile
index c4ffbd7c7..7008ec776 100644
--- a/nuttx/examples/nxflat/tests/pthread/Makefile
+++ b/nuttx/examples/nxflat/tests/pthread/Makefile
@@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
@@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
- touch $(BIN) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core
diff --git a/nuttx/examples/nxflat/tests/signal/Makefile b/nuttx/examples/nxflat/tests/signal/Makefile
index 197a410e6..c613cb0f1 100644
--- a/nuttx/examples/nxflat/tests/signal/Makefile
+++ b/nuttx/examples/nxflat/tests/signal/Makefile
@@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
@@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
- touch $(BIN) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core
diff --git a/nuttx/examples/nxflat/tests/task/Makefile b/nuttx/examples/nxflat/tests/task/Makefile
index 6fe0bd3e6..07254dba1 100644
--- a/nuttx/examples/nxflat/tests/task/Makefile
+++ b/nuttx/examples/nxflat/tests/task/Makefile
@@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
@@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ)
$(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
- touch $(BIN) # For now
+ $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
clean:
rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core