On Thu, Oct 15, 2009 at 11:55 AM, Garrett Cooper <[email protected]> wrote:
> On Thu, Oct 15, 2009 at 10:30 AM, Cyril Hrubis <[email protected]> wrote:
>> Hi!
>> Following patch should fix all troubles with get/set_mempolicy. Header
>> linux_syscall_numbers.h wasn't included in libcpuset.c and part of makefile
>> that creates symlink in $(LTP_TOPDIR)/include to this header was lost in
>> buildsystem rework. May be it would be be cleaner to move content of
>> testcases/kernel/include somewhere into include but at least with this patch 
>> it
>> should compile fine.
>
> Cyril,
>
>    This logic is covered in include/mk/testcases.mk as follows:
>
> include $(top_srcdir)/include/mk/env_pre.mk
>
> # For linux_syscall_numbers.h
> CPPFLAGS                += -I$(abs_top_builddir)/testcases/kernel/include
>
> INSTALL_DIR             := testcases/bin
>
> LDLIBS                  += -lltp
>
>    There's no reason why we have to go back to the hackish Makefile's
> -- we can just include testcases.mk if it's not included already (I
> admit, a smallhandful of testcases/... Makefile's didn't do this, but
> I did this on need-to-have basis).

    Err... cancel my suggestion for a second. cpuset_lib is a library,
which means it includes lib.mk, which has a slightly different set of
logic for libraries. This would be the correct complete solution:

Index: Makefile
===================================================================
RCS file: 
/cvsroot/ltp/ltp/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile    9 Oct 2009 17:55:46 -0000       1.3
+++ Makefile    15 Oct 2009 19:09:18 -0000
@@ -24,8 +24,22 @@

 include $(top_srcdir)/include/mk/env_pre.mk

+KERNEL_INCLUDE         := testcases/kernel/include
+
+CPPFLAGS               += -I$(KERNEL_INCLUDE)
+
 LDLIBS                 += -lm -lcontrollers

 LIB                    := libcpu_set.a

+LINUX_SYSCALL_NUMBERS  :=
$(abs_top_builddir)/$(KERNEL_INCLUDE)/linux_syscall_numbers.h
+
+all: | $(LINUX_SYSCALL_NUMBERS)
+
+$(abs_top_builddir)/$(KERNEL_INCLUDE):
+       mkdir -p "$@"
+
+$(LINUX_SYSCALL_NUMBERS): $(abs_top_builddir)/$(KERNEL_INCLUDE)
+       $(MAKE) -C "$(@D)" -f "$(abs_top_srcdir)/$(KERNEL_INCLUDE)/Makefile" all
+
 include        $(top_srcdir)/include/mk/lib.mk

    It goes off and makes the dependency, if required prior to
building anything. Otherwise the solution you proposed has no
guarantee that it will work (and most likely won't if someone's doing
a submake). Example:

gcoo...@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/controllers/cpuset/cpus
et_lib $ make all
make -C "/scratch/ltp-dev2/ltp/testcases/kernel/include" -f
"/scratch/ltp-dev2/ltp/testcases/kernel/include/Makefile" all
make[1]: Entering directory `/scratch/ltp-dev2/ltp/testcases/kernel/include'
Generating data for arch arm ... OK!
Generating data for arch hppa ... OK!
Generating data for arch i386 ... OK!
Generating data for arch ia64 ... OK!
Generating data for arch powerpc64 ... OK!
Generating data for arch powerpc ... OK!
Generating data for arch s390x ... OK!
Generating data for arch s390 ... OK!
Generating data for arch sh ... OK!
Generating data for arch sparc64 ... OK!
Generating data for arch sparc ... OK!
Generating data for arch x86_64 ... OK!
Generating stub list ... OK!
make[1]: Leaving directory `/scratch/ltp-dev2/ltp/testcases/kernel/include'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-I//scratch/ltp-install8/include -Itestcases/kernel/include
-I../../../../../include  -c -o cpuinfo.o cpuinfo.c
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-I//scratch/ltp-install8/include -Itestcases/kernel/include
-I../../../../../include  -c -o libbitmask.o libbitmask.c
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-I//scratch/ltp-install8/include -Itestcases/kernel/include
-I../../../../../include  -c -o libcpuset.o libcpuset.c
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-I//scratch/ltp-install8/include -Itestcases/kernel/include
-I../../../../../include  -c -o meminfo.o meminfo.c
if [ -z "cpuinfo.o libbitmask.o libcpuset.o meminfo.o" ] ; then \
                echo "Cowardly refusing to create empty archive"; \
                exit 1; \
        fi
ar -rc "libcpu_set.a" cpuinfo.o libbitmask.o libcpuset.o meminfo.o
ranlib "libcpu_set.a"

    The tab before $(MAKE) got incorrectly converted to spaces in the
email, so please don't use this patch for checkin -- only for review.

Thanks,
-Garrett

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to