[rtems-libbsd commit] link01 - Produce undefined list from relocatable and link errors

Joel Sherrill joel at rtems.org
Thu Apr 5 19:01:02 UTC 2012


Module:    rtems-libbsd
Branch:    master
Commit:    10c59c782c3b92e54054f7897c62fc281e26fa56
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=10c59c782c3b92e54054f7897c62fc281e26fa56

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Thu Apr  5 14:01:54 2012 -0500

link01 - Produce undefined list from relocatable and link errors

This helps when tracking down how many undefined symbols there
are and where they were defined.

---

 testsuite/link01/Makefile     |   15 +++++++++------
 testsuite/link01/Makefile_ldr |   31 +++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/testsuite/link01/Makefile b/testsuite/link01/Makefile
index a3a81de..a5134fc 100644
--- a/testsuite/link01/Makefile
+++ b/testsuite/link01/Makefile
@@ -5,6 +5,7 @@
 include ../../config.inc
 
 PGM=${ARCH}/link01.exe
+PGM_R=${ARCH}/link01_r.exe
 
 # optional managers required
 MANAGERS=all
@@ -14,7 +15,7 @@ C_FILES = test.c
 C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
 
 AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a -Wl,-r
+LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
 
 include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
 include $(RTEMS_CUSTOM)
@@ -23,10 +24,12 @@ include $(PROJECT_ROOT)/make/leaf.cfg
 OBJS= $(C_O_FILES)
 CLEAN_ADDITIONS += undefined.txt
 
-all:    ${ARCH} $(PGM)
+all:    ${ARCH} $(PGM_R) $(PGM)
+	$(NM) $(PGM_R) | grep "U " >undefined.txt
+	@echo `cat undefined.txt | wc -l` symbols to resolve
 
 $(PGM): $(OBJS)
-	$(make-exe)
-	$(NM) $(PGM) | grep "U " >undefined.txt
-	@echo `cat undefined.txt | wc -l` symbols to resolve
-	@test `cat undefined.txt | wc -l` -ne 0 && exit 1
+	-$(make-exe)
+
+$(PGM_R): $(OBJS)
+	$(MAKE) -f Makefile_ldr
diff --git a/testsuite/link01/Makefile_ldr b/testsuite/link01/Makefile_ldr
new file mode 100644
index 0000000..54db09a
--- /dev/null
+++ b/testsuite/link01/Makefile_ldr
@@ -0,0 +1,31 @@
+#
+#  $Id$
+#
+
+include ../../config.inc
+
+PGM=${ARCH}/link01_r.exe
+
+# optional managers required
+MANAGERS=all
+
+# C source names
+C_FILES = test.c
+C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
+
+AM_CPPFLAGS += -I $(INSTALL_BASE)/include
+LINK_LIBS += $(INSTALL_BASE)/libbsd.a -Wl,-r
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+OBJS= $(C_O_FILES)
+CLEAN_ADDITIONS += undefined.txt
+
+all:    ${ARCH} $(PGM)
+
+$(PGM): $(OBJS)
+	$(make-exe)
+
+# @test `cat undefined.txt | wc -l` -ne 0 && exit 1




More information about the vc mailing list