On 03.03.2007 [11:51:31 +1100], David Gibson wrote:
> On Fri, Mar 02, 2007 at 03:52:42PM -0800, Nishanth Aravamudan wrote:
> > On 02.03.2007 [15:12:06 -0800], Nishanth Aravamudan wrote:
> > > Makefile: add ia64, sparc64 support for functional tests only
> > > 
> > > Add simple support for ia64 and sparc64. We avoid doing the relink tests
> > > by adding another environment variable which only ia64 and sparc64
> > > define, which is checked in tests/Makefile. Also, explicitly fail to
> > > build on other architectures rather than silently doing nothing.
> > 
> > Makefile: add ia64, sparc64 support for functional tests only
> > 
> > Add simple support for ia64 and sparc64. We avoid doing the relink and
> > malloc tests by adding environment variables only defined for ia64 and
> > sparc64, which then are checked in tests/Makefile. Also, explicitly fail
> > to build on other architectures rather than silently doing nothing.
> > Finally, remove the unused dummy test from the Makefile and
> > run_tests.sh.
> 
> Rather than adding a new variable to stop the relink tests, why don't
> you just check for the absence of the ELF32 and ELF64 variables?

Because I'm dumb? :) Good point, updated patch below:

Makefile: add ia64, sparc64 support for functional tests only

Add simple support for ia64 and sparc64. We avoid doing the relink tests
by checking for ELF32/ELF64 emptiness and malloc tests by adding an
environment variable only defined for ia64 and sparc64, which then is
checked in tests/Makefile. Also, explicitly fail to build on other
architectures rather than silently doing nothing. Finally, remove the
unused dummy test from the Makefile and run_tests.sh.

Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>

diff --git a/Makefile b/Makefile
index d169042..b31defd 100644
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,20 @@ ifneq ($(BUILDTYPE),NATIVEONLY)
 CC32 = gcc -m32
 ELF32 = elf_i386
 endif
+else
+ifeq ($(ARCH),ia64)
+CC64 = gcc
+LIB64 = lib64
+ARCH_MORECORE_NOT_SUPPORTED = 1
+else
+ifeq ($(ARCH),sparc64)
+CC64 = gcc -m64
+LIB64 = lib64
+ARCH_MORECORE_NOT_SUPPORTED = 1
+else
+$(error "Unrecognized architecture ($(ARCH))")
+endif
+endif
 endif
 endif
 endif
@@ -91,6 +105,7 @@ export ELF32
 export ELF64
 export LIBDIR32
 export LIBDIR64
+export ARCH_MORECORE_NOT_SUPPORTED
 
 all:   libs tests
 
diff --git a/tests/Makefile b/tests/Makefile
index 6939784..91f3066 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -9,7 +9,7 @@ LIB_TESTS = gethugepagesize test_root find_path unlinked_fd \
        misaligned_offset brk_near_huge task-size-overrun stack_grow_into_huge
 LIB_TESTS_64 = straddle_4GB huge_at_4GB_normal_below \
        huge_below_4GB_normal_above
-NOLIB_TESTS = malloc malloc_manysmall dummy
+MORECORE_TESTS = malloc malloc_manysmall
 LDSCRIPT_TESTS = zero_filesize_segment
 HUGELINK_TESTS = linkhuge linkhuge_nofd linkshare
 STRESS_TESTS = mmap-gettest mmap-cow shm-gettest shm-getraw shm-fork
@@ -22,9 +22,14 @@ LDFLAGS32 = -L../obj32
 LDFLAGS64 = -L../obj64
 INSTALL = install
 
-TESTS = $(LIB_TESTS) $(NOLIB_TESTS) $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) \
-       $(HUGELINK_TESTS:%=xB.%) $(HUGELINK_TESTS:%=xBDT.%) \
-       $(STRESS_TESTS)
+TESTS = $(LIB_TESTS) $(LDSCRIPT_TESTS) $(STRESS_TESTS)
+
+ifneq ($(ARCH_MORECORE_NOT_SUPPORTED),1)
+TESTS += $(MORECORE_TESTS)
+endif
+ifneq ($(or $(ELF32),$(ELF64)),)
+TESTS += $(HUGELINK_TESTS) $(HUGELINK_TESTS:%=xB.%) $(HUGELINK_TESTS:%=xBDT.%)
+endif
 
 TESTS_64 = $(LIB_TESTS_64)
 
@@ -42,7 +47,7 @@ VECHO = echo "        "
 .SILENT:
 endif
 
-DEPFILES = $(LIB_TESTS:%=%.d) $(NOLIB_TESTS:%=%.d) $(HUGELINK_TESTS:%=%.d) \
+DEPFILES = $(LIB_TESTS:%=%.d) $(MORECORE_TESTS:%=%.d) $(HUGELINK_TESTS:%=%.d) \
        $(HELPERS:%=%.d) testutils.d
 
 ALLTESTS = $(foreach DIR,$(OBJDIRS),$(TESTS:%=$(DIR)/%))
@@ -71,11 +76,11 @@ $(LIB_TESTS:%=obj64/%) $(LIB_TESTS_64:%=obj64/%): %: %.o 
obj64/testutils.o
        @$(VECHO) LD64 "(lib test)" $@
        $(CC64) $(LDFLAGS) $(LDFLAGS64) -o $@ $^ $(LDLIBS) -lhugetlbfs 
 
-$(NOLIB_TESTS:%=obj32/%): %: %.o obj32/testutils.o
+$(MORECORE_TESTS:%=obj32/%): %: %.o obj32/testutils.o
        @$(VECHO) LD32 "(nolib test)" $@
        $(CC32) $(LDFLAGS) $(LDFLAGS32) -o $@ $^ $(LDLIBS)
 
-$(NOLIB_TESTS:%=obj64/%): %: %.o obj64/testutils.o
+$(MORECORE_TESTS:%=obj64/%): %: %.o obj64/testutils.o
        @$(VECHO) LD64 "(nolib test)" $@
        $(CC64) $(LDFLAGS) $(LDFLAGS64) -o $@ $^ $(LDLIBS)
 
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 3ab4532..6b6f1bb 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -125,7 +125,6 @@ restore_shm_sysctl() {
 }
 
 functional_tests () {
-    #run_test dummy
 # Kernel background tests not requiring hugepage support
     run_test zero_filesize_segment
 
-- 
Nishanth Aravamudan <[EMAIL PROTECTED]>
IBM Linux Technology Center

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to